	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bt_devenum                     ## -- Begin function bt_devenum
	.p2align	4, 0x90
_bt_devenum:                            ## @bt_devenum
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	_HCI_DEVMAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, -64(%rbp)
	movl	$4, %esi
	callq	_calloc
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	$24, -96(%rbp)
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movq	-88(%rbp), %rax
	movb	$120, (%rax)
	movq	_PF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BLUETOOTH_PROTO_HCI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	testl	%eax, %eax
	js	LBB0_9
## %bb.2:
	movl	%eax, %ebx
	leaq	-96(%rbp), %rsi
	movl	%eax, %edi
	movl	$24, %edx
	callq	_bind
	testq	%rax, %rax
	js	LBB0_8
## %bb.3:
	leaq	-96(%rbp), %rsi
	movl	%ebx, %edi
	movl	$24, %edx
	callq	_connect
	testq	%rax, %rax
	js	LBB0_8
## %bb.4:
	movq	_SIOC_HCI_RAW_NODE_LIST_NAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movl	%ebx, %edi
	movl	$16, %ecx
	callq	_ioctl
	testq	%rax, %rax
	js	LBB0_8
## %bb.5:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$0, -64(%rbp)
	jle	LBB0_20
## %bb.6:
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	xorl	%r14d, %r14d
	leaq	-112(%rbp), %rbx
	xorl	%r15d, %r15d
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-72(%rbp), %r13                 ## 8-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_14 Depth=1
	incq	%r14
	movslq	-64(%rbp), %rax
	cmpq	%rax, %r14
	jge	LBB0_21
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-112(%rbp), %rdi
	movq	-56(%rbp), %rax
	movl	(%rax,%r14,4), %esi
	movl	$8, %edx
	callq	_strlcpy
	movq	%rbx, %rdi
	callq	_bt_devinfo
	testq	%rax, %rax
	js	LBB0_13
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	incl	%r15d
	testq	%r13, %r13
	je	LBB0_13
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-88(%rbp), %rdi
	movq	-56(%rbp), %rax
	movl	(%rax,%r14,4), %esi
	movl	$8, %edx
	callq	_strlcpy
	movl	%r12d, %edi
	leaq	-96(%rbp), %r13
	movq	%r13, %rsi
	movl	$24, %edx
	callq	_bind
	testq	%rax, %rax
	js	LBB0_12
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r12d, %edi
	movq	%r13, %rsi
	movl	$24, %edx
	callq	_connect
	testq	%rax, %rax
	js	LBB0_12
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	callq	*%r13
	testq	%rax, %rax
	jle	LBB0_13
	jmp	LBB0_21
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_10
LBB0_8:
	movl	%ebx, %edi
	callq	_close
LBB0_9:
	movq	-56(%rbp), %rdi
	callq	_free
LBB0_10:
	movl	$-1, %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	xorl	%r15d, %r15d
LBB0_21:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_close
	movq	-56(%rbp), %rdi
	callq	_free
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_HCI_DEVMAX,4,2                 ## @HCI_DEVMAX
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
	.comm	_AF_BLUETOOTH,4,2               ## @AF_BLUETOOTH
	.comm	_PF_BLUETOOTH,4,2               ## @PF_BLUETOOTH
	.comm	_SOCK_RAW,4,2                   ## @SOCK_RAW
	.comm	_BLUETOOTH_PROTO_HCI,4,2        ## @BLUETOOTH_PROTO_HCI
	.comm	_SIOC_HCI_RAW_NODE_LIST_NAMES,4,2 ## @SIOC_HCI_RAW_NODE_LIST_NAMES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bt_devenum                     ; -- Begin function bt_devenum
	.p2align	2
_bt_devenum:                            ; @bt_devenum
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _HCI_DEVMAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HCI_DEVMAX@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	str	w0, [sp, #32]
	mov	w1, #4
	bl	_calloc
	str	x0, [sp, #40]
	cbz	x0, LBB0_13
; %bb.1:
	mov	w21, #24
	mov	x0, sp
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh3:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w21, [sp]
	str	w8, [sp, #16]
	ldr	x8, [sp, #8]
	mov	w9, #120
	strb	w9, [x8]
Lloh6:
	adrp	x8, _PF_BLUETOOTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PF_BLUETOOTH@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _SOCK_RAW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SOCK_RAW@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _BLUETOOTH_PROTO_HCI@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BLUETOOTH_PROTO_HCI@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_socket
	tbnz	w0, #31, LBB0_15
; %bb.2:
	mov	x21, x0
	mov	x1, sp
	mov	w2, #24
	bl	_bind
	tbnz	x0, #63, LBB0_14
; %bb.3:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #24
	bl	_connect
	tbnz	x0, #63, LBB0_14
; %bb.4:
Lloh15:
	adrp	x8, _SIOC_HCI_RAW_NODE_LIST_NAMES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SIOC_HCI_RAW_NODE_LIST_NAMES@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x2, sp, #32
	mov	x0, x21
	mov	w3, #16
	bl	_ioctl
	tbnz	x0, #63, LBB0_14
; %bb.5:
	ldr	w8, [sp, #32]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.6:
	mov	x23, #0
	mov	w22, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [sp, #32]
	cmp	x23, x8
	b.ge	LBB0_19
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [sp, #24]
	ldr	x8, [sp, #40]
	ldr	w1, [x8, x23, lsl #2]
	mov	w2, #8
	bl	_strlcpy
	add	x0, sp, #24
	bl	_bt_devinfo
	tbnz	x0, #63, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w22, w22, #1
	cbz	x20, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [sp, #8]
	ldr	x8, [sp, #40]
	ldr	w1, [x8, x23, lsl #2]
	mov	w2, #8
	bl	_strlcpy
	mov	x1, sp
	mov	x0, x21
	mov	w2, #24
	bl	_bind
	tbnz	x0, #63, LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, sp
	mov	x0, x21
	mov	w2, #24
	bl	_connect
	tbnz	x0, #63, LBB0_7
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x1, sp, #24
	mov	x0, x21
	mov	x2, x19
	blr	x20
	cmp	x0, #0
	b.le	LBB0_7
	b	LBB0_19
LBB0_13:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _errno@GOTPAGE
Lloh22:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh23:
	str	w8, [x9]
	b	LBB0_16
LBB0_14:
	mov	x0, x21
	bl	_close
LBB0_15:
	ldr	x0, [sp, #40]
	bl	_free
LBB0_16:
	mov	w22, #-1
LBB0_17:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
	mov	w22, #0
LBB0_19:
	mov	x0, x21
	bl	_close
	ldr	x0, [sp, #40]
	bl	_free
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_HCI_DEVMAX,4,2                 ; @HCI_DEVMAX
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
	.comm	_AF_BLUETOOTH,4,2               ; @AF_BLUETOOTH
	.comm	_PF_BLUETOOTH,4,2               ; @PF_BLUETOOTH
	.comm	_SOCK_RAW,4,2                   ; @SOCK_RAW
	.comm	_BLUETOOTH_PROTO_HCI,4,2        ; @BLUETOOTH_PROTO_HCI
	.comm	_SIOC_HCI_RAW_NODE_LIST_NAMES,4,2 ; @SIOC_HCI_RAW_NODE_LIST_NAMES
.subsections_via_symbols
