	.file	"extr_l2c_utils.c_l2cu_adjust_out_mps.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"l2cu_adjust_out_mps bad packet size: %u  will use MPS: %u"
	.align 8
.LC1:
	.string	"l2cu_adjust_out_mps use %d   Based on peer_cfg.fcr.mps: %u  packet_size: %u"
	.text
	.p2align 4
	.globl	l2cu_adjust_out_mps
	.type	l2cu_adjust_out_mps, @function
l2cu_adjust_out_mps:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rax, QWORD PTR 8[rdi]
	mov	rbx, rdi
	mov	edi, DWORD PTR [rax]
	call	btm_get_max_packet_size@PLT
	mov	edx, DWORD PTR L2CAP_FCR_OVERHEAD[rip]
	add	edx, DWORD PTR L2CAP_PKT_OVERHEAD[rip]
	add	edx, DWORD PTR L2CAP_SDU_LEN_OVERHEAD[rip]
	add	edx, DWORD PTR L2CAP_FCS_LEN[rip]
	cmp	edx, eax
	jge	.L9
	mov	r8d, DWORD PTR 4[rbx]
	sub	eax, edx
	mov	ecx, eax
	mov	esi, r8d
	cmp	r8d, eax
	jl	.L4
	mov	eax, r8d
	cdq
	idiv	ecx
	imul	eax, ecx
	mov	esi, eax
.L4:
	mov	DWORD PTR [rbx], esi
	mov	edx, r8d
	lea	rdi, .LC1[rip]
	xor	eax, eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	L2CAP_TRACE_DEBUG@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	edx, DWORD PTR 4[rbx]
	mov	esi, eax
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	L2CAP_TRACE_DEBUG@PLT
	mov	eax, DWORD PTR 4[rbx]
	mov	DWORD PTR [rbx], eax
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	l2cu_adjust_out_mps, .-l2cu_adjust_out_mps
	.comm	L2CAP_SDU_LEN_OVERHEAD,4,4
	.comm	L2CAP_PKT_OVERHEAD,4,4
	.comm	L2CAP_FCS_LEN,4,4
	.comm	L2CAP_FCR_OVERHEAD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_l2c_utils.c_l2cu_adjust_out_mps.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"l2cu_adjust_out_mps bad packet size: %u  will use M"
	.ascii	"PS: %u\000"
	.global	__aeabi_idiv
	.align	2
.LC1:
	.ascii	"l2cu_adjust_out_mps use %d   Based on peer_cfg.fcr."
	.ascii	"mps: %u  packet_size: %u\000"
	.text
	.align	2
	.global	l2cu_adjust_out_mps
	.syntax unified
	.arm
	.fpu softvfp
	.type	l2cu_adjust_out_mps, %function
l2cu_adjust_out_mps:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #8]
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r0, [r3]
	bl	btm_get_max_packet_size
	mov	r1, r0
	ldr	r3, .L10
	ldr	r0, .L10+4
	ldr	r2, .L10+8
	ldr	ip, [r0]
	ldr	r3, [r3]
	ldr	r0, .L10+12
	ldr	r2, [r2]
	ldr	r0, [r0]
	add	r3, r3, ip
	add	r3, r3, r2
	add	r3, r3, r0
	cmp	r3, r1
	bge	.L9
	ldr	r6, [r5, #4]
	sub	r4, r1, r3
	cmp	r6, r4
	movlt	r1, r6
	blt	.L4
	mov	r1, r4
	mov	r0, r6
	bl	__aeabi_idiv
	mul	r1, r4, r0
.L4:
	mov	r3, r4
	mov	r2, r6
	str	r1, [r5]
	ldr	r0, .L10+16
	pop	{r4, r5, r6, lr}
	b	L2CAP_TRACE_DEBUG
.L9:
	ldr	r2, [r5, #4]
	ldr	r0, .L10+20
	bl	L2CAP_TRACE_DEBUG
	ldr	r3, [r5, #4]
	str	r3, [r5]
	pop	{r4, r5, r6, pc}
.L11:
	.align	2
.L10:
	.word	L2CAP_PKT_OVERHEAD
	.word	L2CAP_FCR_OVERHEAD
	.word	L2CAP_SDU_LEN_OVERHEAD
	.word	L2CAP_FCS_LEN
	.word	.LC1
	.word	.LC0
	.size	l2cu_adjust_out_mps, .-l2cu_adjust_out_mps
	.comm	L2CAP_SDU_LEN_OVERHEAD,4,4
	.comm	L2CAP_PKT_OVERHEAD,4,4
	.comm	L2CAP_FCS_LEN,4,4
	.comm	L2CAP_FCR_OVERHEAD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
