	.file	"extr_l2cap.c_l2cap_conn_start.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"conn %p"
	.text
	.p2align 4
	.type	l2cap_conn_start, @function
l2cap_conn_start:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	rsi, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	lea	rdi, .LC0[rip]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	BT_DBG@PLT
	mov	rdi, r12
	call	read_lock@PLT
	mov	rbp, QWORD PTR 8[r12]
	test	rbp, rbp
	je	.L2
	mov	rbx, rsp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	rax, QWORD PTR BT_CONNECT2[rip]
	je	.L21
.L7:
	mov	rdi, rbp
	call	bh_unlock_sock@PLT
	mov	rdi, rbp
	call	l2cap_pi@PLT
	mov	rbp, QWORD PTR 16[rax]
	test	rbp, rbp
	je	.L2
.L12:
	mov	rdi, rbp
	call	bh_lock_sock@PLT
	mov	rax, QWORD PTR SOCK_SEQPACKET[rip]
	cmp	QWORD PTR 0[rbp], rax
	jne	.L7
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR BT_CONNECT[rip]
	jne	.L5
	mov	rdi, rbp
	call	l2cap_check_security@PLT
	test	rax, rax
	je	.L7
	mov	rdi, rbp
	call	l2cap_pi@PLT
	mov	edi, DWORD PTR 4[rax]
	call	cpu_to_le16@PLT
	mov	rdi, rbp
	mov	QWORD PTR 24[rsp], rax
	call	l2cap_pi@PLT
	mov	rdi, rbp
	mov	eax, DWORD PTR 12[rax]
	mov	DWORD PTR 32[rsp], eax
	call	l2cap_pi@PLT
	mov	rdi, r12
	mov	r13, rax
	call	l2cap_get_ident@PLT
	mov	DWORD PTR 0[r13], eax
	mov	r13d, DWORD PTR L2CAP_CONN_REQ[rip]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, r12
	call	read_unlock@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	rdi, rbp
	call	l2cap_pi@PLT
	mov	edi, DWORD PTR 8[rax]
	call	cpu_to_le16@PLT
	mov	rdi, rbp
	mov	QWORD PTR 24[rsp], rax
	call	l2cap_pi@PLT
	mov	edi, DWORD PTR 4[rax]
	call	cpu_to_le16@PLT
	mov	rdi, rbp
	mov	QWORD PTR 16[rsp], rax
	call	l2cap_check_security@PLT
	test	rax, rax
	jne	.L23
	mov	edi, DWORD PTR L2CAP_CR_PEND[rip]
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR L2CAP_CS_AUTHEN_PEND[rip]
	mov	QWORD PTR 8[rsp], rax
	call	cpu_to_le16@PLT
	mov	QWORD PTR [rsp], rax
.L11:
	mov	r13d, DWORD PTR L2CAP_CONN_RSP[rip]
.L19:
	mov	rdi, rbp
	call	l2cap_pi@PLT
	mov	r8, rbx
	mov	ecx, 40
	mov	edx, r13d
	mov	esi, DWORD PTR [rax]
	mov	rdi, r12
	call	l2cap_send_cmd@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, rbp
	call	bt_sk@PLT
	cmp	QWORD PTR 8[rax], 0
	je	.L10
	mov	rdi, rbp
	call	bt_sk@PLT
	mov	edi, DWORD PTR L2CAP_CR_PEND[rip]
	mov	r13, QWORD PTR [rax]
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR L2CAP_CS_AUTHOR_PEND[rip]
	mov	QWORD PTR 8[rsp], rax
	call	cpu_to_le16@PLT
	xor	esi, esi
	mov	rdi, r13
	mov	QWORD PTR [rsp], rax
	call	[QWORD PTR 16[r13]]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR BT_CONFIG[rip]
	mov	edi, DWORD PTR L2CAP_CR_SUCCESS[rip]
	mov	QWORD PTR 8[rbp], rax
	call	cpu_to_le16@PLT
	mov	edi, DWORD PTR L2CAP_CS_NO_INFO[rip]
	mov	QWORD PTR 8[rsp], rax
	call	cpu_to_le16@PLT
	mov	QWORD PTR [rsp], rax
	jmp	.L11
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	l2cap_conn_start, .-l2cap_conn_start
	.comm	SOCK_SEQPACKET,8,8
	.comm	L2CAP_CS_NO_INFO,4,4
	.comm	L2CAP_CS_AUTHOR_PEND,4,4
	.comm	L2CAP_CS_AUTHEN_PEND,4,4
	.comm	L2CAP_CR_SUCCESS,4,4
	.comm	L2CAP_CR_PEND,4,4
	.comm	L2CAP_CONN_RSP,4,4
	.comm	L2CAP_CONN_REQ,4,4
	.comm	BT_CONNECT2,8,8
	.comm	BT_CONNECT,8,8
	.comm	BT_CONFIG,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_conn_start.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"conn %p\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	l2cap_conn_start, %function
l2cap_conn_start:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r0
	ldr	r3, .L22
	sub	sp, sp, #44
	mov	r1, r6
	ldr	r0, .L22+4
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	bl	BT_DBG
	mov	r0, r6
	bl	read_lock
	ldr	r4, [r6, #4]
	cmp	r4, #0
	beq	.L2
	ldr	r5, .L22+8
	ldr	r7, .L22+12
	ldr	r8, .L22+16
	ldr	r9, .L22+20
	ldr	r10, .L22+24
	ldr	fp, .L22+28
	b	.L12
.L5:
	ldr	r2, [r8]
	cmp	r3, r2
	beq	.L20
.L7:
	mov	r0, r4
	bl	bh_unlock_sock
	mov	r0, r4
	bl	l2cap_pi
	ldr	r4, [r0, #16]
	cmp	r4, #0
	beq	.L2
.L12:
	mov	r0, r4
	bl	bh_lock_sock
	ldr	r2, [r4]
	ldr	r3, [r5]
	cmp	r2, r3
	bne	.L7
	ldr	r3, [r4, #4]
	ldr	r2, [r7]
	cmp	r3, r2
	bne	.L5
	mov	r0, r4
	bl	l2cap_check_security
	cmp	r0, #0
	beq	.L7
	mov	r0, r4
	bl	l2cap_pi
	ldr	r0, [r0, #4]
	bl	cpu_to_le16
	mov	r3, r0
	mov	r0, r4
	str	r3, [sp, #28]
	bl	l2cap_pi
	ldr	r3, [r0, #12]
	mov	r0, r4
	str	r3, [sp, #32]
	bl	l2cap_pi
	mov	r3, r0
	mov	r0, r6
	str	r3, [sp, #12]
	bl	l2cap_get_ident
	mov	r2, r0
	ldr	r3, [sp, #12]
	mov	r0, r4
	str	r2, [r3]
	bl	l2cap_pi
	ldr	r2, .L22+32
	add	r3, sp, #16
	ldr	r1, [r0]
	ldr	r2, [r2]
	mov	r0, r6
	str	r3, [sp]
	mov	r3, #20
	bl	l2cap_send_cmd
	b	.L7
.L2:
	mov	r0, r6
	bl	read_unlock
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	mov	r0, r4
	bl	l2cap_pi
	ldr	r0, [r0, #8]
	bl	cpu_to_le16
	mov	r3, r0
	mov	r0, r4
	str	r3, [sp, #28]
	bl	l2cap_pi
	ldr	r0, [r0, #4]
	bl	cpu_to_le16
	mov	r3, r0
	mov	r0, r4
	str	r3, [sp, #24]
	bl	l2cap_check_security
	cmp	r0, #0
	beq	.L9
	mov	r0, r4
	bl	bt_sk
	ldr	r3, [r0, #4]
	cmp	r3, #0
	beq	.L10
	mov	r0, r4
	bl	bt_sk
	mov	r3, r0
	ldr	r3, [r3]
	ldr	r0, [r10]
	str	r3, [sp, #12]
	bl	cpu_to_le16
	ldr	r2, .L22+36
	str	r0, [sp, #20]
	ldr	r0, [r2]
	bl	cpu_to_le16
	ldr	r3, [sp, #12]
	mov	r1, #0
	ldr	r2, [r3, #8]
	str	r0, [sp, #16]
	mov	r0, r3
	blx	r2
	b	.L11
.L9:
	ldr	r0, [r10]
	bl	cpu_to_le16
	mov	r3, r0
	ldr	r0, [fp]
	str	r3, [sp, #20]
	bl	cpu_to_le16
	str	r0, [sp, #16]
.L11:
	mov	r0, r4
	bl	l2cap_pi
	add	r3, sp, #16
	ldr	r1, [r0]
	ldr	r2, [r9]
	str	r3, [sp]
	mov	r0, r6
	mov	r3, #20
	bl	l2cap_send_cmd
	b	.L7
.L10:
	ldr	r3, .L22+40
	ldr	r2, [r3]
	ldr	r3, .L22+44
	str	r2, [r4, #4]
	ldr	r0, [r3]
	bl	cpu_to_le16
	ldr	r3, .L22+48
	str	r0, [sp, #20]
	ldr	r0, [r3]
	bl	cpu_to_le16
	str	r0, [sp, #16]
	b	.L11
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC1
	.word	.LC0
	.word	SOCK_SEQPACKET
	.word	BT_CONNECT
	.word	BT_CONNECT2
	.word	L2CAP_CONN_RSP
	.word	L2CAP_CR_PEND
	.word	L2CAP_CS_AUTHEN_PEND
	.word	L2CAP_CONN_REQ
	.word	L2CAP_CS_AUTHOR_PEND
	.word	BT_CONFIG
	.word	L2CAP_CR_SUCCESS
	.word	L2CAP_CS_NO_INFO
	.size	l2cap_conn_start, .-l2cap_conn_start
	.comm	SOCK_SEQPACKET,4,4
	.comm	L2CAP_CS_NO_INFO,4,4
	.comm	L2CAP_CS_AUTHOR_PEND,4,4
	.comm	L2CAP_CS_AUTHEN_PEND,4,4
	.comm	L2CAP_CR_SUCCESS,4,4
	.comm	L2CAP_CR_PEND,4,4
	.comm	L2CAP_CONN_RSP,4,4
	.comm	L2CAP_CONN_REQ,4,4
	.comm	BT_CONNECT2,4,4
	.comm	BT_CONNECT,4,4
	.comm	BT_CONFIG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
