	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_inquiry                    ## -- Begin function bte_inquiry
	.p2align	4, 0x90
_bte_inquiry:                           ## @bte_inquiry
	.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
	movl	%edx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	callq	__CPU_ISR_Disable
	movq	_btstate@GOTPCREL(%rip), %r13
	cmpl	$1, %ebx
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rax
	testq	%rax, %rax
	jne	LBB0_3
LBB0_2:
	movq	$0, 24(%r13)
	movl	%r14d, 8(%r13)
	movq	_bte_inquiry_complete@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$10390323, %edi                 ## imm = 0x9E8B33
	movl	$3, %esi
	movl	%r14d, %edx
	callq	_hci_inquiry
	movq	%r13, %rdi
	callq	___bte_waitcmdfinish
	movq	%rax, %r15
	movq	(%r13), %rax
LBB0_3:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%r13), %rbx
	callq	__CPU_ISR_Restore
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	_ERR_OK@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	cmpq	%rax, %r15
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rax
	testl	%ecx, %ecx
	jle	LBB0_9
## %bb.5:
	movq	%r15, %rax
	testl	%r14d, %r14d
	jle	LBB0_9
## %bb.6:
	decl	%r14d
	leal	-1(%rcx), %eax
	cmpl	%eax, %r14d
	cmovael	%eax, %r14d
	incl	%r14d
	addq	$4, %r12
	addq	$4, %rbx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_bd_addr_set
	movl	-4(%r12), %edi
	movl	-4(%rbx), %esi
	movl	$3, %edx
	callq	_memcpy
	addq	$8, %r12
	addq	$8, %rbx
	decq	%r14
	jne	LBB0_7
## %bb.8:
	movq	(%r13), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_9:
	cmpq	%rax, %r15
	cmovel	%ecx, %r15d
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR_OK,8,3                     ## @ERR_OK
	.comm	_btstate,32,3                   ## @btstate
	.comm	_bte_inquiry_complete,4,2       ## @bte_inquiry_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_inquiry                    ; -- Begin function bte_inquiry
	.p2align	2
_bte_inquiry:                           ; @bte_inquiry
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _ERR_OK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ERR_OK@GOTPAGEOFF]
	ldr	x19, [x24]
	bl	__CPU_ISR_Disable
Lloh2:
	adrp	x22, _btstate@GOTPAGE
Lloh3:
	ldr	x22, [x22, _btstate@GOTPAGEOFF]
	cmp	w23, #1
	b.eq	LBB0_2
; %bb.1:
	ldr	x23, [x22]
	cbnz	x23, LBB0_3
LBB0_2:
	str	xzr, [x22, #24]
	str	w21, [x22, #8]
Lloh4:
	adrp	x8, _bte_inquiry_complete@GOTPAGE
Lloh5:
	ldr	x8, [x8, _bte_inquiry_complete@GOTPAGEOFF]
Lloh6:
	ldr	w3, [x8]
	mov	w0, #35635
	movk	w0, #158, lsl #16
	mov	w1, #3
	mov	x2, x21
	bl	_hci_inquiry
	mov	x0, x22
	bl	___bte_waitcmdfinish
	mov	x19, x0
	ldr	x23, [x22]
LBB0_3:
	ldr	x25, [x22, #16]
	bl	__CPU_ISR_Restore
	ldr	x8, [x24]
	cmp	x19, x8
	b.ne	LBB0_8
; %bb.4:
	subs	w9, w23, #1
	ccmp	w21, #1, #8, ge
	mov	x8, x19
	b.lt	LBB0_8
; %bb.5:
	sub	w8, w21, #1
	cmp	w8, w9
	csel	w8, w8, w9, lo
	add	w22, w8, #1
	add	x20, x20, #4
	add	x21, x25, #4
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_bd_addr_set
	ldur	w0, [x20, #-4]
	ldur	w1, [x21, #-4]
	mov	w2, #3
	bl	_memcpy
	add	x20, x20, #8
	add	x21, x21, #8
	subs	x22, x22, #1
	b.ne	LBB0_6
; %bb.7:
	ldr	x8, [x24]
LBB0_8:
	cmp	x19, x8
	csel	w0, w23, w19, eq
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR_OK,8,3                     ; @ERR_OK
	.comm	_btstate,32,3                   ; @btstate
	.comm	_bte_inquiry_complete,4,2       ; @bte_inquiry_complete
.subsections_via_symbols
