	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_ehci_detach
_tegra_ehci_detach:                     ## @tegra_ehci_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	24(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_clk_release
LBB0_2:
	leaq	32(%rbx), %r15
	movq	40(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.3:
	movl	%r14d, %edi
	callq	_device_delete_child
LBB0_4:
	movq	_EHCI_SCFLG_DONEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_ehci_detach
LBB0_6:
	movq	48(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.7:
	movl	56(%rbx), %esi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_8:
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.9:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_10:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_12:
	cmpq	$0, (%rbx)
	je	LBB0_14
## %bb.13:
	addq	$40, %rbx
	movq	_ehci_iterate_hw_softc@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_usb_bus_mem_free_all
LBB0_14:
	movl	%r14d, %edi
	callq	_device_delete_children
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ## @EHCI_SCFLG_DONEINIT
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_ehci_iterate_hw_softc,4,2      ## @ehci_iterate_hw_softc
	.no_dead_strip	_tegra_ehci_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_ehci_detach
_tegra_ehci_detach:                     ; @tegra_ehci_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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	ldr	x0, [x0, #24]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_clk_release
LBB0_2:
	add	x22, x20, #32
	mov	x21, x20
	ldr	x1, [x21, #40]!
	cbz	x1, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_device_delete_child
LBB0_4:
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _EHCI_SCFLG_DONEINIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EHCI_SCFLG_DONEINIT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_ehci_detach
LBB0_6:
	ldr	x2, [x20, #48]
	cbz	x2, LBB0_8
; %bb.7:
	ldr	w1, [x20, #56]
	mov	x0, x19
	bl	_bus_teardown_intr
LBB0_8:
	ldr	x3, [x20, #16]
	cbz	x3, LBB0_10
; %bb.9:
Lloh3:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_10:
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_12
; %bb.11:
Lloh6:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_12:
	ldr	x8, [x20]
	cbz	x8, LBB0_14
; %bb.13:
Lloh9:
	adrp	x1, _ehci_iterate_hw_softc@GOTPAGE
Lloh10:
	ldr	x1, [x1, _ehci_iterate_hw_softc@GOTPAGEOFF]
	mov	x0, x21
	bl	_usb_bus_mem_free_all
LBB0_14:
	mov	x0, x19
	bl	_device_delete_children
	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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ; @EHCI_SCFLG_DONEINIT
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_ehci_iterate_hw_softc,4,2      ; @ehci_iterate_hw_softc
	.no_dead_strip	_tegra_ehci_detach
.subsections_via_symbols
