	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usbphy_attach
_usbphy_attach:                         ## @usbphy_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, %r12
	movl	$0, -44(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdx
	movl	%r15d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%r14d, %r14d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_BUS_SPACE_PHYSADDR
	xorl	%ecx, %ecx
	cmpq	$34377728, %rax                 ## imm = 0x20C9000
	setne	%cl
	movl	$96, %ebx
	cmoveq	%r14, %rbx
	movl	%ecx, (%r12)
	movq	_IMX6_ANALOG_USB1_CHRG_DETECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%rbx, %rdi
	movq	_IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE@GOTPCREL(%rip), %rax
	movq	_IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	orl	(%rax), %esi
	callq	_imx6_anatop_write_4
	movq	_IMX6_ANALOG_USB1_CHRG_DETECT@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movl	(%r13), %esi
	movq	_IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_imx6_anatop_write_4
	movl	%r15d, %edi
	callq	_imx_ccm_usbphy_enable
	movq	8(%r12), %rdi
	movq	_CTRL_SET_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_CTRL_SFTRST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_bus_write_4
	movq	8(%r12), %rdi
	movq	_CTRL_CLR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CTRL_CLKGATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rbx), %edx
	callq	_bus_write_4
	movq	8(%r12), %rdi
	movl	(%r15), %esi
	movq	_CTRL_ENUTMILEVEL2@GOTPCREL(%rip), %rax
	movq	_CTRL_ENUTMILEVEL3@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	callq	_bus_write_4
	movq	8(%r12), %rdi
	movq	_PWD_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_bus_write_4
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.4:
	movl	%r15d, %edi
	callq	_usbphy_detach
	jmp	LBB0_5
LBB0_3:
	xorl	%r14d, %r14d
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_IMX6_ANALOG_USB1_CHRG_DETECT,8,3 ## @IMX6_ANALOG_USB1_CHRG_DETECT
	.comm	_IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE,4,2 ## @IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE
	.comm	_IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG,4,2 ## @IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG
	.comm	_CTRL_SET_REG,4,2               ## @CTRL_SET_REG
	.comm	_CTRL_SFTRST,4,2                ## @CTRL_SFTRST
	.comm	_CTRL_CLR_REG,4,2               ## @CTRL_CLR_REG
	.comm	_CTRL_CLKGATE,4,2               ## @CTRL_CLKGATE
	.comm	_CTRL_ENUTMILEVEL2,4,2          ## @CTRL_ENUTMILEVEL2
	.comm	_CTRL_ENUTMILEVEL3,4,2          ## @CTRL_ENUTMILEVEL3
	.comm	_PWD_REG,4,2                    ## @PWD_REG
	.no_dead_strip	_usbphy_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usbphy_attach
_usbphy_attach:                         ; @usbphy_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_bus_alloc_resource_any
	str	x0, [x19, #8]
	cbz	x0, LBB0_2
; %bb.1:
	mov	w1, #0
	bl	_BUS_SPACE_PHYSADDR
	mov	w8, #36864
	movk	w8, #524, lsl #16
	mov	w9, #96
	cmp	x0, x8
	csel	x21, xzr, x9, eq
	cset	w8, ne
	str	w8, [x19]
Lloh6:
	adrp	x22, _IMX6_ANALOG_USB1_CHRG_DETECT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _IMX6_ANALOG_USB1_CHRG_DETECT@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh8:
	adrp	x23, _IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE@GOTPAGE
Lloh9:
	ldr	x23, [x23, _IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE@GOTPAGEOFF]
	add	x0, x8, x21
	ldr	w8, [x23]
Lloh10:
	adrp	x24, _IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG@GOTPAGE
Lloh11:
	ldr	x24, [x24, _IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w1, w9, w8
	bl	_imx6_anatop_write_4
	ldr	x8, [x22]
	add	x0, x8, x21
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w1, w9, w8
	bl	_imx6_anatop_write_4
	mov	x0, x20
	bl	_imx_ccm_usbphy_enable
	ldr	x0, [x19, #8]
Lloh12:
	adrp	x20, _CTRL_SET_REG@GOTPAGE
Lloh13:
	ldr	x20, [x20, _CTRL_SET_REG@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh14:
	adrp	x21, _CTRL_SFTRST@GOTPAGE
Lloh15:
	ldr	x21, [x21, _CTRL_SFTRST@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_bus_write_4
	ldr	x0, [x19, #8]
Lloh16:
	adrp	x8, _CTRL_CLR_REG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CTRL_CLR_REG@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	ldr	w8, [x21]
Lloh19:
	adrp	x9, _CTRL_CLKGATE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CTRL_CLKGATE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_bus_write_4
	ldr	x0, [x19, #8]
Lloh22:
	adrp	x8, _CTRL_ENUTMILEVEL2@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CTRL_ENUTMILEVEL2@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _CTRL_ENUTMILEVEL3@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CTRL_ENUTMILEVEL3@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w2, w9, w8
	bl	_bus_write_4
	ldr	x0, [x19, #8]
Lloh28:
	adrp	x8, _PWD_REG@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PWD_REG@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_bus_write_4
	mov	w19, #0
	b	LBB0_4
LBB0_2:
Lloh31:
	adrp	x1, l_.str@PAGE
Lloh32:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh33:
	adrp	x8, _ENXIO@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh35:
	ldr	w19, [x8]
	cbz	w19, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_usbphy_detach
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_IMX6_ANALOG_USB1_CHRG_DETECT,8,3 ; @IMX6_ANALOG_USB1_CHRG_DETECT
	.comm	_IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE,4,2 ; @IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE
	.comm	_IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG,4,2 ; @IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG
	.comm	_CTRL_SET_REG,4,2               ; @CTRL_SET_REG
	.comm	_CTRL_SFTRST,4,2                ; @CTRL_SFTRST
	.comm	_CTRL_CLR_REG,4,2               ; @CTRL_CLR_REG
	.comm	_CTRL_CLKGATE,4,2               ; @CTRL_CLKGATE
	.comm	_CTRL_ENUTMILEVEL2,4,2          ; @CTRL_ENUTMILEVEL2
	.comm	_CTRL_ENUTMILEVEL3,4,2          ; @CTRL_ENUTMILEVEL3
	.comm	_PWD_REG,4,2                    ; @PWD_REG
	.no_dead_strip	_usbphy_attach
.subsections_via_symbols
