	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_conn_complete_evt
_hci_conn_complete_evt:                 ## @hci_conn_complete_evt
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %r13
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	%r14, %rdi
	callq	_hci_dev_lock
	movq	(%r13), %rsi
	leaq	20(%r13), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_hci_conn_hash_lookup_ba
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	cmpq	$0, 8(%r13)
	je	LBB0_5
LBB0_17:
	movq	_BT_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	jmp	LBB0_18
LBB0_1:
	movq	(%r13), %rax
	movq	_SCO_LINK@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_29
## %bb.2:
	movq	_ESCO_LINK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_hci_conn_hash_lookup_ba
	testq	%rax, %rax
	je	LBB0_29
## %bb.3:
	movq	%rax, %r12
	movq	(%r15), %rax
	movq	%rax, (%r12)
	cmpq	$0, 8(%r13)
	jne	LBB0_17
LBB0_5:
	movl	16(%r13), %edi
	callq	___le16_to_cpu
	movl	%eax, 8(%r12)
	movq	(%r12), %rax
	movq	_ACL_LINK@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_7
## %bb.6:
	movq	_BT_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movq	%r12, %rdi
	callq	_hci_conn_hold
	movq	_HCI_DISCONN_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r12)
	jmp	LBB0_8
LBB0_7:
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
LBB0_8:
	movq	%r12, %rdi
	callq	_hci_conn_hold_device
	movq	%r12, %rdi
	callq	_hci_conn_add_sysfs
	movq	_HCI_AUTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%r14), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_HCI_LM_AUTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 36(%r12)
LBB0_10:
	movq	_HCI_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_HCI_LM_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 36(%r12)
LBB0_12:
	movq	(%r12), %rax
	cmpq	(%r15), %rax
	jne	LBB0_14
## %bb.13:
	movl	16(%r13), %eax
	movl	%eax, -44(%rbp)
	movq	_HCI_OP_READ_REMOTE_FEATURES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_hci_send_cmd
LBB0_14:
	cmpl	$0, 32(%r12)
	jne	LBB0_18
## %bb.15:
	cmpl	$2, (%r14)
	jg	LBB0_18
## %bb.16:
	movl	16(%r13), %eax
	movl	%eax, -44(%rbp)
	movl	28(%r12), %edi
	callq	_cpu_to_le16
	movl	%eax, -48(%rbp)
	movq	_HCI_OP_CHANGE_CONN_PTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_hci_send_cmd
LBB0_18:
	movq	(%r12), %rax
	movq	_ACL_LINK@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_25
## %bb.19:
	movq	16(%r12), %r15
	testq	%r15, %r15
	je	LBB0_25
## %bb.20:
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_21
## %bb.24:
	movq	%r15, %rdi
	callq	_hci_proto_connect_cfm
	movq	%r15, %rdi
	callq	_hci_conn_del
	jmp	LBB0_25
LBB0_21:
	movq	%r14, %rdi
	callq	_lmp_esco_capable
	movl	8(%r12), %esi
	movq	%r15, %rdi
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	callq	_hci_setup_sync
	jmp	LBB0_25
LBB0_23:
	callq	_hci_add_sco
LBB0_25:
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_27
## %bb.26:
	movq	%r12, %rdi
	callq	_hci_proto_connect_cfm
	movq	%r12, %rdi
	callq	_hci_conn_del
	jmp	LBB0_29
LBB0_27:
	movq	(%r13), %rax
	cmpq	(%rbx), %rax
	je	LBB0_29
## %bb.28:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_hci_proto_connect_cfm
LBB0_29:
	movq	%r14, %rdi
	callq	_hci_dev_unlock
	movq	%r14, %rdi
	callq	_hci_conn_check_pending
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_SCO_LINK,8,3                   ## @SCO_LINK
	.comm	_ESCO_LINK,8,3                  ## @ESCO_LINK
	.comm	_ACL_LINK,8,3                   ## @ACL_LINK
	.comm	_BT_CONFIG,4,2                  ## @BT_CONFIG
	.comm	_HCI_DISCONN_TIMEOUT,4,2        ## @HCI_DISCONN_TIMEOUT
	.comm	_BT_CONNECTED,4,2               ## @BT_CONNECTED
	.comm	_HCI_AUTH,4,2                   ## @HCI_AUTH
	.comm	_HCI_LM_AUTH,4,2                ## @HCI_LM_AUTH
	.comm	_HCI_ENCRYPT,4,2                ## @HCI_ENCRYPT
	.comm	_HCI_LM_ENCRYPT,4,2             ## @HCI_LM_ENCRYPT
	.comm	_HCI_OP_READ_REMOTE_FEATURES,4,2 ## @HCI_OP_READ_REMOTE_FEATURES
	.comm	_HCI_OP_CHANGE_CONN_PTYPE,4,2   ## @HCI_OP_CHANGE_CONN_PTYPE
	.comm	_BT_CLOSED,4,2                  ## @BT_CLOSED
	.no_dead_strip	_hci_conn_complete_evt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_conn_complete_evt
_hci_conn_complete_evt:                 ; @hci_conn_complete_evt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x22, [x1]
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	mov	x0, x19
	bl	_hci_dev_lock
	mov	x21, x22
	ldr	x1, [x21], #20
	mov	x0, x19
	mov	x2, x21
	bl	_hci_conn_hash_lookup_ba
	mov	x20, x0
	cbz	x0, LBB0_3
LBB0_1:
	ldr	x8, [x22, #8]
Lloh2:
	adrp	x23, _ACL_LINK@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ACL_LINK@GOTPAGEOFF]
	cbz	x8, LBB0_6
; %bb.2:
Lloh4:
	adrp	x8, _BT_CLOSED@GOTPAGE
Lloh5:
	ldr	x8, [x8, _BT_CLOSED@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x20, #24]
	b	LBB0_18
LBB0_3:
	ldr	x8, [x22]
Lloh7:
	adrp	x23, _SCO_LINK@GOTPAGE
Lloh8:
	ldr	x23, [x23, _SCO_LINK@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_29
; %bb.4:
Lloh9:
	adrp	x8, _ESCO_LINK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ESCO_LINK@GOTPAGEOFF]
Lloh11:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_hci_conn_hash_lookup_ba
	cbz	x0, LBB0_29
; %bb.5:
	mov	x20, x0
	ldr	x8, [x23]
	str	x8, [x0]
	b	LBB0_1
LBB0_6:
	ldr	w0, [x22, #16]
	bl	___le16_to_cpu
	str	w0, [x20, #8]
	ldr	x8, [x20]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _BT_CONFIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BT_CONFIG@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [x20, #24]
	mov	x0, x20
	bl	_hci_conn_hold
Lloh15:
	adrp	x8, _HCI_DISCONN_TIMEOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HCI_DISCONN_TIMEOUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x20, #40]
	b	LBB0_9
LBB0_8:
Lloh18:
	adrp	x8, _BT_CONNECTED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BT_CONNECTED@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x20, #24]
LBB0_9:
	mov	x0, x20
	bl	_hci_conn_hold_device
	mov	x0, x20
	bl	_hci_conn_add_sysfs
Lloh21:
	adrp	x8, _HCI_AUTH@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HCI_AUTH@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	add	x21, x19, #4
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_11
; %bb.10:
Lloh24:
	adrp	x8, _HCI_LM_AUTH@GOTPAGE
Lloh25:
	ldr	x8, [x8, _HCI_LM_AUTH@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x20, #36]
	orr	w8, w9, w8
	str	w8, [x20, #36]
LBB0_11:
Lloh27:
	adrp	x8, _HCI_ENCRYPT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _HCI_ENCRYPT@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_13
; %bb.12:
Lloh30:
	adrp	x8, _HCI_LM_ENCRYPT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _HCI_LM_ENCRYPT@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x20, #36]
	orr	w8, w9, w8
	str	w8, [x20, #36]
LBB0_13:
	ldr	x8, [x20]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
	ldr	w8, [x22, #16]
	str	w8, [sp, #12]
Lloh33:
	adrp	x8, _HCI_OP_READ_REMOTE_FEATURES@GOTPAGE
Lloh34:
	ldr	x8, [x8, _HCI_OP_READ_REMOTE_FEATURES@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #8
	bl	_hci_send_cmd
LBB0_15:
	ldr	w8, [x20, #32]
	cbnz	w8, LBB0_18
; %bb.16:
	ldr	w8, [x19]
	cmp	w8, #2
	b.gt	LBB0_18
; %bb.17:
	ldr	w8, [x22, #16]
	str	w8, [sp, #12]
	ldr	w0, [x20, #28]
	bl	_cpu_to_le16
	str	w0, [sp, #8]
Lloh36:
	adrp	x8, _HCI_OP_CHANGE_CONN_PTYPE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _HCI_OP_CHANGE_CONN_PTYPE@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #8
	bl	_hci_send_cmd
LBB0_18:
	ldr	x8, [x20]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.19:
	ldr	x21, [x20, #16]
	cbz	x21, LBB0_24
; %bb.20:
	ldr	x1, [x22, #8]
	cbz	x1, LBB0_22
; %bb.21:
	mov	x0, x21
	bl	_hci_proto_connect_cfm
	mov	x0, x21
	bl	_hci_conn_del
	ldr	x1, [x22, #8]
	cbnz	x1, LBB0_25
	b	LBB0_27
LBB0_22:
	mov	x0, x19
	bl	_lmp_esco_capable
	ldr	w1, [x20, #8]
	cbz	x0, LBB0_26
; %bb.23:
	mov	x0, x21
	bl	_hci_setup_sync
LBB0_24:
	ldr	x1, [x22, #8]
	cbz	x1, LBB0_27
LBB0_25:
	mov	x0, x20
	bl	_hci_proto_connect_cfm
	mov	x0, x20
	bl	_hci_conn_del
	b	LBB0_29
LBB0_26:
	mov	x0, x21
	bl	_hci_add_sco
	ldr	x1, [x22, #8]
	cbnz	x1, LBB0_25
LBB0_27:
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmp	x8, x9
	b.eq	LBB0_29
; %bb.28:
	mov	x0, x20
	mov	x1, #0
	bl	_hci_proto_connect_cfm
LBB0_29:
	mov	x0, x19
	bl	_hci_dev_unlock
	mov	x0, x19
	bl	_hci_conn_check_pending
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_SCO_LINK,8,3                   ; @SCO_LINK
	.comm	_ESCO_LINK,8,3                  ; @ESCO_LINK
	.comm	_ACL_LINK,8,3                   ; @ACL_LINK
	.comm	_BT_CONFIG,4,2                  ; @BT_CONFIG
	.comm	_HCI_DISCONN_TIMEOUT,4,2        ; @HCI_DISCONN_TIMEOUT
	.comm	_BT_CONNECTED,4,2               ; @BT_CONNECTED
	.comm	_HCI_AUTH,4,2                   ; @HCI_AUTH
	.comm	_HCI_LM_AUTH,4,2                ; @HCI_LM_AUTH
	.comm	_HCI_ENCRYPT,4,2                ; @HCI_ENCRYPT
	.comm	_HCI_LM_ENCRYPT,4,2             ; @HCI_LM_ENCRYPT
	.comm	_HCI_OP_READ_REMOTE_FEATURES,4,2 ; @HCI_OP_READ_REMOTE_FEATURES
	.comm	_HCI_OP_CHANGE_CONN_PTYPE,4,2   ; @HCI_OP_CHANGE_CONN_PTYPE
	.comm	_BT_CLOSED,4,2                  ; @BT_CLOSED
	.no_dead_strip	_hci_conn_complete_evt
.subsections_via_symbols
