	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vybrid_ehci_attach
_vybrid_ehci_attach:                    ## @vybrid_ehci_attach
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%r14, 120(%rax)
	movq	%r14, 72(%rax)
	movl	112(%rax), %eax
	movl	%eax, 68(%rbx)
	movq	_EHCI_MAX_DEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
	movl	$32, 48(%rbx)
	movq	_vybrid_ehci_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rdx
	movq	%r14, %rdi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_3
LBB0_2:
	leaq	48(%rbx), %r15
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_rman_get_bustag
	movq	%rax, 96(%rbx)
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_rman_get_bushandle
	movq	%rax, %r12
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_rman_get_size
	movl	%eax, 108(%rbx)
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	callq	_rman_get_bustag
	movq	%rax, 32(%rbx)
	movq	(%rbx), %rax
	movl	4(%rax), %edi
	callq	_rman_get_bushandle
	movq	%rax, 24(%rbx)
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	callq	_rman_get_bustag
	movq	%rax, 16(%rbx)
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	callq	_rman_get_bushandle
	movq	%rax, 8(%rbx)
	movq	%r14, %rdi
	callq	_USB_GET_DMA_TAG
	movq	_ehci_iterate_hw_softc@GOTPCREL(%rip), %rdx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_usb_bus_mem_alloc_all
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	callq	_phy_init
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_device_printf
	movl	$1, %ebx
	jmp	LBB0_16
LBB0_6:
	movq	96(%rbx), %rdi
	movl	108(%rbx), %ecx
	leaq	88(%rbx), %r8
	movq	%r12, %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_bus_space_subregion
	testl	%eax, %eax
	jne	LBB0_3
## %bb.7:
	leaq	40(%rbx), %r12
	movq	(%rbx), %rax
	movq	_INTR_TYPE_BIO@GOTPCREL(%rip), %rcx
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	12(%rax), %esi
	movq	_ehci_interrupt@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	%rbx, %rax
	addq	$44, %rax
	movq	%rax, (%rsp)
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movq	%r12, %r9
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
	movl	$1, %ebx
	jmp	LBB0_16
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_device_add_child
	movq	%rax, 56(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %rdi
	movq	%r15, %rsi
	callq	_device_set_ivars
	movl	104(%rbx), %edi
	leaq	L_.str.6(%rip), %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	88(%rbx), %rsi
	movq	96(%rbx), %rdi
	movl	$168, %edx
	callq	_bus_space_read_4
	orl	$3, %eax
	movq	88(%rbx), %rsi
	movq	96(%rbx), %rdi
	movl	$168, %edx
	movl	%eax, %ecx
	callq	_bus_space_write_4
	movq	_EHCI_SCFLG_TT@GOTPCREL(%rip), %rax
	movq	_EHCI_SCFLG_NORESTERM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 40(%rbx)
	movq	_vybrid_ehci_post_reset@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 84(%rbx)
	movq	_ehci_get_port_speed_portsc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 80(%rbx)
	movq	%r12, %rdi
	callq	_ehci_init
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	leaq	L_.str.7(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
	movq	56(%rbx), %rsi
	movq	%r14, %rdi
	callq	_device_delete_child
	movq	$0, 56(%rbx)
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_14:
	movq	(%rbx), %rax
	movl	20(%rax), %esi
	movl	44(%rbx), %edx
	movq	%r14, %rdi
	callq	_bus_teardown_intr
	movl	$1, %ebx
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_16
LBB0_12:
	movq	_EHCI_SCFLG_DONEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 40(%rbx)
	movq	56(%rbx), %rdi
	callq	_device_probe_and_attach
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EHCI_MAX_DEVICES,4,2           ## @EHCI_MAX_DEVICES
	.comm	_vybrid_ehci_spec,4,2           ## @vybrid_ehci_spec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ehci_iterate_hw_softc,4,2      ## @ehci_iterate_hw_softc
L_.str.1:                               ## @.str.1
	.asciz	"Could not setup PHY\n"

	.comm	_INTR_TYPE_BIO,4,2              ## @INTR_TYPE_BIO
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_ehci_interrupt,8,3             ## @ehci_interrupt
L_.str.2:                               ## @.str.2
	.asciz	"Could not setup irq, %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"usbus"

L_.str.4:                               ## @.str.4
	.asciz	"Could not add USB device\n"

L_.str.5:                               ## @.str.5
	.asciz	"Could not tear down irq, %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"Freescale"

	.comm	_EHCI_SCFLG_TT,4,2              ## @EHCI_SCFLG_TT
	.comm	_EHCI_SCFLG_NORESTERM,4,2       ## @EHCI_SCFLG_NORESTERM
	.comm	_vybrid_ehci_post_reset,4,2     ## @vybrid_ehci_post_reset
	.comm	_ehci_get_port_speed_portsc,4,2 ## @ehci_get_port_speed_portsc
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ## @EHCI_SCFLG_DONEINIT
L_.str.7:                               ## @.str.7
	.asciz	"USB init failed err=%d\n"

	.comm	_USB_HCSPARAMS,4,2              ## @USB_HCSPARAMS
	.comm	_USB_HWDEVICE,4,2               ## @USB_HWDEVICE
	.comm	_USB_HWGENERAL,4,2              ## @USB_HWGENERAL
	.comm	_USB_HWHOST,4,2                 ## @USB_HWHOST
	.comm	_USB_HWRXBUF,4,2                ## @USB_HWRXBUF
	.comm	_USB_HWTXBUF,4,2                ## @USB_HWTXBUF
	.comm	_USB_ID,4,2                     ## @USB_ID
	.no_dead_strip	_vybrid_ehci_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vybrid_ehci_attach
_vybrid_ehci_attach:                    ; @vybrid_ehci_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	w8, #32
	mov	x21, x0
	str	w8, [x21, #48]!
	str	x19, [x0, #120]
	str	x19, [x0, #72]
	ldr	w8, [x0, #112]
Lloh0:
	adrp	x9, _EHCI_MAX_DEVICES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EHCI_MAX_DEVICES@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #64]
Lloh3:
	adrp	x8, _vybrid_ehci_spec@GOTPAGE
Lloh4:
	ldr	x8, [x8, _vybrid_ehci_spec@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [x0]
	mov	x0, x19
	bl	_bus_alloc_resources
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_3
LBB0_2:
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_rman_get_bustag
	str	x0, [x20, #96]
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_rman_get_bushandle
	mov	x22, x0
	ldr	x8, [x20]
	ldr	w0, [x8]
	bl	_rman_get_size
	str	w0, [x20, #108]
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_rman_get_bustag
	str	x0, [x20, #32]
	ldr	x8, [x20]
	ldr	w0, [x8, #4]
	bl	_rman_get_bushandle
	str	x0, [x20, #24]
	ldr	x8, [x20]
	ldr	w0, [x8, #8]
	bl	_rman_get_bustag
	str	x0, [x20, #16]
	ldr	x8, [x20]
	ldr	w0, [x8, #8]
	bl	_rman_get_bushandle
	str	x0, [x20, #8]
	mov	x0, x19
	bl	_USB_GET_DMA_TAG
	mov	x1, x0
Lloh8:
	adrp	x2, _ehci_iterate_hw_softc@GOTPAGE
Lloh9:
	ldr	x2, [x2, _ehci_iterate_hw_softc@GOTPAGEOFF]
	mov	x0, x21
	bl	_usb_bus_mem_alloc_all
	cbz	x0, LBB0_5
LBB0_3:
Lloh10:
	adrp	x8, _ENXIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_5:
	mov	x0, x20
	bl	_phy_init
	cbz	x0, LBB0_9
; %bb.6:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_device_printf
LBB0_8:
	mov	w0, #1
	b	LBB0_4
LBB0_9:
	ldr	x0, [x20, #96]
	ldr	w3, [x20, #108]
	add	x4, x20, #88
	mov	x1, x22
	mov	w2, #256
	bl	_bus_space_subregion
	cbnz	w0, LBB0_3
; %bb.10:
	mov	x6, x20
	ldr	x8, [x6], #44
	add	x22, x20, #40
	ldr	w1, [x8, #12]
Lloh15:
	adrp	x8, _INTR_TYPE_BIO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _INTR_TYPE_BIO@GOTPAGEOFF]
Lloh17:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
Lloh20:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh21:
	adrp	x8, _ehci_interrupt@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ehci_interrupt@GOTPAGEOFF]
Lloh23:
	ldr	x4, [x8]
	mov	x0, x19
	mov	x3, #0
	mov	x5, x22
	bl	_bus_setup_intr
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_12
; %bb.11:
	str	x0, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_12:
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	w2, #-1
	bl	_device_add_child
	str	x0, [x20, #56]
	cbz	x0, LBB0_15
; %bb.13:
	mov	x1, x21
	bl	_device_set_ivars
	ldr	w0, [x20, #104]
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w2, #4
	bl	_strlcpy
	ldp	x1, x0, [x20, #88]
	mov	w2, #168
	bl	_bus_space_read_4
	orr	w3, w0, #0x3
	ldp	x1, x0, [x20, #88]
	mov	w2, #168
	bl	_bus_space_write_4
Lloh30:
	adrp	x8, _EHCI_SCFLG_TT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EHCI_SCFLG_TT@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _EHCI_SCFLG_NORESTERM@GOTPAGE
Lloh34:
	ldr	x9, [x9, _EHCI_SCFLG_NORESTERM@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x20, #40]
	orr	w8, w8, w9
	str	w8, [x20, #40]
Lloh36:
	adrp	x8, _vybrid_ehci_post_reset@GOTPAGE
Lloh37:
	ldr	x8, [x8, _vybrid_ehci_post_reset@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
Lloh39:
	adrp	x9, _ehci_get_port_speed_portsc@GOTPAGE
Lloh40:
	ldr	x9, [x9, _ehci_get_port_speed_portsc@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #80]
	mov	x0, x22
	bl	_ehci_init
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_18
; %bb.14:
	str	x0, [sp]
Lloh42:
	adrp	x1, l_.str.7@PAGE
Lloh43:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	ldr	x1, [x20, #56]
	mov	x0, x19
	bl	_device_delete_child
	str	xzr, [x20, #56]
	b	LBB0_16
LBB0_15:
Lloh44:
	adrp	x1, l_.str.4@PAGE
Lloh45:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_16:
	ldr	x8, [x20]
	ldr	w1, [x8, #20]
	ldr	w2, [x20, #44]
	mov	x0, x19
	bl	_bus_teardown_intr
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_8
; %bb.17:
	str	x0, [sp]
Lloh46:
	adrp	x1, l_.str.5@PAGE
Lloh47:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_7
LBB0_18:
Lloh48:
	adrp	x8, _EHCI_SCFLG_DONEINIT@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EHCI_SCFLG_DONEINIT@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	ldr	w9, [x20, #40]
	orr	w8, w9, w8
	str	w8, [x20, #40]
	ldr	x0, [x20, #56]
	bl	_device_probe_and_attach
	mov	w0, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh19
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_EHCI_MAX_DEVICES,4,2           ; @EHCI_MAX_DEVICES
	.comm	_vybrid_ehci_spec,4,2           ; @vybrid_ehci_spec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ehci_iterate_hw_softc,4,2      ; @ehci_iterate_hw_softc
l_.str.1:                               ; @.str.1
	.asciz	"Could not setup PHY\n"

	.comm	_INTR_TYPE_BIO,4,2              ; @INTR_TYPE_BIO
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_ehci_interrupt,8,3             ; @ehci_interrupt
l_.str.2:                               ; @.str.2
	.asciz	"Could not setup irq, %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"usbus"

l_.str.4:                               ; @.str.4
	.asciz	"Could not add USB device\n"

l_.str.5:                               ; @.str.5
	.asciz	"Could not tear down irq, %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"Freescale"

	.comm	_EHCI_SCFLG_TT,4,2              ; @EHCI_SCFLG_TT
	.comm	_EHCI_SCFLG_NORESTERM,4,2       ; @EHCI_SCFLG_NORESTERM
	.comm	_vybrid_ehci_post_reset,4,2     ; @vybrid_ehci_post_reset
	.comm	_ehci_get_port_speed_portsc,4,2 ; @ehci_get_port_speed_portsc
	.comm	_EHCI_SCFLG_DONEINIT,4,2        ; @EHCI_SCFLG_DONEINIT
l_.str.7:                               ; @.str.7
	.asciz	"USB init failed err=%d\n"

	.comm	_USB_HCSPARAMS,4,2              ; @USB_HCSPARAMS
	.comm	_USB_HWDEVICE,4,2               ; @USB_HWDEVICE
	.comm	_USB_HWGENERAL,4,2              ; @USB_HWGENERAL
	.comm	_USB_HWHOST,4,2                 ; @USB_HWHOST
	.comm	_USB_HWRXBUF,4,2                ; @USB_HWRXBUF
	.comm	_USB_HWTXBUF,4,2                ; @USB_HWTXBUF
	.comm	_USB_ID,4,2                     ; @USB_ID
	.no_dead_strip	_vybrid_ehci_attach
.subsections_via_symbols
