	.file	"extr_link_control.c_hci_add_sco_connection.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%x"
.LC1:
	.string	"%d"
.LC2:
	.string	"Status: %s [%#02x]\n"
.LC3:
	.string	"BD_ADDR: %s\n"
.LC4:
	.string	"Connection handle: %d\n"
.LC5:
	.string	"Encryption mode: %s [%d]\n"
	.text
	.p2align 4
	.type	hci_add_sco_connection, @function
hci_add_sco_connection:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	xor	esi, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdx
	mov	edx, 8
	sub	rsp, 552
	.cfi_def_cfa_offset 592
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 536[rsp], rax
	xor	eax, eax
	lea	r12, 8[rsp]
	mov	rdi, r12
	call	memset@PLT
	mov	edi, DWORD PTR NG_HCI_PKT_HV1[rip]
	or	edi, DWORD PTR NG_HCI_PKT_HV2[rip]
	or	edi, DWORD PTR NG_HCI_PKT_HV3[rip]
	call	htole16@PLT
	mov	DWORD PTR 8[rsp], eax
	cmp	r13d, 1
	je	.L25
	mov	eax, DWORD PTR USAGE[rip]
	cmp	r13d, 2
	jne	.L1
	lea	r13, 4[rsp]
	mov	rdi, QWORD PTR 8[rbx]
	lea	rsi, .LC0[rip]
	mov	rdx, r13
	call	sscanf@PLT
	cmp	eax, 1
	je	.L4
.L7:
	mov	eax, DWORD PTR USAGE[rip]
.L1:
	mov	rcx, QWORD PTR 536[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L26
	add	rsp, 552
	.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
.L25:
	.cfi_restore_state
	lea	r13, 4[rsp]
.L2:
	mov	rdi, QWORD PTR [rbx]
	mov	rdx, r13
	lea	rsi, .LC1[rip]
	call	sscanf@PLT
	cmp	eax, 1
	jne	.L7
	mov	edi, DWORD PTR 4[rsp]
	lea	eax, -1[rdi]
	cmp	eax, 3838
	ja	.L7
	mov	DWORD PTR 12[rsp], edi
	lea	rbx, 16[rsp]
	call	htole16@PLT
	mov	esi, DWORD PTR NG_HCI_OCF_ADD_SCO_CON[rip]
	mov	edi, DWORD PTR NG_HCI_OGF_LINK_CONTROL[rip]
	mov	DWORD PTR 4[rsp], 512
	mov	DWORD PTR 12[rsp], eax
	call	NG_HCI_OPCODE@PLT
	mov	r9, r13
	mov	r8, rbx
	mov	ecx, 8
	mov	esi, eax
	mov	rdx, r12
	mov	edi, ebp
	call	hci_request@PLT
	cmp	rax, QWORD PTR ERROR[rip]
	je	.L1
	cmp	BYTE PTR 16[rsp], 0
	je	.L11
.L23:
	mov	eax, DWORD PTR FAILED[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR NG_HCI_PKT_HV1[rip]
	or	edi, DWORD PTR NG_HCI_PKT_HV2[rip]
	or	edi, DWORD PTR NG_HCI_PKT_HV3[rip]
	and	edi, DWORD PTR 4[rsp]
	mov	DWORD PTR 4[rsp], edi
	je	.L7
	and	edi, 4095
	mov	DWORD PTR 8[rsp], edi
	call	htole16@PLT
	mov	DWORD PTR 8[rsp], eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rax, QWORD PTR NG_HCI_EVENT_CON_COMPL[rip]
	cmp	QWORD PTR 16[rsp], rax
	je	.L27
.L11:
	mov	rdx, r13
	mov	rsi, rbx
	mov	edi, ebp
	mov	DWORD PTR 4[rsp], 512
	call	hci_recv@PLT
	mov	rdx, QWORD PTR ERROR[rip]
	cmp	rax, rdx
	je	.L1
	cmp	DWORD PTR 4[rsp], 7
	ja	.L13
	mov	eax, DWORD PTR EIO[rip]
	mov	DWORD PTR errno[rip], eax
	mov	eax, edx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L27:
	mov	r12d, DWORD PTR 24[rsp]
	test	r12d, r12d
	jne	.L28
	lea	rdi, 36[rsp]
	call	hci_bdaddr2str@PLT
	mov	edi, DWORD PTR stdout[rip]
	lea	rsi, .LC3[rip]
	mov	rdx, rax
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, DWORD PTR 32[rsp]
	call	le16toh@PLT
	mov	edi, DWORD PTR stdout[rip]
	lea	rsi, .LC4[rip]
	mov	edx, eax
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR 28[rsp]
	xor	esi, esi
	mov	edi, r12d
	call	hci_encrypt2str@PLT
	mov	edi, DWORD PTR stdout[rip]
	mov	ecx, r12d
	lea	rsi, .LC5[rip]
	mov	rdx, rax
	xor	eax, eax
	call	fprintf@PLT
	mov	eax, DWORD PTR OK[rip]
	jmp	.L1
.L28:
	mov	edi, r12d
	call	hci_status2str@PLT
	mov	edi, DWORD PTR stdout[rip]
	mov	ecx, r12d
	lea	rsi, .LC2[rip]
	mov	rdx, rax
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L23
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hci_add_sco_connection, .-hci_add_sco_connection
	.comm	stdout,4,4
	.comm	errno,4,4
	.comm	USAGE,4,4
	.comm	OK,4,4
	.comm	NG_HCI_PKT_HV3,4,4
	.comm	NG_HCI_PKT_HV2,4,4
	.comm	NG_HCI_PKT_HV1,4,4
	.comm	NG_HCI_OGF_LINK_CONTROL,4,4
	.comm	NG_HCI_OCF_ADD_SCO_CON,4,4
	.comm	NG_HCI_EVENT_CON_COMPL,8,8
	.comm	FAILED,4,4
	.comm	ERROR,8,8
	.comm	EIO,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_link_control.c_hci_add_sco_connection.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%x\000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"Status: %s [%#02x]\012\000"
	.align	2
.LC3:
	.ascii	"BD_ADDR: %s\012\000"
	.align	2
.LC4:
	.ascii	"Connection handle: %d\012\000"
	.align	2
.LC5:
	.ascii	"Encryption mode: %s [%d]\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hci_add_sco_connection, %function
hci_add_sco_connection:
	@ args = 0, pretend = 0, frame = 528
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, #0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r8, .L28
	ldr	r7, .L28+4
	ldr	r6, .L28+8
	ldr	r3, [r8]
	ldr	lr, [r7]
	mov	r5, r0
	ldr	r0, [r6]
	orr	r3, r3, lr
	orr	r0, r3, r0
	ldr	r3, .L28+12
	sub	sp, sp, #540
	mov	r4, r1
	ldr	r3, [r3]
	str	r3, [sp, #532]
	mov	r3,#0
	mov	r9, r2
	str	ip, [sp, #12]
	str	ip, [sp, #16]
	bl	htole16
	cmp	r4, #1
	str	r0, [sp, #12]
	addeq	r4, sp, #8
	beq	.L2
	cmp	r4, #2
	bne	.L3
	add	r4, sp, #8
	mov	r2, r4
	ldr	r1, .L28+16
	ldr	r0, [r9, #4]
	bl	sscanf
	cmp	r0, #1
	beq	.L4
.L3:
	ldr	r3, .L28+20
	ldr	r0, [r3]
.L1:
	ldr	r3, .L28+12
	ldr	r2, [r3]
	ldr	r3, [sp, #532]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L25
	add	sp, sp, #540
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L4:
	ldr	r3, [r7]
	ldr	r0, [r8]
	ldr	r2, [r6]
	orr	r0, r0, r3
	ldr	r3, [sp, #8]
	orr	r0, r0, r2
	and	r0, r0, r3
	cmp	r0, #0
	str	r0, [sp, #8]
	beq	.L3
	lsl	r0, r0, #20
	lsr	r0, r0, #20
	str	r0, [sp, #12]
	bl	htole16
	str	r0, [sp, #12]
.L2:
	mov	r2, r4
	ldr	r0, [r9]
	ldr	r1, .L28+24
	bl	sscanf
	cmp	r0, #1
	bne	.L3
	ldr	r0, [sp, #8]
	ldr	r3, .L28+28
	sub	r2, r0, #1
	cmp	r2, r3
	bhi	.L3
	str	r0, [sp, #16]
	bl	htole16
	mov	r6, #512
	mov	r3, r0
	ldr	r2, .L28+32
	ldr	r1, .L28+36
	ldr	r0, [r2]
	ldr	r1, [r1]
	str	r3, [sp, #16]
	str	r6, [sp, #8]
	bl	NG_HCI_OPCODE
	add	r7, sp, #20
	mov	r1, r0
	mov	r3, #8
	mov	r0, r5
	str	r4, [sp, #4]
	add	r2, sp, #12
	str	r7, [sp]
	bl	hci_request
	mov	r3, r0
	ldr	r8, .L28+40
	ldr	r0, [r8]
	cmp	r3, r0
	beq	.L1
	ldrb	r3, [sp, #20]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L23
	ldr	r9, .L28+44
	b	.L10
.L11:
	ldr	r2, [sp, #20]
	ldr	r3, [r9]
	cmp	r2, r3
	beq	.L26
.L10:
	mov	r2, r4
	mov	r1, r7
	mov	r0, r5
	str	r6, [sp, #8]
	bl	hci_recv
	mov	r3, r0
	ldr	r0, [r8]
	cmp	r3, r0
	beq	.L1
	ldr	r3, [sp, #8]
	cmp	r3, #3
	bhi	.L11
	ldr	r2, .L28+48
	ldr	r3, .L28+52
	ldr	r2, [r2]
	str	r2, [r3]
	b	.L1
.L27:
	mov	r0, r5
	bl	hci_status2str
	ldr	r3, [sp, #24]
	mov	r2, r0
	ldr	r1, .L28+56
	mov	r0, r6
	bl	fprintf
.L23:
	ldr	r3, .L28+60
	ldr	r0, [r3]
	b	.L1
.L26:
	ldr	r5, [sp, #24]
	ldr	r4, .L28+64
	cmp	r5, #0
	ldr	r6, [r4]
	bne	.L27
	add	r0, sp, #36
	bl	hci_bdaddr2str
	ldr	r1, .L28+68
	mov	r2, r0
	mov	r0, r6
	bl	fprintf
	ldr	r0, [sp, #32]
	ldr	r6, [r4]
	bl	le16toh
	ldr	r1, .L28+72
	mov	r2, r0
	mov	r0, r6
	bl	fprintf
	mov	r1, r5
	ldr	r0, [sp, #28]
	ldr	r4, [r4]
	bl	hci_encrypt2str
	ldr	r3, [sp, #28]
	mov	r2, r0
	ldr	r1, .L28+76
	mov	r0, r4
	bl	fprintf
	ldr	r3, .L28+80
	ldr	r0, [r3]
	b	.L1
.L25:
	bl	__stack_chk_fail
.L29:
	.align	2
.L28:
	.word	NG_HCI_PKT_HV1
	.word	NG_HCI_PKT_HV2
	.word	NG_HCI_PKT_HV3
	.word	.LC6
	.word	.LC0
	.word	USAGE
	.word	.LC1
	.word	3838
	.word	NG_HCI_OGF_LINK_CONTROL
	.word	NG_HCI_OCF_ADD_SCO_CON
	.word	ERROR
	.word	NG_HCI_EVENT_CON_COMPL
	.word	EIO
	.word	errno
	.word	.LC2
	.word	FAILED
	.word	stdout
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	OK
	.size	hci_add_sco_connection, .-hci_add_sco_connection
	.comm	stdout,4,4
	.comm	errno,4,4
	.comm	USAGE,4,4
	.comm	OK,4,4
	.comm	NG_HCI_PKT_HV3,4,4
	.comm	NG_HCI_PKT_HV2,4,4
	.comm	NG_HCI_PKT_HV1,4,4
	.comm	NG_HCI_OGF_LINK_CONTROL,4,4
	.comm	NG_HCI_OCF_ADD_SCO_CON,4,4
	.comm	NG_HCI_EVENT_CON_COMPL,4,4
	.comm	FAILED,4,4
	.comm	ERROR,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
