	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_encrypt_change_evt
_hci_encrypt_change_evt:                ## @hci_encrypt_change_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %r15
	movl	(%rdi), %esi
	movl	8(%r15), %edx
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	%r14, %rdi
	callq	_hci_dev_lock
	movl	12(%r15), %edi
	callq	___le16_to_cpu
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_hci_conn_hash_lookup_handle
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %rbx
	cmpl	$0, 8(%r15)
	jne	LBB0_5
## %bb.2:
	cmpq	$0, (%r15)
	je	LBB0_4
## %bb.3:
	movq	_HCI_LM_AUTH@GOTPCREL(%rip), %rax
	movl	12(%rbx), %ecx
	orl	(%rax), %ecx
	movq	_HCI_LM_ENCRYPT@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 12(%rbx)
	jmp	LBB0_5
LBB0_4:
	movq	_HCI_LM_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 12(%rbx)
LBB0_5:
	movq	_HCI_CONN_ENCRYPT_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	addq	$8, %rsi
	callq	_clear_bit
	movq	(%rbx), %rax
	movq	_BT_CONFIG@GOTPCREL(%rip), %rcx
	movl	8(%r15), %esi
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.6:
	testl	%esi, %esi
	jne	LBB0_8
## %bb.7:
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_8:
	movq	%rbx, %rdi
	callq	_hci_proto_connect_cfm
	movq	%rbx, %rdi
	callq	_hci_conn_put
	jmp	LBB0_10
LBB0_9:
	movq	(%r15), %rdx
	movq	%rbx, %rdi
	callq	_hci_encrypt_cfm
LBB0_10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hci_dev_unlock                 ## TAILCALL
	.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_LM_ENCRYPT,4,2             ## @HCI_LM_ENCRYPT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ## @HCI_CONN_ENCRYPT_PEND
	.comm	_BT_CONFIG,8,3                  ## @BT_CONFIG
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.no_dead_strip	_hci_encrypt_change_evt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_encrypt_change_evt
_hci_encrypt_change_evt:                ; @hci_encrypt_change_evt
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x21, [x1]
	ldr	w1, [x0]
	ldr	w2, [x21, #8]
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, [x21, #12]
	bl	___le16_to_cpu
	mov	x1, x0
	mov	x0, x19
	bl	_hci_conn_hash_lookup_handle
	cbz	x0, LBB0_11
; %bb.1:
	mov	x20, x0
	ldr	w8, [x21, #8]
	cbnz	w8, LBB0_6
; %bb.2:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _HCI_LM_AUTH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_LM_AUTH@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8
Lloh5:
	adrp	x9, _HCI_LM_ENCRYPT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HCI_LM_ENCRYPT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _HCI_LM_ENCRYPT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HCI_LM_ENCRYPT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x20, #12]
	bic	w8, w9, w8
LBB0_5:
	str	w8, [x20, #12]
LBB0_6:
Lloh11:
	adrp	x8, _HCI_CONN_ENCRYPT_PEND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HCI_CONN_ENCRYPT_PEND@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	add	x1, x20, #8
	bl	_clear_bit
	ldr	x8, [x20]
Lloh14:
	adrp	x9, _BT_CONFIG@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BT_CONFIG@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	ldr	w1, [x21, #8]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	cbnz	w1, LBB0_9
; %bb.8:
Lloh17:
	adrp	x8, _BT_CONNECTED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BT_CONNECTED@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_9:
	mov	x0, x20
	bl	_hci_proto_connect_cfm
	mov	x0, x20
	bl	_hci_conn_put
	b	LBB0_11
LBB0_10:
	ldr	x2, [x21]
	mov	x0, x20
	bl	_hci_encrypt_cfm
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_hci_dev_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.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_LM_ENCRYPT,4,2             ; @HCI_LM_ENCRYPT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ; @HCI_CONN_ENCRYPT_PEND
	.comm	_BT_CONFIG,8,3                  ; @BT_CONFIG
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.no_dead_strip	_hci_encrypt_change_evt
.subsections_via_symbols
