	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubt_detach                     ## -- Begin function ubt_detach
	.p2align	4, 0x90
_ubt_detach:                            ## @ubt_detach
	.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
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	32(%rax), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	$0, 32(%rbx)
	movq	%r14, %rdi
	callq	_NG_NODE_REALLY_DIE
	movq	%r14, %rdi
	callq	_ng_rmnode_self
LBB0_2:
	movq	_taskqueue_swi@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%rbx), %rsi
	callq	_taskqueue_drain
	movl	20(%rbx), %edi
	movq	_UBT_N_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usbd_transfer_unsetup
	movq	%rbx, %rdi
	callq	_UBT_NG_LOCK
	leaq	16(%rbx), %rdi
	callq	_NG_BT_MBUFQ_DESTROY
	leaq	12(%rbx), %rdi
	callq	_NG_BT_MBUFQ_DESTROY
	leaq	8(%rbx), %rdi
	callq	_NG_BT_MBUFQ_DESTROY
	movq	%rbx, %rdi
	callq	_UBT_NG_UNLOCK
	movq	%rbx, %rdi
	addq	$4, %rdi
	callq	_mtx_destroy
	movq	%rbx, %rdi
	callq	_mtx_destroy
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_taskqueue_swi,4,2              ## @taskqueue_swi
	.comm	_UBT_N_TRANSFER,4,2             ## @UBT_N_TRANSFER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubt_detach                     ; -- Begin function ubt_detach
	.p2align	2
_ubt_detach:                            ; @ubt_detach
	.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
	bl	_device_get_softc
	mov	x19, x0
	ldr	x20, [x0, #32]
	cbz	x20, LBB0_2
; %bb.1:
	str	xzr, [x19, #32]
	mov	x0, x20
	bl	_NG_NODE_REALLY_DIE
	mov	x0, x20
	bl	_ng_rmnode_self
LBB0_2:
Lloh0:
	adrp	x8, _taskqueue_swi@GOTPAGE
Lloh1:
	ldr	x8, [x8, _taskqueue_swi@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x1, x19, #24
	bl	_taskqueue_drain
	ldr	w0, [x19, #20]
Lloh3:
	adrp	x8, _UBT_N_TRANSFER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UBT_N_TRANSFER@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_usbd_transfer_unsetup
	mov	x0, x19
	bl	_UBT_NG_LOCK
	add	x0, x19, #16
	bl	_NG_BT_MBUFQ_DESTROY
	add	x0, x19, #12
	bl	_NG_BT_MBUFQ_DESTROY
	add	x0, x19, #8
	bl	_NG_BT_MBUFQ_DESTROY
	mov	x0, x19
	bl	_UBT_NG_UNLOCK
	add	x0, x19, #4
	bl	_mtx_destroy
	mov	x0, x19
	bl	_mtx_destroy
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_taskqueue_swi,4,2              ; @taskqueue_swi
	.comm	_UBT_N_TRANSFER,4,2             ; @UBT_N_TRANSFER
.subsections_via_symbols
