	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hci_conn_security              ## -- Begin function hci_conn_security
	.p2align	4, 0x90
_hci_conn_security:                     ## @hci_conn_security
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_BT_DBG
	movq	_BT_SECURITY_SDP@GOTPCREL(%rip), %rax
	movl	$1, %r14d
	cmpq	%rbx, (%rax)
	jne	LBB0_1
LBB0_8:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_BT_SECURITY_LOW@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_4
## %bb.2:
	cmpl	$0, 24(%r12)
	je	LBB0_8
## %bb.3:
	movq	8(%r12), %rax
	cmpl	$0, (%rax)
	je	LBB0_8
LBB0_4:
	movq	_HCI_LM_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.9:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hci_conn_auth                  ## TAILCALL
LBB0_5:
	movq	_HCI_CONN_ENCRYPT_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	20(%r12), %rsi
	callq	_test_and_set_bit
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_hci_conn_auth
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	16(%r12), %edi
	callq	_cpu_to_le16
	movl	%eax, -36(%rbp)
	movl	$1, -40(%rbp)
	movq	8(%r12), %rdi
	movq	_HCI_OP_SET_CONN_ENCRYPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rcx
	movl	$8, %edx
	callq	_hci_send_cmd
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"conn %p"

	.comm	_BT_SECURITY_SDP,8,3            ## @BT_SECURITY_SDP
	.comm	_BT_SECURITY_LOW,8,3            ## @BT_SECURITY_LOW
	.comm	_HCI_LM_ENCRYPT,4,2             ## @HCI_LM_ENCRYPT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ## @HCI_CONN_ENCRYPT_PEND
	.comm	_HCI_OP_SET_CONN_ENCRYPT,4,2    ## @HCI_OP_SET_CONN_ENCRYPT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hci_conn_security              ; -- Begin function hci_conn_security
	.p2align	2
_hci_conn_security:                     ; @hci_conn_security
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
Lloh2:
	adrp	x8, _BT_SECURITY_SDP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BT_SECURITY_SDP@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_3
LBB0_1:
	mov	w0, #1
LBB0_2:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_3:
Lloh5:
	adrp	x8, _BT_SECURITY_LOW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BT_SECURITY_LOW@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_1
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	cbz	w8, LBB0_1
LBB0_6:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _HCI_LM_ENCRYPT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _HCI_LM_ENCRYPT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_hci_conn_auth
LBB0_8:
Lloh11:
	adrp	x8, _HCI_CONN_ENCRYPT_PEND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HCI_CONN_ENCRYPT_PEND@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	add	x1, x19, #20
	bl	_test_and_set_bit
	cbnz	x0, LBB0_11
; %bb.9:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_hci_conn_auth
	cbz	w0, LBB0_2
; %bb.10:
	ldr	w0, [x19, #16]
	bl	_cpu_to_le16
	mov	w8, #1
	stp	w8, w0, [sp, #8]
	ldr	x0, [x19, #8]
Lloh14:
	adrp	x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HCI_OP_SET_CONN_ENCRYPT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	w2, #8
	bl	_hci_send_cmd
LBB0_11:
	mov	w0, #0
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"conn %p"

	.comm	_BT_SECURITY_SDP,8,3            ; @BT_SECURITY_SDP
	.comm	_BT_SECURITY_LOW,8,3            ; @BT_SECURITY_LOW
	.comm	_HCI_LM_ENCRYPT,4,2             ; @HCI_LM_ENCRYPT
	.comm	_HCI_CONN_ENCRYPT_PEND,4,2      ; @HCI_CONN_ENCRYPT_PEND
	.comm	_HCI_OP_SET_CONN_ENCRYPT,4,2    ; @HCI_OP_SET_CONN_ENCRYPT
.subsections_via_symbols
