	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btusb_open
_btusb_open:                            ## @btusb_open
	.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
	movq	%rdi, %rbx
	movq	8(%rdi), %r13
	movl	4(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	(%r13), %rdi
	callq	_usb_autopm_get_interface
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	(%r13), %rax
	movl	$1, (%rax)
	movq	_HCI_RUNNING@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_test_and_set_bit
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.3:
	movq	_BTUSB_INTR_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r13), %r15
	movq	%r15, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_btusb_submit_intr_urb
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_btusb_submit_bulk_urb
	testl	%eax, %eax
	js	LBB0_7
## %bb.11:
	movq	_BTUSB_BULK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_set_bit
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_btusb_submit_bulk_urb
	jmp	LBB0_9
LBB0_1:
	movl	%eax, %r14d
	jmp	LBB0_10
LBB0_5:
	movl	%eax, %r14d
	jmp	LBB0_8
LBB0_7:
	leaq	12(%r13), %rdi
	movl	%eax, %r14d
	callq	_usb_kill_anchored_urbs
LBB0_8:
	movq	_BTUSB_INTR_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_clear_bit
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
LBB0_9:
	movq	(%r13), %rdi
	callq	_usb_autopm_put_interface
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_HCI_RUNNING,4,2                ## @HCI_RUNNING
	.comm	_BTUSB_INTR_RUNNING,4,2         ## @BTUSB_INTR_RUNNING
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_BTUSB_BULK_RUNNING,4,2         ## @BTUSB_BULK_RUNNING
	.no_dead_strip	_btusb_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btusb_open
_btusb_open:                            ; @btusb_open
	.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	x19, x0
	ldr	x22, [x0, #8]
	ldr	w1, [x0, #4]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	ldr	x0, [x22]
	bl	_usb_autopm_get_interface
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	x8, [x22]
	mov	w9, #1
	str	w9, [x8]
Lloh2:
	adrp	x23, _HCI_RUNNING@GOTPAGE
Lloh3:
	ldr	x23, [x23, _HCI_RUNNING@GOTPAGEOFF]
	ldr	w0, [x23]
	mov	x1, x19
	bl	_test_and_set_bit
	cbnz	x0, LBB0_3
; %bb.2:
Lloh4:
	adrp	x24, _BTUSB_INTR_RUNNING@GOTPAGE
Lloh5:
	ldr	x24, [x24, _BTUSB_INTR_RUNNING@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x21, x22, #8
	mov	x1, x21
	bl	_test_and_set_bit
	cbz	x0, LBB0_7
LBB0_3:
	mov	w20, #0
LBB0_4:
	ldr	x0, [x22]
	bl	_usb_autopm_put_interface
	b	LBB0_6
LBB0_5:
	mov	x20, x0
LBB0_6:
	mov	x0, x20
	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
LBB0_7:
Lloh6:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_btusb_submit_intr_urb
	tbnz	w0, #31, LBB0_10
; %bb.8:
	ldr	w1, [x25]
	mov	x0, x19
	bl	_btusb_submit_bulk_urb
	tbnz	w0, #31, LBB0_11
; %bb.9:
Lloh8:
	adrp	x8, _BTUSB_BULK_RUNNING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTUSB_BULK_RUNNING@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_set_bit
	ldr	w1, [x25]
	mov	x0, x19
	bl	_btusb_submit_bulk_urb
	mov	w20, #0
	b	LBB0_4
LBB0_10:
	mov	x20, x0
	b	LBB0_12
LBB0_11:
	mov	x20, x0
	add	x0, x22, #12
	bl	_usb_kill_anchored_urbs
LBB0_12:
	ldr	w0, [x24]
	mov	x1, x21
	bl	_clear_bit
	ldr	w0, [x23]
	mov	x1, x19
	bl	_clear_bit
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_HCI_RUNNING,4,2                ; @HCI_RUNNING
	.comm	_BTUSB_INTR_RUNNING,4,2         ; @BTUSB_INTR_RUNNING
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_BTUSB_BULK_RUNNING,4,2         ; @BTUSB_BULK_RUNNING
	.no_dead_strip	_btusb_open
.subsections_via_symbols
