	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_usb_phy_attach
_aml8726_usb_phy_attach:                ## @aml8726_usb_phy_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r14d, 16(%rax)
	leaq	L_.str(%rip), %rdi
	leaq	-64(%rbp), %rsi
	callq	_aml8726_usb_phy_mode
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	leaq	-60(%rbp), %rsi
	callq	_aml8726_usb_phy_mode
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movq	_aml8726_usb_phy_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movl	%r14d, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.4(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	callq	_device_printf
LBB0_17:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_26:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str.5(%rip), %rsi
	leaq	-56(%rbp), %rcx
	movl	%eax, %edi
	movl	$24, %edx
	callq	_OF_getencprop_alloc_multi
	xorl	%ebx, %ebx
	testq	%rax, %rax
	cmovgq	%rax, %rbx
	movl	$0, (%r15)
	leal	(,%rbx,8), %eax
	leal	(%rax,%rax,2), %edi
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_malloc
	movq	%rax, 8(%r15)
	testl	%ebx, %ebx
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jle	LBB0_8
## %bb.9:
	movl	%ebx, %eax
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax
	movq	(%rax,%rbx), %rdi
	callq	_OF_device_from_xref
	movq	8(%r15), %rcx
	movq	%rax, 16(%rcx,%rbx)
	movq	-56(%rbp), %rdx
	movq	8(%rdx,%rbx), %rdx
	movq	%rdx, 8(%rcx,%rbx)
	movq	-56(%rbp), %rdx
	movq	16(%rdx,%rbx), %rdx
	movq	%rdx, (%rcx,%rbx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=1
	addq	$24, %rbx
	cmpq	%rbx, %r13
	jne	LBB0_11
## %bb.18:
	movq	-56(%rbp), %rdi
	callq	_OF_prop_free
	xorl	%r12d, %r12d
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	16(%rax,%r12), %r14
	movq	(%rax,%r12), %rdi
	movq	8(%rax,%r12), %rbx
	callq	_PIN_ON_FLAG
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_GPIO_PIN_SET
	testq	%rax, %rax
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	8(%r15), %rax
	movq	8(%rax,%r12), %rsi
	movq	16(%rax,%r12), %rdi
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_GPIO_PIN_SETFLAGS
	testq	%rax, %rax
	jne	LBB0_20
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=1
	incl	(%r15)
	addq	$24, %r12
	cmpq	%r12, %r13
	jne	LBB0_19
	jmp	LBB0_23
LBB0_8:
	movq	-56(%rbp), %rdi
	callq	_OF_prop_free
LBB0_23:
	movq	_AML_USB_PHY_CFG_REG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_READ_4
	movq	_AML_USB_PHY_CFG_CLK_DIV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_AML_USB_PHY_CFG_CLK_SEL_MASK@GOTPCREL(%rip), %rbx
	movq	_AML_USB_PHY_CFG_A_RST@GOTPCREL(%rip), %r14
	movq	_AML_USB_PHY_CFG_B_RST@GOTPCREL(%rip), %r12
	movq	_AML_USB_PHY_CFG_A_PLL_RST@GOTPCREL(%rip), %rsi
	movq	_AML_USB_PHY_CFG_B_PLL_RST@GOTPCREL(%rip), %rcx
	movq	_AML_USB_PHY_CFG_A_PHYS_RST@GOTPCREL(%rip), %rdi
	movq	_AML_USB_PHY_CFG_B_PHYS_RST@GOTPCREL(%rip), %r9
	movq	_AML_USB_PHY_CFG_A_POR@GOTPCREL(%rip), %r8
	movl	(%rbx), %ebx
	orl	%edx, %ebx
	orl	(%r14), %ebx
	orl	(%r12), %ebx
	orl	(%rsi), %ebx
	orl	(%rcx), %ebx
	orl	(%rdi), %ebx
	orl	(%r9), %ebx
	orl	(%r8), %ebx
	movq	_AML_USB_PHY_CFG_B_POR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	_AML_USB_PHY_CFG_CLK_SEL_XTAL@GOTPCREL(%rip), %rax
	movq	_AML_USB_PHY_CFG_CLK_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	orl	(%rax), %ebx
	andl	%edx, %esi
	movq	_AML_USB_PHY_CFG_CLK_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	orl	%esi, %ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	orl	(%r14), %ebx
	orl	(%r12), %ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movl	(%r12), %r12d
	orl	(%r14), %r12d
	notl	%r12d
	andl	%ebx, %r12d
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movq	_AML_USB_PHY_CFG_A_PLL_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_AML_USB_PHY_CFG_B_PLL_RST@GOTPCREL(%rip), %rbx
	orl	(%rbx), %r12d
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movl	(%rbx), %ebx
	movq	_AML_USB_PHY_CFG_A_PLL_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	notl	%ebx
	andl	%r12d, %ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movq	_AML_USB_PHY_CFG_A_PHYS_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_AML_USB_PHY_CFG_B_PHYS_RST@GOTPCREL(%rip), %r12
	orl	(%r12), %ebx
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movl	(%r12), %r12d
	movq	_AML_USB_PHY_CFG_A_PHYS_RST@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	notl	%r12d
	andl	%ebx, %r12d
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movq	_AML_USB_PHY_CFG_A_POR@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movq	_AML_USB_PHY_CFG_B_POR@GOTPCREL(%rip), %rbx
	orl	(%rbx), %r12d
	movl	(%r13), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movl	(%rbx), %edx
	movq	_AML_USB_PHY_CFG_A_POR@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	notl	%edx
	andl	%r12d, %edx
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_WRITE_4
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movl	$200, %edi
	callq	_DELAY
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_CSR_READ_4
	movq	_AML_USB_PHY_CFG_CLK_DETECTED@GOTPCREL(%rip), %rcx
	notl	%eax
	testl	%eax, (%rcx)
	je	LBB0_25
## %bb.24:
	leaq	L_.str.8(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_device_printf
LBB0_25:
	movq	_AML_USB_PHY_MISC_A_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_READ_4
	movq	_AML_USB_PHY_MISC_ID_OVERIDE_EN@GOTPCREL(%rip), %r14
	movq	_AML_USB_PHY_MISC_ID_OVERIDE_DEVICE@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	orl	(%r14), %edx
	movq	_AML_USB_PHY_MISC_ID_OVERIDE_HOST@GOTPCREL(%rip), %r13
	orl	(%r13), %edx
	notl	%edx
	andl	%eax, %edx
	orl	-64(%rbp), %edx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_WRITE_4
	movq	_AML_USB_PHY_MISC_B_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_READ_4
	movl	(%r12), %edx
	orl	(%r14), %edx
	orl	(%r13), %edx
	notl	%edx
	andl	%eax, %edx
	orl	-60(%rbp), %edx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_WRITE_4
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	xorl	%eax, %eax
	jmp	LBB0_26
LBB0_12:
	movq	-56(%rbp), %rdi
	callq	_OF_prop_free
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_13
LBB0_20:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	leaq	L_.str.7(%rip), %rsi
LBB0_13:
	movl	%r14d, %edi
	callq	_device_printf
	movslq	(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.14:
	leaq	(%rbx,%rbx,2), %rax
	leaq	-8(,%rax,8), %r14
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r14), %r12
	movq	-16(%rax,%r14), %rdi
	movq	-8(%rax,%r14), %r13
	callq	_PIN_OFF_FLAG
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_GPIO_PIN_SET
	addq	$-24, %r14
	decl	%ebx
	jne	LBB0_15
LBB0_16:
	movq	8(%r15), %rdi
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_free
	movq	$0, 8(%r15)
	movq	_aml8726_usb_phy_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_bus_release_resources
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/soc/usb@c9040000"

L_.str.1:                               ## @.str.1
	.asciz	"missing usb@c9040000 node in FDT\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"/soc/usb@c90c0000"

L_.str.3:                               ## @.str.3
	.asciz	"missing usb@c90c0000 node in FDT\n"

	.comm	_aml8726_usb_phy_spec,4,2       ## @aml8726_usb_phy_spec
L_.str.4:                               ## @.str.4
	.asciz	"can not allocate resources for device\n"

L_.str.5:                               ## @.str.5
	.asciz	"usb-pwr-en"

	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
L_.str.6:                               ## @.str.6
	.asciz	"unable to parse gpio\n"

	.comm	_GPIO_PIN_OUTPUT,4,2            ## @GPIO_PIN_OUTPUT
L_.str.7:                               ## @.str.7
	.asciz	"could not use gpio to control power\n"

	.comm	_AML_USB_PHY_CFG_REG,4,2        ## @AML_USB_PHY_CFG_REG
	.comm	_AML_USB_PHY_CFG_CLK_DIV_MASK,4,2 ## @AML_USB_PHY_CFG_CLK_DIV_MASK
	.comm	_AML_USB_PHY_CFG_CLK_SEL_MASK,4,2 ## @AML_USB_PHY_CFG_CLK_SEL_MASK
	.comm	_AML_USB_PHY_CFG_A_RST,4,2      ## @AML_USB_PHY_CFG_A_RST
	.comm	_AML_USB_PHY_CFG_B_RST,4,2      ## @AML_USB_PHY_CFG_B_RST
	.comm	_AML_USB_PHY_CFG_A_PLL_RST,4,2  ## @AML_USB_PHY_CFG_A_PLL_RST
	.comm	_AML_USB_PHY_CFG_B_PLL_RST,4,2  ## @AML_USB_PHY_CFG_B_PLL_RST
	.comm	_AML_USB_PHY_CFG_A_PHYS_RST,4,2 ## @AML_USB_PHY_CFG_A_PHYS_RST
	.comm	_AML_USB_PHY_CFG_B_PHYS_RST,4,2 ## @AML_USB_PHY_CFG_B_PHYS_RST
	.comm	_AML_USB_PHY_CFG_A_POR,4,2      ## @AML_USB_PHY_CFG_A_POR
	.comm	_AML_USB_PHY_CFG_B_POR,4,2      ## @AML_USB_PHY_CFG_B_POR
	.comm	_AML_USB_PHY_CFG_CLK_SEL_XTAL,4,2 ## @AML_USB_PHY_CFG_CLK_SEL_XTAL
	.comm	_AML_USB_PHY_CFG_CLK_DIV_SHIFT,4,2 ## @AML_USB_PHY_CFG_CLK_DIV_SHIFT
	.comm	_AML_USB_PHY_CFG_CLK_EN,4,2     ## @AML_USB_PHY_CFG_CLK_EN
	.comm	_AML_USB_PHY_CFG_CLK_DETECTED,4,2 ## @AML_USB_PHY_CFG_CLK_DETECTED
L_.str.8:                               ## @.str.8
	.asciz	"PHY Clock not detected\n"

	.comm	_AML_USB_PHY_MISC_A_REG,4,2     ## @AML_USB_PHY_MISC_A_REG
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_EN,4,2 ## @AML_USB_PHY_MISC_ID_OVERIDE_EN
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_DEVICE,4,2 ## @AML_USB_PHY_MISC_ID_OVERIDE_DEVICE
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_HOST,4,2 ## @AML_USB_PHY_MISC_ID_OVERIDE_HOST
	.comm	_AML_USB_PHY_MISC_B_REG,4,2     ## @AML_USB_PHY_MISC_B_REG
	.no_dead_strip	_aml8726_usb_phy_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aml8726_usb_phy_attach
_aml8726_usb_phy_attach:                ; @aml8726_usb_phy_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	bl	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	add	x1, sp, #4
	bl	_aml8726_usb_phy_mode
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_2:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, sp
	bl	_aml8726_usb_phy_mode
	cbz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x24, _aml8726_usb_phy_spec@GOTPAGE
Lloh9:
	ldr	x24, [x24, _aml8726_usb_phy_spec@GOTPAGEOFF]
	ldr	w1, [x24]
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_bus_alloc_resources
	cbz	x0, LBB0_9
; %bb.5:
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_device_printf
LBB0_7:
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	mov	x0, x20
	bl	_ofw_bus_get_node
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x3, sp, #8
	mov	w2, #24
	bl	_OF_getencprop_alloc_multi
	cmp	x0, #0
	csel	x23, x0, xzr, gt
	str	wzr, [x19]
	add	w8, w23, w23, lsl #1
	lsl	w0, w8, #3
Lloh17:
	adrp	x25, _M_DEVBUF@GOTPAGE
Lloh18:
	ldr	x25, [x25, _M_DEVBUF@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh19:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	bl	_malloc
	str	x0, [x19, #8]
	cmp	w23, #0
	b.le	LBB0_17
; %bb.10:
	mov	x22, #0
	and	x21, x23, #0xffffffff
	add	x8, x21, w23, uxtw #1
	lsl	x23, x8, #3
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #8]
	ldr	x0, [x8, x22]
	bl	_OF_device_from_xref
	ldr	x8, [x19, #8]
	add	x8, x8, x22
	str	x0, [x8, #16]
	ldr	x9, [sp, #8]
	add	x9, x9, x22
	ldr	x9, [x9, #8]
	str	x9, [x8, #8]
	ldr	x9, [sp, #8]
	add	x9, x9, x22
	ldr	x9, [x9, #16]
	str	x9, [x8]
	cbz	x0, LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x22, x22, #24
	cmp	x23, x22
	b.ne	LBB0_11
; %bb.13:
	ldr	x0, [sp, #8]
	bl	_OF_prop_free
	mov	x26, #0
	add	x8, x21, x21, lsl #1
	lsl	x27, x8, #3
Lloh22:
	adrp	x21, l_.str.7@PAGE
Lloh23:
	add	x21, x21, l_.str.7@PAGEOFF
Lloh24:
	adrp	x28, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh25:
	ldr	x28, [x28, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x26
	ldp	x23, x22, [x8, #8]
	ldr	x0, [x8]
	bl	_PIN_ON_FLAG
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_GPIO_PIN_SET
	cbnz	x0, LBB0_22
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x26
	ldp	x1, x0, [x8, #8]
	ldr	w2, [x28]
	bl	_GPIO_PIN_SETFLAGS
	cbnz	x0, LBB0_22
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	add	x26, x26, #24
	cmp	x27, x26
	b.ne	LBB0_14
	b	LBB0_18
LBB0_17:
	ldr	x0, [sp, #8]
	bl	_OF_prop_free
LBB0_18:
Lloh26:
	adrp	x22, _AML_USB_PHY_CFG_REG@GOTPAGE
Lloh27:
	ldr	x22, [x22, _AML_USB_PHY_CFG_REG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_READ_4
Lloh28:
	adrp	x8, _AML_USB_PHY_CFG_CLK_DIV_MASK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AML_USB_PHY_CFG_CLK_DIV_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	adrp	x9, _AML_USB_PHY_CFG_CLK_SEL_MASK@GOTPAGE
Lloh32:
	ldr	x9, [x9, _AML_USB_PHY_CFG_CLK_SEL_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
Lloh34:
	adrp	x23, _AML_USB_PHY_CFG_A_RST@GOTPAGE
Lloh35:
	ldr	x23, [x23, _AML_USB_PHY_CFG_A_RST@GOTPAGEOFF]
	ldr	w10, [x23]
Lloh36:
	adrp	x24, _AML_USB_PHY_CFG_B_RST@GOTPAGE
Lloh37:
	ldr	x24, [x24, _AML_USB_PHY_CFG_B_RST@GOTPAGEOFF]
	ldr	w11, [x24]
Lloh38:
	adrp	x27, _AML_USB_PHY_CFG_A_PLL_RST@GOTPAGE
Lloh39:
	ldr	x27, [x27, _AML_USB_PHY_CFG_A_PLL_RST@GOTPAGEOFF]
	ldr	w12, [x27]
Lloh40:
	adrp	x28, _AML_USB_PHY_CFG_B_PLL_RST@GOTPAGE
Lloh41:
	ldr	x28, [x28, _AML_USB_PHY_CFG_B_PLL_RST@GOTPAGEOFF]
	ldr	w13, [x28]
Lloh42:
	adrp	x25, _AML_USB_PHY_CFG_A_PHYS_RST@GOTPAGE
Lloh43:
	ldr	x25, [x25, _AML_USB_PHY_CFG_A_PHYS_RST@GOTPAGEOFF]
	ldr	w14, [x25]
Lloh44:
	adrp	x26, _AML_USB_PHY_CFG_B_PHYS_RST@GOTPAGE
Lloh45:
	ldr	x26, [x26, _AML_USB_PHY_CFG_B_PHYS_RST@GOTPAGEOFF]
	ldr	w15, [x26]
Lloh46:
	adrp	x16, _AML_USB_PHY_CFG_A_POR@GOTPAGE
Lloh47:
	ldr	x16, [x16, _AML_USB_PHY_CFG_A_POR@GOTPAGEOFF]
Lloh48:
	ldr	w16, [x16]
Lloh49:
	adrp	x17, _AML_USB_PHY_CFG_B_POR@GOTPAGE
Lloh50:
	ldr	x17, [x17, _AML_USB_PHY_CFG_B_POR@GOTPAGEOFF]
Lloh51:
	ldr	w17, [x17]
	orr	w9, w9, w8
	orr	w9, w9, w10
	orr	w9, w9, w11
	orr	w9, w9, w12
	orr	w9, w9, w13
	orr	w9, w9, w14
	orr	w9, w9, w15
	orr	w9, w9, w16
	orr	w9, w9, w17
	bic	w9, w0, w9
Lloh52:
	adrp	x10, _AML_USB_PHY_CFG_CLK_SEL_XTAL@GOTPAGE
Lloh53:
	ldr	x10, [x10, _AML_USB_PHY_CFG_CLK_SEL_XTAL@GOTPAGEOFF]
Lloh54:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh55:
	adrp	x10, _AML_USB_PHY_CFG_CLK_DIV_SHIFT@GOTPAGE
Lloh56:
	ldr	x10, [x10, _AML_USB_PHY_CFG_CLK_DIV_SHIFT@GOTPAGEOFF]
Lloh57:
	ldr	w10, [x10]
	mov	w11, #1
	lsl	w10, w11, w10
	and	w8, w10, w8
Lloh58:
	adrp	x10, _AML_USB_PHY_CFG_CLK_EN@GOTPAGE
Lloh59:
	ldr	x10, [x10, _AML_USB_PHY_CFG_CLK_EN@GOTPAGEOFF]
Lloh60:
	ldr	w10, [x10]
	orr	w9, w9, w10
	orr	w21, w9, w8
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w8, w21
	orr	w21, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	bic	w21, w21, w8
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w8, w8, w21
	orr	w21, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w8, w9, w8
	bic	w21, w21, w8
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w8, w21
	orr	w21, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	bic	w21, w21, w8
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
Lloh61:
	adrp	x23, _AML_USB_PHY_CFG_A_POR@GOTPAGE
Lloh62:
	ldr	x23, [x23, _AML_USB_PHY_CFG_A_POR@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh63:
	adrp	x24, _AML_USB_PHY_CFG_B_POR@GOTPAGE
Lloh64:
	ldr	x24, [x24, _AML_USB_PHY_CFG_B_POR@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w8, w21
	orr	w21, w8, w9
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, x21
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	bic	w2, w21, w8
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_WRITE_4
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #200
	bl	_DELAY
	ldr	w1, [x22]
	mov	x0, x19
	bl	_CSR_READ_4
Lloh65:
	adrp	x8, _AML_USB_PHY_CFG_CLK_DETECTED@GOTPAGE
Lloh66:
	ldr	x8, [x8, _AML_USB_PHY_CFG_CLK_DETECTED@GOTPAGEOFF]
Lloh67:
	ldr	w8, [x8]
	bics	wzr, w8, w0
	b.eq	LBB0_20
; %bb.19:
Lloh68:
	adrp	x1, l_.str.8@PAGE
Lloh69:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_20:
Lloh70:
	adrp	x20, _AML_USB_PHY_MISC_A_REG@GOTPAGE
Lloh71:
	ldr	x20, [x20, _AML_USB_PHY_MISC_A_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_READ_4
Lloh72:
	adrp	x21, _AML_USB_PHY_MISC_ID_OVERIDE_EN@GOTPAGE
Lloh73:
	ldr	x21, [x21, _AML_USB_PHY_MISC_ID_OVERIDE_EN@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh74:
	adrp	x22, _AML_USB_PHY_MISC_ID_OVERIDE_DEVICE@GOTPAGE
Lloh75:
	ldr	x22, [x22, _AML_USB_PHY_MISC_ID_OVERIDE_DEVICE@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w8, w9, w8
Lloh76:
	adrp	x23, _AML_USB_PHY_MISC_ID_OVERIDE_HOST@GOTPAGE
Lloh77:
	ldr	x23, [x23, _AML_USB_PHY_MISC_ID_OVERIDE_HOST@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w8, w9
	bic	w8, w0, w8
	ldr	w9, [sp, #4]
	orr	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_WRITE_4
Lloh78:
	adrp	x20, _AML_USB_PHY_MISC_B_REG@GOTPAGE
Lloh79:
	ldr	x20, [x20, _AML_USB_PHY_MISC_B_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_READ_4
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
	ldr	w9, [x23]
	orr	w8, w8, w9
	bic	w8, w0, w8
	ldr	w9, [sp]
	orr	w2, w8, w9
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_WRITE_4
	ldr	w1, [x20]
	mov	x0, x19
	bl	_CSR_BARRIER
	mov	w0, #0
	b	LBB0_8
LBB0_21:
	ldr	x0, [sp, #8]
	bl	_OF_prop_free
Lloh80:
	adrp	x21, l_.str.6@PAGE
Lloh81:
	add	x21, x21, l_.str.6@PAGEOFF
LBB0_22:
	mov	x0, x20
	mov	x1, x21
	bl	_device_printf
	ldr	w23, [x19]
	cbz	w23, LBB0_25
; %bb.23:
	sxtw	x8, w23
	add	x8, x8, x8, lsl #1
	lsl	x26, x8, #3
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x26
	ldp	x22, x21, [x8, #-16]
	ldur	x0, [x8, #-24]
	bl	_PIN_OFF_FLAG
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_GPIO_PIN_SET
	sub	x26, x26, #24
	sub	w23, w23, #1
	cbnz	w23, LBB0_24
LBB0_25:
	ldr	x0, [x19, #8]
	ldr	w1, [x25]
	bl	_free
	str	xzr, [x19, #8]
	ldr	w1, [x24]
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_bus_release_resources
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGot	Lloh63, Lloh64
	.loh AdrpLdrGot	Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpLdrGot	Lloh78, Lloh79
	.loh AdrpLdrGot	Lloh76, Lloh77
	.loh AdrpLdrGot	Lloh74, Lloh75
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpAdd	Lloh80, Lloh81
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/soc/usb@c9040000"

l_.str.1:                               ; @.str.1
	.asciz	"missing usb@c9040000 node in FDT\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"/soc/usb@c90c0000"

l_.str.3:                               ; @.str.3
	.asciz	"missing usb@c90c0000 node in FDT\n"

	.comm	_aml8726_usb_phy_spec,4,2       ; @aml8726_usb_phy_spec
l_.str.4:                               ; @.str.4
	.asciz	"can not allocate resources for device\n"

l_.str.5:                               ; @.str.5
	.asciz	"usb-pwr-en"

	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
l_.str.6:                               ; @.str.6
	.asciz	"unable to parse gpio\n"

	.comm	_GPIO_PIN_OUTPUT,4,2            ; @GPIO_PIN_OUTPUT
l_.str.7:                               ; @.str.7
	.asciz	"could not use gpio to control power\n"

	.comm	_AML_USB_PHY_CFG_REG,4,2        ; @AML_USB_PHY_CFG_REG
	.comm	_AML_USB_PHY_CFG_CLK_DIV_MASK,4,2 ; @AML_USB_PHY_CFG_CLK_DIV_MASK
	.comm	_AML_USB_PHY_CFG_CLK_SEL_MASK,4,2 ; @AML_USB_PHY_CFG_CLK_SEL_MASK
	.comm	_AML_USB_PHY_CFG_A_RST,4,2      ; @AML_USB_PHY_CFG_A_RST
	.comm	_AML_USB_PHY_CFG_B_RST,4,2      ; @AML_USB_PHY_CFG_B_RST
	.comm	_AML_USB_PHY_CFG_A_PLL_RST,4,2  ; @AML_USB_PHY_CFG_A_PLL_RST
	.comm	_AML_USB_PHY_CFG_B_PLL_RST,4,2  ; @AML_USB_PHY_CFG_B_PLL_RST
	.comm	_AML_USB_PHY_CFG_A_PHYS_RST,4,2 ; @AML_USB_PHY_CFG_A_PHYS_RST
	.comm	_AML_USB_PHY_CFG_B_PHYS_RST,4,2 ; @AML_USB_PHY_CFG_B_PHYS_RST
	.comm	_AML_USB_PHY_CFG_A_POR,4,2      ; @AML_USB_PHY_CFG_A_POR
	.comm	_AML_USB_PHY_CFG_B_POR,4,2      ; @AML_USB_PHY_CFG_B_POR
	.comm	_AML_USB_PHY_CFG_CLK_SEL_XTAL,4,2 ; @AML_USB_PHY_CFG_CLK_SEL_XTAL
	.comm	_AML_USB_PHY_CFG_CLK_DIV_SHIFT,4,2 ; @AML_USB_PHY_CFG_CLK_DIV_SHIFT
	.comm	_AML_USB_PHY_CFG_CLK_EN,4,2     ; @AML_USB_PHY_CFG_CLK_EN
	.comm	_AML_USB_PHY_CFG_CLK_DETECTED,4,2 ; @AML_USB_PHY_CFG_CLK_DETECTED
l_.str.8:                               ; @.str.8
	.asciz	"PHY Clock not detected\n"

	.comm	_AML_USB_PHY_MISC_A_REG,4,2     ; @AML_USB_PHY_MISC_A_REG
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_EN,4,2 ; @AML_USB_PHY_MISC_ID_OVERIDE_EN
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_DEVICE,4,2 ; @AML_USB_PHY_MISC_ID_OVERIDE_DEVICE
	.comm	_AML_USB_PHY_MISC_ID_OVERIDE_HOST,4,2 ; @AML_USB_PHY_MISC_ID_OVERIDE_HOST
	.comm	_AML_USB_PHY_MISC_B_REG,4,2     ; @AML_USB_PHY_MISC_B_REG
	.no_dead_strip	_aml8726_usb_phy_attach
.subsections_via_symbols
