	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sata_link_hardreset            ## -- Begin function sata_link_hardreset
	.p2align	4, 0x90
_sata_link_hardreset:                   ## @sata_link_hardreset
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINTK
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movl	$0, (%r14)
LBB0_2:
	movq	%r15, %rdi
	callq	_sata_set_spd_needed
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	_SCR_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_sata_scr_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.4:
	movl	$240, %edx
	andl	-44(%rbp), %edx
	orl	$772, %edx                      ## imm = 0x304
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_sata_scr_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.5:
	movq	%r15, %rdi
	callq	_sata_set_spd
LBB0_6:
	movq	_SCR_CONTROL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_sata_scr_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.7:
	movl	$240, %edx
	andl	-44(%rbp), %edx
	orl	$769, %edx                      ## imm = 0x301
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_sata_scr_write_flush
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.8:
	movl	(%r15), %edi
	movl	$1, %esi
	callq	_ata_msleep
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_sata_link_resume
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_20:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_24
## %bb.21:
	testq	%r14, %r14
	je	LBB0_23
## %bb.22:
	movl	$0, (%r14)
LBB0_23:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_ata_link_printk
LBB0_24:
	movl	%ebx, %r13d
LBB0_25:
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_DPRINTK
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_ata_phys_link_offline
	xorl	%r13d, %r13d
	testq	%rax, %rax
	jne	LBB0_25
## %bb.10:
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:
	movl	$1, (%r14)
LBB0_12:
	movl	(%r15), %edi
	callq	_sata_pmp_supported
	testq	%rax, %rax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_17
## %bb.13:
	movq	%r15, %rdi
	callq	_ata_is_host_link
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.15:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ATA_TMOUT_PMP_SRST_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ata_deadline
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_time_after
	testq	%rax, %rax
	cmoveq	-64(%rbp), %r12                 ## 8-byte Folded Reload
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_ata_wait_ready
LBB0_16:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_17:
	testq	%rbx, %rbx
	je	LBB0_25
## %bb.18:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_ata_wait_ready
	movl	%eax, %ebx
LBB0_19:
	testl	%ebx, %ebx
	jne	LBB0_20
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENTER\n"

	.comm	_SCR_CONTROL,4,2                ## @SCR_CONTROL
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_ATA_TMOUT_PMP_SRST_WAIT,4,2    ## @ATA_TMOUT_PMP_SRST_WAIT
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
L_.str.1:                               ## @.str.1
	.asciz	"COMRESET failed (errno=%d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"EXIT, rc=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sata_link_hardreset            ; -- Begin function sata_link_hardreset
	.p2align	2
_sata_link_hardreset:                   ; @sata_link_hardreset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x21, x4
	mov	x20, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINTK
	cbz	x20, LBB0_2
; %bb.1:
	str	wzr, [x20]
LBB0_2:
	mov	x0, x19
	bl	_sata_set_spd_needed
Lloh2:
	adrp	x25, _SCR_CONTROL@GOTPAGE
Lloh3:
	ldr	x25, [x25, _SCR_CONTROL@GOTPAGEOFF]
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w1, [x25]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sata_scr_read
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.4:
	ldr	w8, [sp, #12]
	and	w8, w8, #0xf0
	mov	w9, #772
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_sata_scr_write
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.5:
	mov	x0, x19
	bl	_sata_set_spd
LBB0_6:
	ldr	w1, [x25]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sata_scr_read
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	w8, [sp, #12]
	and	w8, w8, #0xf0
	mov	w9, #769
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_sata_scr_write_flush
	mov	x24, x0
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	w0, [x19]
	mov	w1, #1
	bl	_ata_msleep
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_sata_link_resume
	mov	x24, x0
	cbz	w0, LBB0_14
LBB0_9:
Lloh4:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmn	w24, w8
	b.eq	LBB0_13
; %bb.10:
	cbz	x20, LBB0_12
; %bb.11:
	str	wzr, [x20]
LBB0_12:
Lloh7:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x24
	bl	_ata_link_printk
LBB0_13:
	str	x24, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DPRINTK
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	mov	x0, x19
	bl	_ata_phys_link_offline
	cbz	x0, LBB0_16
LBB0_15:
	mov	w24, #0
	b	LBB0_13
LBB0_16:
	cbz	x20, LBB0_18
; %bb.17:
	mov	w8, #1
	str	w8, [x20]
LBB0_18:
	ldr	w0, [x19]
	bl	_sata_pmp_supported
	cbz	x0, LBB0_23
; %bb.19:
	mov	x0, x19
	bl	_ata_is_host_link
	cbz	x0, LBB0_23
; %bb.20:
	cbz	x21, LBB0_22
; %bb.21:
Lloh14:
	adrp	x8, _jiffies@GOTPAGE
Lloh15:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _ATA_TMOUT_PMP_SRST_WAIT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ATA_TMOUT_PMP_SRST_WAIT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_ata_deadline
	mov	x23, x0
	mov	x1, x22
	bl	_time_after
	cmp	x0, #0
	csel	x1, x23, x22, eq
	mov	x0, x19
	mov	x2, x21
	bl	_ata_wait_ready
LBB0_22:
Lloh20:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_25
LBB0_23:
	cbz	x21, LBB0_15
; %bb.24:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_ata_wait_ready
	mov	x24, x0
LBB0_25:
	cbnz	w24, LBB0_9
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENTER\n"

	.comm	_SCR_CONTROL,4,2                ; @SCR_CONTROL
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_ATA_TMOUT_PMP_SRST_WAIT,4,2    ; @ATA_TMOUT_PMP_SRST_WAIT
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
l_.str.1:                               ; @.str.1
	.asciz	"COMRESET failed (errno=%d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"EXIT, rc=%d\n"

.subsections_via_symbols
