	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vybrid_ehci_detach
_vybrid_ehci_detach:                    ## @vybrid_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	%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, %r15
	movl	%r14d, %edi
	callq	_device_delete_children
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	leaq	8(%r15), %rbx
	movq	_EHCI_SCFLG_DONEINIT@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_ehci_detach
	movl	(%r12), %eax
	notl	%eax
	andl	%eax, (%rbx)
LBB0_3:
	movq	32(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:
	movq	24(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movq	_EHCI_USBINTR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
	callq	_bus_space_write_4
LBB0_6:
	movq	(%r15), %rax
	movq	40(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.7:
	movq	16(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.8:
	movl	%r14d, %edi
	callq	_bus_teardown_intr
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	callq	_device_printf
	jmp	LBB0_12
LBB0_10:
	movq	$0, 16(%r15)
LBB0_11:
	movq	%r15, %rdi
	addq	$12, %rdi
	movq	_ehci_iterate_hw_softc@GOTPCREL(%rip), %rsi
	callq	_usb_bus_mem_free_all
	movq	_vybrid_ehci_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r15), %rdx
	movl	%r14d, %edi
	callq	_bus_release_resources
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ## @EHCI_SCFLG_DONEINIT
	.comm	_EHCI_USBINTR,4,2               ## @EHCI_USBINTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not tear down irq, %d\n"

	.comm	_ehci_iterate_hw_softc,4,2      ## @ehci_iterate_hw_softc
	.comm	_vybrid_ehci_spec,4,2           ## @vybrid_ehci_spec
	.no_dead_strip	_vybrid_ehci_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vybrid_ehci_detach
_vybrid_ehci_detach:                    ; @vybrid_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
	mov	x0, x19
	bl	_device_delete_children
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.1:
	add	x21, x20, #8
	ldr	w8, [x21]
Lloh0:
	adrp	x22, _EHCI_SCFLG_DONEINIT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _EHCI_SCFLG_DONEINIT@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_ehci_detach
	ldr	w8, [x22]
	ldr	w9, [x21]
	bic	w8, w9, w8
	str	w8, [x21]
LBB0_3:
	ldr	x0, [x20, #32]
	cbz	x0, LBB0_6
; %bb.4:
	ldr	x1, [x20, #24]
	cbz	x1, LBB0_6
; %bb.5:
Lloh2:
	adrp	x8, _EHCI_USBINTR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EHCI_USBINTR@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w3, #0
	bl	_bus_space_write_4
LBB0_6:
	ldr	x8, [x20]
	ldr	x1, [x8, #40]
	cbz	x1, LBB0_11
; %bb.7:
	ldr	x2, [x20, #16]
	cbz	x2, LBB0_11
; %bb.8:
	mov	x0, x19
	bl	_bus_teardown_intr
	cbz	w0, LBB0_10
; %bb.9:
	mov	x21, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_device_printf
	b	LBB0_12
LBB0_10:
	str	xzr, [x20, #16]
LBB0_11:
	add	x0, x20, #12
Lloh7:
	adrp	x1, _ehci_iterate_hw_softc@GOTPAGE
Lloh8:
	ldr	x1, [x1, _ehci_iterate_hw_softc@GOTPAGEOFF]
	bl	_usb_bus_mem_free_all
Lloh9:
	adrp	x8, _vybrid_ehci_spec@GOTPAGE
Lloh10:
	ldr	x8, [x8, _vybrid_ehci_spec@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	x2, [x20]
	mov	x0, x19
	bl	_bus_release_resources
	mov	w21, #0
LBB0_12:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ; @EHCI_SCFLG_DONEINIT
	.comm	_EHCI_USBINTR,4,2               ; @EHCI_USBINTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not tear down irq, %d\n"

	.comm	_ehci_iterate_hw_softc,4,2      ; @ehci_iterate_hw_softc
	.comm	_vybrid_ehci_spec,4,2           ; @vybrid_ehci_spec
	.no_dead_strip	_vybrid_ehci_detach
.subsections_via_symbols
