	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bt_devopen                     ## -- Begin function bt_devopen
	.p2align	4, 0x90
_bt_devopen:                            ## @bt_devopen
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	leaq	-32(%rbp), %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movl	$12, -32(%rbp)
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	leaq	-36(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_bt_aton
	movl	-28(%rbp), %ecx
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	leaq	-36(%rbp), %rsi
	movl	%ecx, %edi
	callq	_bt_devname
	testl	%eax, %eax
	jne	LBB0_6
	jmp	LBB0_13
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_5:
	movq	%rbx, %rdi
	movl	%ecx, %esi
	movl	$4, %edx
	callq	_bt_dev2node
	testq	%rax, %rax
	je	LBB0_11
LBB0_6:
	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
	movl	$-1, %ebx
	testl	%eax, %eax
	js	LBB0_14
## %bb.7:
	movl	%eax, %r14d
	leaq	-32(%rbp), %rsi
	movl	%eax, %edi
	movl	$12, %edx
	callq	_bind
	testq	%rax, %rax
	js	LBB0_10
## %bb.8:
	leaq	-32(%rbp), %rsi
	movl	%r14d, %edi
	movl	$12, %edx
	callq	_connect
	testq	%rax, %rax
	js	LBB0_10
## %bb.9:
	movl	%r14d, %ebx
	jmp	LBB0_14
LBB0_10:
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_14
LBB0_11:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_13:
	movl	$-1, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_AF_BLUETOOTH,4,2               ## @AF_BLUETOOTH
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_PF_BLUETOOTH,4,2               ## @PF_BLUETOOTH
	.comm	_SOCK_RAW,4,2                   ## @SOCK_RAW
	.comm	_BLUETOOTH_PROTO_HCI,4,2        ## @BLUETOOTH_PROTO_HCI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bt_devopen                     ; -- Begin function bt_devopen
	.p2align	2
_bt_devopen:                            ; @bt_devopen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w20, #12
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #12
	bl	_memset
Lloh0:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w20, [sp, #16]
	str	w8, [sp, #24]
	add	x1, sp, #12
	mov	x0, x19
	bl	_bt_aton
	ldr	w8, [sp, #20]
	cbz	x0, LBB0_4
; %bb.2:
	add	x1, sp, #12
	mov	x0, x8
	bl	_bt_devname
	cbnz	w0, LBB0_5
	b	LBB0_11
LBB0_3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
	mov	x0, x19
	mov	x1, x8
	mov	w2, #4
	bl	_bt_dev2node
	cbz	x0, LBB0_9
LBB0_5:
Lloh5:
	adrp	x8, _PF_BLUETOOTH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PF_BLUETOOTH@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _SOCK_RAW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOCK_RAW@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _BLUETOOTH_PROTO_HCI@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BLUETOOTH_PROTO_HCI@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	bl	_socket
	tbnz	w0, #31, LBB0_11
; %bb.6:
	mov	x19, x0
	add	x1, sp, #16
	mov	w2, #12
	bl	_bind
	tbnz	x0, #63, LBB0_8
; %bb.7:
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #12
	bl	_connect
	tbz	x0, #63, LBB0_12
LBB0_8:
	mov	x0, x19
	bl	_close
	b	LBB0_11
LBB0_9:
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _errno@GOTPAGE
Lloh17:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
LBB0_11:
	mov	w19, #-1
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_AF_BLUETOOTH,4,2               ; @AF_BLUETOOTH
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_PF_BLUETOOTH,4,2               ; @PF_BLUETOOTH
	.comm	_SOCK_RAW,4,2                   ; @SOCK_RAW
	.comm	_BLUETOOTH_PROTO_HCI,4,2        ; @BLUETOOTH_PROTO_HCI
.subsections_via_symbols
