	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function phy_reset
_phy_reset:                             ## @phy_reset
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SATA_STD_ASYNC_REGS_OFF@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	$96, %ecx
	subl	%eax, %ecx
	movl	$99, %esi
	subl	%eax, %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	movl	%edi, %r15d
	sarl	$2, %esi
	movq	_LOS_AND_TX_LVL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_scr_write
	movl	(%rbx), %eax
	movl	$112, %ecx
	subl	%eax, %ecx
	movl	$115, %esi
	subl	%eax, %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	sarl	$2, %esi
	movq	_TX_ATTEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_scr_write
	movq	_SATA_SCR_CONTROL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%r15d, %edi
	movl	$785, %edx                      ## imm = 0x311
	callq	_scr_write
	movq	_SATA_SCR_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_scr_read
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_udelay
	movl	(%rbx), %esi
	movl	%r15d, %edi
	movl	$784, %edx                      ## imm = 0x310
	callq	_scr_write
	xorl	%ebx, %ebx
	movq	_PHY_LOOP_COUNT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	$200000, %edi                   ## imm = 0x30D40
	callq	_udelay
	movl	(%r14), %esi
	movl	%r15d, %edi
	callq	_scr_read
	andl	$15, %eax
	cmpl	$3, %eax
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_1
## %bb.3:
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_4:
	movq	_SATA_SCR_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	movl	$-1, %edx
	callq	_scr_write
	movl	$500000, %edi                   ## imm = 0x7A120
	callq	_udelay
	movl	$1, %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SATA_STD_ASYNC_REGS_OFF,4,2    ## @SATA_STD_ASYNC_REGS_OFF
	.comm	_LOS_AND_TX_LVL,4,2             ## @LOS_AND_TX_LVL
	.comm	_TX_ATTEN,4,2                   ## @TX_ATTEN
	.comm	_SATA_SCR_CONTROL,4,2           ## @SATA_SCR_CONTROL
	.comm	_SATA_SCR_STATUS,4,2            ## @SATA_SCR_STATUS
	.comm	_SATA_SCR_ERROR,4,2             ## @SATA_SCR_ERROR
	.comm	_PHY_LOOP_COUNT,4,2             ## @PHY_LOOP_COUNT
	.no_dead_strip	_phy_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function phy_reset
_phy_reset:                             ; @phy_reset
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x20, _SATA_STD_ASYNC_REGS_OFF@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SATA_STD_ASYNC_REGS_OFF@GOTPAGEOFF]
	ldr	w8, [x20]
	mov	w9, #96
	sub	w9, w9, w8
	mov	w10, #99
	sub	w8, w10, w8
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w1, w8, #2
Lloh2:
	adrp	x8, _LOS_AND_TX_LVL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LOS_AND_TX_LVL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_scr_write
	ldr	w8, [x20]
	mov	w9, #112
	sub	w9, w9, w8
	mov	w10, #115
	sub	w8, w10, w8
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w1, w8, #2
Lloh5:
	adrp	x8, _TX_ATTEN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TX_ATTEN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_scr_write
Lloh8:
	adrp	x21, _SATA_SCR_CONTROL@GOTPAGE
Lloh9:
	ldr	x21, [x21, _SATA_SCR_CONTROL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #785
	bl	_scr_write
Lloh10:
	adrp	x20, _SATA_SCR_STATUS@GOTPAGE
Lloh11:
	ldr	x20, [x20, _SATA_SCR_STATUS@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_scr_read
	mov	w0, #1000
	bl	_udelay
	ldr	w1, [x21]
	mov	x0, x19
	mov	w2, #784
	bl	_scr_write
	mov	w21, #0
Lloh12:
	adrp	x22, _PHY_LOOP_COUNT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PHY_LOOP_COUNT@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #3392
	movk	w0, #3, lsl #16
	bl	_udelay
	ldr	w1, [x20]
	mov	x0, x19
	bl	_scr_read
	and	w8, w0, #0xf
	cmp	w8, #3
	b.eq	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w21, w21, #1
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_1
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh14:
	adrp	x8, _SATA_SCR_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SATA_SCR_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_scr_write
	mov	w0, #41248
	movk	w0, #7, lsl #16
	bl	_udelay
	mov	w0, #1
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SATA_STD_ASYNC_REGS_OFF,4,2    ; @SATA_STD_ASYNC_REGS_OFF
	.comm	_LOS_AND_TX_LVL,4,2             ; @LOS_AND_TX_LVL
	.comm	_TX_ATTEN,4,2                   ; @TX_ATTEN
	.comm	_SATA_SCR_CONTROL,4,2           ; @SATA_SCR_CONTROL
	.comm	_SATA_SCR_STATUS,4,2            ; @SATA_SCR_STATUS
	.comm	_SATA_SCR_ERROR,4,2             ; @SATA_SCR_ERROR
	.comm	_PHY_LOOP_COUNT,4,2             ; @PHY_LOOP_COUNT
	.no_dead_strip	_phy_reset
.subsections_via_symbols
