	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_inquiry_complete           ## -- Begin function bte_inquiry_complete
	.p2align	4, 0x90
_bte_inquiry_complete:                  ## @bte_inquiry_complete
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_HCI_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_13
## %bb.1:
	movq	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.2:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_btstate@GOTPCREL(%rip), %r12
	movq	16(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_free
LBB0_4:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r12)
	xorl	%edi, %edi
	movq	%rbx, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	incl	%eax
	movq	24(%rcx), %rcx
	addl	$20, %edi
	testq	%rcx, %rcx
	jne	LBB0_5
## %bb.6:
	movl	%eax, (%r12)
	callq	_malloc
	movq	%rax, 16(%r12)
	cmpl	$0, (%r12)
	je	LBB0_11
## %bb.7:
	movq	%rax, %rdi
	movl	$1, %r13d
	movl	$16, %r14d
	leaq	L_.str.4(%rip), %r15
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	addq	%r14, %rdi
	leaq	32(%rbx), %rsi
	callq	_bd_addr_set
	movq	16(%r12), %rax
	movl	-4(%rax,%r14), %edi
	movq	(%rbx), %rsi
	movl	$3, %edx
	callq	_memcpy
	movl	8(%rbx), %eax
	movq	16(%r12), %rcx
	movl	%eax, -16(%rcx,%r14)
	movl	12(%rbx), %eax
	movl	%eax, -12(%rcx,%r14)
	movl	16(%rbx), %eax
	movl	%eax, -8(%rcx,%r14)
	movq	32(%rbx), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movl	8(%rax), %ecx
	movl	12(%rax), %r8d
	movl	16(%rax), %r9d
	movl	20(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movq	(%rbx), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movl	8(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	8(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	12(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	16(%rbx), %esi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_printf
	movslq	(%r12), %rax
	cmpq	%rax, %r13
	jae	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	24(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	16(%r12), %rdi
	incq	%r13
	addq	$20, %r14
	jmp	LBB0_8
LBB0_11:
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	___bte_cmdfinish
	jmp	LBB0_13
LBB0_12:
	movq	_btstate@GOTPCREL(%rip), %rax
	movq	8(%rax), %rdx
	leaq	_bte_inquiry_complete(%rip), %rcx
	movl	$10390323, %edi                 ## imm = 0x9E8B33
	movl	$3, %esi
	callq	_hci_inquiry
LBB0_13:
	movq	_ERR_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HCI_SUCCESS,8,3                ## @HCI_SUCCESS
	.comm	_btstate,24,3                   ## @btstate
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bdaddr: %02x:%02x:%02x:%02x:%02x:%02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"cod:    %02x%02x%02x\n"

L_.str.2:                               ## @.str.2
	.asciz	"psrm:   %02x\n"

L_.str.3:                               ## @.str.3
	.asciz	"psm:   %02x\n"

L_.str.4:                               ## @.str.4
	.asciz	"co:   %04x\n"

	.comm	_ERR_OK,4,2                     ## @ERR_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bte_inquiry_complete           ; -- Begin function bte_inquiry_complete
	.p2align	2
_bte_inquiry_complete:                  ; @bte_inquiry_complete
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _HCI_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HCI_SUCCESS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x21, _ERR_OK@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ERR_OK@GOTPAGEOFF]
	cmp	x8, x3
	b.ne	LBB0_13
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_12
; %bb.2:
	mov	x19, x0
Lloh5:
	adrp	x27, _btstate@GOTPAGE
Lloh6:
	ldr	x27, [x27, _btstate@GOTPAGEOFF]
	ldr	x0, [x27, #16]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_free
LBB0_4:
	mov	w0, #0
	mov	w8, #0
	stp	xzr, xzr, [x27, #8]
	mov	x9, x20
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w8, #1
	ldr	x9, [x9, #24]
	add	w0, w0, #20
	cbnz	x9, LBB0_5
; %bb.6:
	str	w8, [x27]
	bl	_malloc
	str	x0, [x27, #16]
	ldr	w8, [x27]
	cbz	w8, LBB0_11
; %bb.7:
	mov	x28, #0
	mov	w26, #1
Lloh7:
	adrp	x21, l_.str@PAGE
Lloh8:
	add	x21, x21, l_.str@PAGEOFF
Lloh9:
	adrp	x22, l_.str.1@PAGE
Lloh10:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh11:
	adrp	x23, l_.str.2@PAGE
Lloh12:
	add	x23, x23, l_.str.2@PAGEOFF
Lloh13:
	adrp	x24, l_.str.3@PAGE
Lloh14:
	add	x24, x24, l_.str.3@PAGEOFF
Lloh15:
	adrp	x25, l_.str.4@PAGE
Lloh16:
	add	x25, x25, l_.str.4@PAGEOFF
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x0, x28
	add	x0, x8, #16
	add	x1, x20, #32
	bl	_bd_addr_set
	ldr	x8, [x27, #16]
	add	x8, x8, x28
	ldr	w0, [x8, #12]
	ldr	x1, [x20]
	mov	w2, #3
	bl	_memcpy
	ldr	x8, [x27, #16]
	ldr	d0, [x20, #8]
	add	x8, x8, x28
	str	d0, [x8]
	ldr	w9, [x20, #16]
	str	w9, [x8, #8]
	ldr	x8, [x20, #32]
	ldp	w1, w9, [x8]
	ldp	w10, w11, [x8, #8]
	ldp	w12, w8, [x8, #16]
	stp	x12, x8, [sp, #24]
	stp	x10, x11, [sp, #8]
	str	x9, [sp]
	mov	x0, x21
	bl	_printf
	ldr	x8, [x20]
	ldp	w1, w9, [x8]
	ldr	w8, [x8, #8]
	stp	x9, x8, [sp]
	mov	x0, x22
	bl	_printf
	ldr	w1, [x20, #8]
	mov	x0, x23
	bl	_printf
	ldr	w1, [x20, #12]
	mov	x0, x24
	bl	_printf
	ldr	w1, [x20, #16]
	mov	x0, x25
	bl	_printf
	ldrsw	x8, [x27]
	cmp	x26, x8
	b.hs	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x20, [x20, #24]
	cbz	x20, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x27, #16]
	add	x26, x26, #1
	add	x28, x28, #20
	b	LBB0_8
LBB0_11:
Lloh17:
	adrp	x21, _ERR_OK@GOTPAGE
Lloh18:
	ldr	x21, [x21, _ERR_OK@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	___bte_cmdfinish
	b	LBB0_13
LBB0_12:
Lloh19:
	adrp	x8, _btstate@GOTPAGE
Lloh20:
	ldr	x8, [x8, _btstate@GOTPAGEOFF]
Lloh21:
	ldr	x2, [x8, #8]
Lloh22:
	adrp	x3, _bte_inquiry_complete@PAGE
Lloh23:
	add	x3, x3, _bte_inquiry_complete@PAGEOFF
	mov	w0, #35635
	movk	w0, #158, lsl #16
	mov	w1, #3
	bl	_hci_inquiry
LBB0_13:
	ldr	w0, [x21]
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_HCI_SUCCESS,8,3                ; @HCI_SUCCESS
	.comm	_btstate,24,3                   ; @btstate
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bdaddr: %02x:%02x:%02x:%02x:%02x:%02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"cod:    %02x%02x%02x\n"

l_.str.2:                               ; @.str.2
	.asciz	"psrm:   %02x\n"

l_.str.3:                               ; @.str.3
	.asciz	"psm:   %02x\n"

l_.str.4:                               ; @.str.4
	.asciz	"co:   %04x\n"

	.comm	_ERR_OK,4,2                     ; @ERR_OK
.subsections_via_symbols
