	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btusb_close
_btusb_close:                           ## @btusb_close
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movl	4(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movq	_HCI_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_clear_bit
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	leaq	24(%r14), %rdi
	callq	_cancel_work_sync
	leaq	20(%r14), %rdi
	callq	_cancel_work_sync
	movq	_BTUSB_ISOC_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r14), %rbx
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_BTUSB_BULK_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_BTUSB_INTR_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	%r14, %rdi
	callq	_btusb_stop_traffic
	movq	8(%r14), %rdi
	callq	_usb_autopm_get_interface
	testl	%eax, %eax
	js	LBB0_3
## %bb.2:
	movq	8(%r14), %rdi
	movq	$0, (%rdi)
	callq	_usb_autopm_put_interface
LBB0_3:
	movq	%r14, %rdi
	callq	_usb_scuttle_anchored_urbs
LBB0_4:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	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_ISOC_RUNNING,4,2         ## @BTUSB_ISOC_RUNNING
	.comm	_BTUSB_BULK_RUNNING,4,2         ## @BTUSB_BULK_RUNNING
	.comm	_BTUSB_INTR_RUNNING,4,2         ## @BTUSB_INTR_RUNNING
	.no_dead_strip	_btusb_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btusb_close
_btusb_close:                           ; @btusb_close
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0, #8]
	ldr	w1, [x0, #4]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
Lloh2:
	adrp	x8, _HCI_RUNNING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HCI_RUNNING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_and_clear_bit
	cbz	w0, LBB0_4
; %bb.1:
	add	x0, x19, #24
	bl	_cancel_work_sync
	add	x0, x19, #20
	bl	_cancel_work_sync
Lloh5:
	adrp	x8, _BTUSB_ISOC_RUNNING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BTUSB_ISOC_RUNNING@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x20, x19, #16
	mov	x1, x20
	bl	_clear_bit
Lloh8:
	adrp	x8, _BTUSB_BULK_RUNNING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTUSB_BULK_RUNNING@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
Lloh11:
	adrp	x8, _BTUSB_INTR_RUNNING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BTUSB_INTR_RUNNING@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
	mov	x0, x19
	bl	_btusb_stop_traffic
	ldr	x0, [x19, #8]
	bl	_usb_autopm_get_interface
	tbnz	w0, #31, LBB0_3
; %bb.2:
	ldr	x0, [x19, #8]
	str	xzr, [x0]
	bl	_usb_autopm_put_interface
LBB0_3:
	mov	x0, x19
	bl	_usb_scuttle_anchored_urbs
LBB0_4:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_HCI_RUNNING,4,2                ; @HCI_RUNNING
	.comm	_BTUSB_ISOC_RUNNING,4,2         ; @BTUSB_ISOC_RUNNING
	.comm	_BTUSB_BULK_RUNNING,4,2         ; @BTUSB_BULK_RUNNING
	.comm	_BTUSB_INTR_RUNNING,4,2         ; @BTUSB_INTR_RUNNING
	.no_dead_strip	_btusb_close
.subsections_via_symbols
