	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_auth_complete_evt
_hci_auth_complete_evt:                 ## @hci_auth_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), %r12
	movl	8(%rdi), %esi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	%r14, %rdi
	callq	_hci_dev_lock
	movl	4(%r12), %edi
	callq	___le16_to_cpu
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_hci_conn_hash_lookup_handle
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %r15
	cmpl	$0, (%r12)
	jne	LBB0_3
## %bb.2:
	movq	_HCI_LM_AUTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%r15)
LBB0_3:
	movq	_HCI_CONN_AUTH_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$16, %rbx
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	(%r15), %rax
	movq	_BT_CONFIG@GOTPCREL(%rip), %rcx
	movl	(%r12), %esi
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.4:
	testl	%esi, %esi
	je	LBB0_5
LBB0_8:
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	%r15, %rdi
	callq	_hci_proto_connect_cfm
	jmp	LBB0_10
LBB0_9:
	movq	%r15, %rdi
	callq	_hci_auth_cfm
	movq	%r15, %rdi
	callq	_hci_conn_hold
	movq	_HCI_DISCONN_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
LBB0_10:
	movq	%r15, %rdi
	callq	_hci_conn_put
LBB0_11:
	movq	_HCI_CONN_ENCRYPT_PEND@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_15
## %bb.12:
	cmpl	$0, (%r12)
	je	LBB0_13
## %bb.14:
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movl	(%r12), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_hci_encrypt_cfm
	jmp	LBB0_15
LBB0_13:
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)
	movl	$1, -48(%rbp)
	movq	_HCI_OP_SET_CONN_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_hci_send_cmd
LBB0_15:
	movq	%r14, %rdi
	callq	_hci_dev_unlock
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpq	$0, (%r14)
	jle	LBB0_8
## %bb.6:
	cmpq	$0, 8(%r15)
	jle	LBB0_8
## %bb.7:
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)
	movl	$1, -48(%rbp)
	movq	_HCI_OP_SET_CONN_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_hci_send_cmd
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s status %d"

	.comm	_HCI_LM_AUTH,4,2                ## @HCI_LM_AUTH
	.comm	_HCI_CONN_AUTH_PEND,4,2         ## @HCI_CONN_AUTH_PEND
	.comm	_BT_CONFIG,8,3                  ## @BT_CONFIG
	.comm	_HCI_OP_SET_CONN_ENCRYPT,4,2    ## @HCI_OP_SET_CONN_ENCRYPT
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_HCI_DISCONN_TIMEOUT,4,2        ## @HCI_DISCONN_TIMEOUT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ## @HCI_CONN_ENCRYPT_PEND
	.no_dead_strip	_hci_auth_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_auth_complete_evt
_hci_auth_complete_evt:                 ; @hci_auth_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]
	ldr	w2, [x22]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	mov	x0, x19
	bl	_hci_dev_lock
	ldr	w0, [x22, #4]
	bl	___le16_to_cpu
	mov	x1, x0
	mov	x0, x19
	bl	_hci_conn_hash_lookup_handle
	cbz	x0, LBB0_12
; %bb.1:
	mov	x20, x0
	ldr	w8, [x22]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _HCI_LM_AUTH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_LM_AUTH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #24]
	orr	w8, w9, w8
	str	w8, [x20, #24]
LBB0_3:
Lloh5:
	adrp	x8, _HCI_CONN_AUTH_PEND@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HCI_CONN_AUTH_PEND@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x21, x20, #16
	mov	x1, x21
	bl	_clear_bit
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _BT_CONFIG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _BT_CONFIG@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	w1, [x22]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	cbz	w1, LBB0_13
LBB0_5:
Lloh11:
	adrp	x8, _BT_CONNECTED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BT_CONNECTED@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x20]
	mov	x0, x20
	bl	_hci_proto_connect_cfm
	b	LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_hci_auth_cfm
	mov	x0, x20
	bl	_hci_conn_hold
Lloh14:
	adrp	x8, _HCI_DISCONN_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HCI_DISCONN_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x20, #20]
LBB0_7:
	mov	x0, x20
	bl	_hci_conn_put
LBB0_8:
Lloh17:
	adrp	x23, _HCI_CONN_ENCRYPT_PEND@GOTPAGE
Lloh18:
	ldr	x23, [x23, _HCI_CONN_ENCRYPT_PEND@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x21
	bl	_test_bit
	cbz	x0, LBB0_12
; %bb.9:
	ldr	w8, [x22]
	cbz	w8, LBB0_11
; %bb.10:
	ldr	w0, [x23]
	mov	x1, x21
	bl	_clear_bit
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #0
	bl	_hci_encrypt_cfm
	b	LBB0_12
LBB0_11:
	ldr	w8, [x22, #4]
	mov	w9, #1
	stp	w9, w8, [sp, #8]
Lloh19:
	adrp	x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #8
	bl	_hci_send_cmd
LBB0_12:
	mov	x0, x19
	bl	_hci_dev_unlock
	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
LBB0_13:
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.14:
	ldr	x8, [x20, #8]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.15:
	ldr	w8, [x22, #4]
	mov	w9, #1
	stp	w9, w8, [sp, #8]
Lloh22:
	adrp	x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	w2, #8
	bl	_hci_send_cmd
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s status %d"

	.comm	_HCI_LM_AUTH,4,2                ; @HCI_LM_AUTH
	.comm	_HCI_CONN_AUTH_PEND,4,2         ; @HCI_CONN_AUTH_PEND
	.comm	_BT_CONFIG,8,3                  ; @BT_CONFIG
	.comm	_HCI_OP_SET_CONN_ENCRYPT,4,2    ; @HCI_OP_SET_CONN_ENCRYPT
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_HCI_DISCONN_TIMEOUT,4,2        ; @HCI_DISCONN_TIMEOUT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ; @HCI_CONN_ENCRYPT_PEND
	.no_dead_strip	_hci_auth_complete_evt
.subsections_via_symbols
