	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aml8726_usb_phy_detach
_aml8726_usb_phy_detach:                ## @aml8726_usb_phy_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	%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, -44(%rbp)                 ## 4-byte Spill
	callq	_device_get_softc
	movq	%rax, %r15
	movq	_AML_USB_PHY_CTRL_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%rax, %rdi
	callq	_CSR_READ_4
	movq	_AML_USB_PHY_CTRL_POR@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_CSR_WRITE_4
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_CSR_BARRIER
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	leaq	(%rbx,%rbx,2), %rax
	leaq	-4(,%rax,4), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%r14), %r12d
	movl	-8(%rax,%r14), %edi
	movl	-4(%rax,%r14), %r13d
	callq	_PIN_OFF_FLAG
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_GPIO_PIN_SET
	addq	$-12, %r14
	decq	%rbx
	jne	LBB0_2
LBB0_3:
	movq	16(%r15), %rdi
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_free
	movq	$0, 16(%r15)
	movq	_aml8726_usb_phy_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_bus_release_resources
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AML_USB_PHY_CTRL_REG,4,2       ## @AML_USB_PHY_CTRL_REG
	.comm	_AML_USB_PHY_CTRL_POR,8,3       ## @AML_USB_PHY_CTRL_POR
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_aml8726_usb_phy_spec,4,2       ## @aml8726_usb_phy_spec
	.no_dead_strip	_aml8726_usb_phy_detach
.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_detach
_aml8726_usb_phy_detach:                ; @aml8726_usb_phy_detach
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
Lloh0:
	adrp	x21, _AML_USB_PHY_CTRL_REG@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AML_USB_PHY_CTRL_REG@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_CSR_READ_4
Lloh2:
	adrp	x8, _AML_USB_PHY_CTRL_POR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AML_USB_PHY_CTRL_POR@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	orr	x2, x8, x0
	ldr	w1, [x21]
	mov	x0, x20
	bl	_CSR_WRITE_4
	ldr	w1, [x21]
	mov	x0, x20
	bl	_CSR_BARRIER
	ldr	x23, [x20]
	cbz	x23, LBB0_3
; %bb.1:
	add	x8, x23, x23, lsl #1
	lsl	x24, x8, #2
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	x23, x23, #1
	ldr	x8, [x20, #16]
	add	x8, x8, x24
	ldp	w22, w21, [x8, #-8]
	ldur	w0, [x8, #-12]
	bl	_PIN_OFF_FLAG
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	bl	_GPIO_PIN_SET
	sub	x24, x24, #12
	cbnz	x23, LBB0_2
LBB0_3:
	ldr	x0, [x20, #16]
Lloh5:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_free
	str	xzr, [x20, #16]
Lloh8:
	adrp	x8, _aml8726_usb_phy_spec@GOTPAGE
Lloh9:
	ldr	x8, [x8, _aml8726_usb_phy_spec@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_bus_release_resources
	mov	w0, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AML_USB_PHY_CTRL_REG,4,2       ; @AML_USB_PHY_CTRL_REG
	.comm	_AML_USB_PHY_CTRL_POR,8,3       ; @AML_USB_PHY_CTRL_POR
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_aml8726_usb_phy_spec,4,2       ; @aml8726_usb_phy_spec
	.no_dead_strip	_aml8726_usb_phy_detach
.subsections_via_symbols
