	.file	"extr_l2cap.c_l2cap_signal.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"l2cap_signal: Allocate memory for l2cap_sig. Code = 0x%x\n"
	.align 8
.LC1:
	.string	"l2cap_signal: could not allocate memory for l2cap_sig\n"
	.align 8
.LC2:
	.string	"l2cap_signal: could not allocate memory for pbuf\n"
	.align 8
.LC3:
	.string	"l2cap_signal: Sending response/reject signal with id = %d code = %d\n"
	.align 8
.LC4:
	.string	"l2cap_signal: Sending request signal with id = %d code = %d\n"
	.align 8
.LC5:
	.string	"l2cap_signal: Registering sent request signal with id = %d code = %d\n"
	.align 8
.LC6:
	.string	"l2cap_signal: Deallocating sent response/reject signal with id = %d code = %d\n"
	.text
	.p2align 4
	.globl	l2cap_signal
	.type	l2cap_signal, @function
l2cap_signal:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	mov	r15d, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR 8[rsp], rdi
	lea	rdi, .LC0[rip]
	call	LOG@PLT
	lea	rdi, l2cap_sigs[rip]
	call	btmemb_alloc@PLT
	test	rax, rax
	je	.L13
	mov	edi, DWORD PTR PBUF_RAW[rip]
	mov	edx, DWORD PTR PBUF_RAM[rip]
	mov	rbp, rax
	mov	esi, DWORD PTR L2CAP_SIGHDR_LEN[rip]
	add	esi, DWORD PTR L2CAP_HDR_LEN[rip]
	call	btpbuf_alloc@PLT
	mov	QWORD PTR 0[rbp], rax
	mov	rdi, rax
	test	rax, rax
	je	.L14
	movsx	rdx, DWORD PTR L2CAP_HDR_LEN[rip]
	mov	rax, QWORD PTR 8[rax]
	lea	r12, [rax+rdx*4]
	test	rbx, rbx
	je	.L15
	mov	rsi, rbx
	call	btpbuf_chain@PLT
	mov	rdi, rbx
	call	btpbuf_free@PLT
	mov	edi, DWORD PTR [rbx]
	call	htole16@PLT
	mov	DWORD PTR [r12], r15d
	mov	QWORD PTR 8[r12], rax
	test	r15b, 1
	je	.L7
.L17:
	mov	DWORD PTR 8[rbp], r14d
	mov	edx, r15d
	mov	esi, r14d
	xor	eax, eax
	lea	rdi, .LC3[rip]
	call	LOG@PLT
.L8:
	mov	eax, DWORD PTR 8[rbp]
	mov	DWORD PTR 4[r12], eax
	mov	rax, QWORD PTR 0[rbp]
	mov	rbx, QWORD PTR 8[rax]
	mov	edi, DWORD PTR [rax]
	sub	edi, DWORD PTR L2CAP_HDR_LEN[rip]
	call	htole16@PLT
	mov	edi, DWORD PTR L2CAP_SIG_CID[rip]
	mov	QWORD PTR 8[rbx], rax
	call	htole16@PLT
	mov	rsi, QWORD PTR 0[rbp]
	mov	rdi, r13
	mov	QWORD PTR [rbx], rax
	mov	edx, DWORD PTR [rsi]
	call	l2cap_write@PLT
	cmp	QWORD PTR ERR_OK[rip], rax
	mov	edx, DWORD PTR [r12]
	mov	esi, DWORD PTR 8[rbp]
	mov	r13, rax
	jne	.L10
	test	dl, 1
	je	.L16
.L10:
	lea	rdi, .LC6[rip]
	xor	eax, eax
	call	LOG@PLT
	mov	rdi, QWORD PTR 0[rbp]
	call	btpbuf_free@PLT
	mov	QWORD PTR 0[rbp], 0
	mov	rsi, rbp
	lea	rdi, l2cap_sigs[rip]
	call	btmemb_free@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r13
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	QWORD PTR 8[r12], 0
	mov	DWORD PTR [r12], r15d
	test	r15b, 1
	jne	.L17
.L7:
	xor	eax, eax
	call	l2cap_next_sigid@PLT
	mov	edx, DWORD PTR [r12]
	lea	rdi, .LC4[rip]
	mov	DWORD PTR 8[rbp], eax
	mov	esi, eax
	mov	eax, DWORD PTR L2CAP_RTX[rip]
	mov	DWORD PTR 16[rbp], eax
	mov	eax, DWORD PTR L2CAP_MAXRTX[rip]
	mov	DWORD PTR 12[rbp], eax
	xor	eax, eax
	call	LOG@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rdi, .LC1[rip]
	call	ERROR@PLT
	mov	r13, QWORD PTR ERR_MEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	LOG@PLT
	mov	rdi, QWORD PTR 8[rsp]
	mov	rsi, rbp
	call	L2CAP_SIG_REG@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC2[rip]
	call	ERROR@PLT
	mov	r13, QWORD PTR ERR_MEM[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	l2cap_signal, .-l2cap_signal
	.comm	l2cap_sigs,4,4
	.comm	PBUF_RAW,4,4
	.comm	PBUF_RAM,4,4
	.comm	L2CAP_SIG_CID,4,4
	.comm	L2CAP_SIGHDR_LEN,4,4
	.comm	L2CAP_RTX,4,4
	.comm	L2CAP_MAXRTX,4,4
	.comm	L2CAP_HDR_LEN,4,4
	.comm	ERR_OK,8,8
	.comm	ERR_MEM,8,8
	.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_l2cap.c_l2cap_signal.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"l2cap_signal: Allocate memory for l2cap_sig. Code ="
	.ascii	" 0x%x\012\000"
	.align	2
.LC1:
	.ascii	"l2cap_signal: could not allocate memory for l2cap_s"
	.ascii	"ig\012\000"
	.align	2
.LC2:
	.ascii	"l2cap_signal: could not allocate memory for pbuf\012"
	.ascii	"\000"
	.align	2
.LC3:
	.ascii	"l2cap_signal: Sending response/reject signal with i"
	.ascii	"d = %d code = %d\012\000"
	.align	2
.LC4:
	.ascii	"l2cap_signal: Sending request signal with id = %d c"
	.ascii	"ode = %d\012\000"
	.align	2
.LC5:
	.ascii	"l2cap_signal: Registering sent request signal with "
	.ascii	"id = %d code = %d\012\000"
	.align	2
.LC6:
	.ascii	"l2cap_signal: Deallocating sent response/reject sig"
	.ascii	"nal with id = %d code = %d\012\000"
	.text
	.align	2
	.global	l2cap_signal
	.syntax unified
	.arm
	.fpu softvfp
	.type	l2cap_signal, %function
l2cap_signal:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r0, .L17
	sub	sp, sp, #12
	mov	r7, r2
	mov	r6, r3
	mov	r5, r1
	str	ip, [sp, #4]
	bl	LOG
	ldr	r0, .L17+4
	bl	btmemb_alloc
	subs	r4, r0, #0
	beq	.L13
	ldr	r2, .L17+8
	ldr	r10, .L17+12
	ldr	r1, [r2]
	ldr	ip, [r10]
	ldr	r2, .L17+16
	ldr	r0, .L17+20
	ldr	r2, [r2]
	ldr	r0, [r0]
	add	r1, ip, r1
	bl	btpbuf_alloc
	cmp	r0, #0
	str	r0, [r4]
	beq	.L14
	ldr	r8, [r0, #4]
	ldr	r3, [sp, #48]
	ldr	r9, [r10]
	cmp	r3, #0
	add	fp, r8, r9, lsl #2
	streq	r3, [fp, #8]
	beq	.L6
	ldr	r1, [sp, #48]
	bl	btpbuf_chain
	ldr	r0, [sp, #48]
	bl	btpbuf_free
	ldr	r3, [sp, #48]
	ldr	r0, [r3]
	bl	htole16
	str	r0, [fp, #8]
.L6:
	tst	r5, #1
	str	r5, [r8, r9, lsl #2]
	bne	.L15
	bl	l2cap_next_sigid
	mov	r1, r0
	ldr	r2, .L17+24
	ldr	r0, .L17+28
	ldr	r2, [r2]
	ldr	r0, [r0]
	str	r2, [r4, #8]
	str	r0, [r4, #12]
	ldr	r2, [r8, r9, lsl #2]
	ldr	r0, .L17+32
	str	r1, [r4, #4]
	bl	LOG
.L8:
	ldr	r2, [r4]
	ldr	r1, [r10]
	ldr	r0, [r2]
	ldr	r3, [r4, #4]
	sub	r0, r0, r1
	str	r3, [fp, #4]
	ldr	r5, [r2, #4]
	bl	htole16
	ldr	r3, .L17+36
	str	r0, [r5, #4]
	ldr	r0, [r3]
	bl	htole16
	ldr	r1, [r4]
	str	r0, [r5]
	ldr	r2, [r1]
	mov	r0, r6
	bl	l2cap_write
	ldr	r3, .L17+40
	mov	r5, r0
	ldr	r3, [r3]
	ldr	r2, [r8, r9, lsl #2]
	cmp	r3, r0
	ldr	r1, [r4, #4]
	bne	.L10
	tst	r2, #1
	beq	.L16
.L10:
	ldr	r0, .L17+44
	bl	LOG
	ldr	r0, [r4]
	bl	btpbuf_free
	mov	r3, #0
	mov	r1, r4
	ldr	r0, .L17+4
	str	r3, [r4]
	bl	btmemb_free
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	mov	r2, r5
	mov	r1, r7
	str	r7, [r4, #4]
	ldr	r0, .L17+48
	bl	LOG
	b	.L8
.L13:
	ldr	r0, .L17+52
	bl	ERROR
	ldr	r3, .L17+56
	ldr	r5, [r3]
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r0, .L17+60
	bl	LOG
	mov	r1, r4
	ldr	r0, [sp, #4]
	bl	L2CAP_SIG_REG
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	ldr	r0, .L17+64
	bl	ERROR
	ldr	r3, .L17+56
	ldr	r5, [r3]
	b	.L1
.L18:
	.align	2
.L17:
	.word	.LC0
	.word	l2cap_sigs
	.word	L2CAP_SIGHDR_LEN
	.word	L2CAP_HDR_LEN
	.word	PBUF_RAM
	.word	PBUF_RAW
	.word	L2CAP_MAXRTX
	.word	L2CAP_RTX
	.word	.LC4
	.word	L2CAP_SIG_CID
	.word	ERR_OK
	.word	.LC6
	.word	.LC3
	.word	.LC1
	.word	ERR_MEM
	.word	.LC5
	.word	.LC2
	.size	l2cap_signal, .-l2cap_signal
	.comm	l2cap_sigs,4,4
	.comm	PBUF_RAW,4,4
	.comm	PBUF_RAM,4,4
	.comm	L2CAP_SIG_CID,4,4
	.comm	L2CAP_SIGHDR_LEN,4,4
	.comm	L2CAP_RTX,4,4
	.comm	L2CAP_MAXRTX,4,4
	.comm	L2CAP_HDR_LEN,4,4
	.comm	ERR_OK,4,4
	.comm	ERR_MEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
