	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx6_ahci_phy_ctrl
_imx6_ahci_phy_ctrl:                    ## @imx6_ahci_phy_ctrl
	.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	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	(%rdi), %edi
	movq	_SATA_P0PHYCR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_ATA_INL
	movl	%eax, %ecx
	orl	%r15d, %ecx
	notl	%r15d
	andl	%eax, %r15d
	testl	%r14d, %r14d
	cmovnel	%ecx, %r15d
	movl	(%r12), %edi
	movl	(%rbx), %esi
	movl	%r15d, %edx
	callq	_ATA_OUTL
	movl	$5001, %ebx                     ## imm = 0x1389
	movq	_SATA_P0PHYSR@GOTPCREL(%rip), %r15
	movq	_SATA_P0PHYSR_CR_ACK@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movl	(%r15), %esi
	callq	_ATA_INL
	notl	%eax
	xorl	%ecx, %ecx
	testl	%eax, (%r13)
	sete	%cl
	cmpl	%r14d, %ecx
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$100, %edi
	callq	_DELAY
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_1
## %bb.4:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_5
LBB0_2:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SATA_P0PHYCR,4,2               ## @SATA_P0PHYCR
	.comm	_SATA_P0PHYSR,4,2               ## @SATA_P0PHYSR
	.comm	_SATA_P0PHYSR_CR_ACK,4,2        ## @SATA_P0PHYSR_CR_ACK
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_imx6_ahci_phy_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx6_ahci_phy_ctrl
_imx6_ahci_phy_ctrl:                    ; @imx6_ahci_phy_ctrl
	.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, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x22, _SATA_P0PHYCR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SATA_P0PHYCR@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_ATA_INL
	orr	w8, w0, w21
	bic	w9, w0, w21
	cmp	w19, #0
	csel	w2, w9, w8, eq
	ldr	w0, [x20]
	ldr	w1, [x22]
	bl	_ATA_OUTL
	mov	w21, #5001
Lloh2:
	adrp	x22, _SATA_P0PHYSR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SATA_P0PHYSR@GOTPAGEOFF]
Lloh4:
	adrp	x23, _SATA_P0PHYSR_CR_ACK@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SATA_P0PHYSR_CR_ACK@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	ldr	w1, [x22]
	bl	_ATA_INL
	ldr	w8, [x23]
	bics	wzr, w8, w0
	cset	w8, eq
	cmp	w8, w19
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #100
	bl	_DELAY
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_1
; %bb.3:
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SATA_P0PHYCR,4,2               ; @SATA_P0PHYCR
	.comm	_SATA_P0PHYSR,4,2               ; @SATA_P0PHYSR
	.comm	_SATA_P0PHYSR_CR_ACK,4,2        ; @SATA_P0PHYSR_CR_ACK
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_imx6_ahci_phy_ctrl
.subsections_via_symbols
