	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_xhci_detach
_tegra_xhci_detach:                     ## @tegra_xhci_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	leaq	40(%rax), %r15
	movl	%r14d, %edi
	callq	_device_delete_children
	cmpq	$0, 32(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	addq	$64, %rdi
	callq	_usb_callout_drain
	movq	%r15, %rdi
	callq	_xhci_halt_controller
LBB0_2:
	movq	48(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.3:
	movq	56(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.4:
	movl	%r14d, %edi
	callq	_bus_teardown_intr
	movq	$0, 56(%rbx)
	movq	48(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
LBB0_5:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rsi, %rdi
	callq	_rman_get_rid
	movq	48(%rbx), %rcx
	movl	%r14d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_bus_release_resource
	movq	$0, 48(%rbx)
LBB0_6:
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	callq	_rman_get_rid
	movq	(%r15), %rcx
	movl	%r14d, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_bus_release_resource
	movq	$0, (%r15)
LBB0_8:
	cmpq	$0, 32(%rbx)
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_xhci_uninit
LBB0_10:
	movq	16(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.11:
	movq	24(%rbx), %rsi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_12:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:
	movl	8(%rbx), %esi
	callq	_kmem_free
LBB0_14:
	movq	%rbx, %rdi
	callq	_LOCK_DESTROY
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_tegra_xhci_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_xhci_detach
_tegra_xhci_detach:                     ; @tegra_xhci_detach
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	add	x21, x0, #40
	mov	x0, x20
	bl	_device_delete_children
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x19, #64
	bl	_usb_callout_drain
	mov	x0, x21
	bl	_xhci_halt_controller
LBB0_2:
	ldr	x1, [x19, #48]
	cbz	x1, LBB0_6
; %bb.3:
	ldr	x2, [x19, #56]
	cbz	x2, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_bus_teardown_intr
	str	xzr, [x19, #56]
	ldr	x1, [x19, #48]
	cbz	x1, LBB0_6
LBB0_5:
Lloh0:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x1
	bl	_rman_get_rid
	mov	x2, x0
	ldr	x3, [x19, #48]
	mov	x0, x20
	mov	x1, x22
	bl	_bus_release_resource
	str	xzr, [x19, #48]
LBB0_6:
	ldr	x0, [x21]
	cbz	x0, LBB0_8
; %bb.7:
Lloh3:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	bl	_rman_get_rid
	mov	x2, x0
	ldr	x3, [x21]
	mov	x0, x20
	mov	x1, x22
	bl	_bus_release_resource
	str	xzr, [x21]
LBB0_8:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_xhci_uninit
LBB0_10:
	ldr	x2, [x19, #16]
	cbz	x2, LBB0_12
; %bb.11:
	ldr	x1, [x19, #24]
	mov	x0, x20
	bl	_bus_teardown_intr
LBB0_12:
	ldr	x0, [x19]
	cbz	x0, LBB0_14
; %bb.13:
	ldr	w1, [x19, #8]
	bl	_kmem_free
LBB0_14:
	mov	x0, x19
	bl	_LOCK_DESTROY
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_tegra_xhci_detach
.subsections_via_symbols
