	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_sff_error_handler          ## -- Begin function ata_sff_error_handler
	.p2align	4, 0x90
_ata_sff_error_handler:                 ## @ata_sff_error_handler
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	48(%rax), %r14
	movq	56(%rax), %r15
	movl	8(%rdi), %esi
	callq	___ata_qc_from_tag
	xorl	%r13d, %r13d
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_ATA_QCFLAG_FAILED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r12d, %r12d
	testl	%ecx, (%rax)
	cmovneq	%rax, %r12
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	movl	32(%rbx), %edi
	callq	_spin_lock_irqsave
	cmpq	$0, 24(%rbx)
	je	LBB0_11
## %bb.4:
	testq	%r12, %r12
	je	LBB0_11
## %bb.5:
	movq	16(%r12), %rax
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_ATAPI_PROT_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
LBB0_7:
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movq	8(%r12), %rcx
	movq	_AC_ERR_TIMEOUT@GOTPCREL(%rip), %rdx
	xorl	%r13d, %r13d
	cmpq	(%rdx), %rcx
	jne	LBB0_10
## %bb.8:
	movq	_ATA_DMA_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:
	movq	_AC_ERR_HOST_BUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r12)
	movl	$1, %r13d
LBB0_10:
	movq	(%rbx), %rax
	movq	%r12, %rdi
	callq	*40(%rax)
LBB0_11:
	movq	%rbx, %rdi
	callq	_ata_sff_sync
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*32(%rax)
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	callq	*24(%rax)
	movq	(%rbx), %rax
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%r12, %rdi
	callq	*%rax
LBB0_13:
	movl	32(%rbx), %edi
	callq	_spin_unlock_irqrestore
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	callq	_ata_eh_thaw_port
LBB0_15:
	movq	_ata_sff_softreset@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jne	LBB0_17
## %bb.16:
	xorl	%eax, %eax
	cmpl	$0, 16(%rbx)
	cmoveq	%rax, %r15
LBB0_17:
	movq	%r14, %rdi
	callq	_ata_is_builtin_hardreset
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	leaq	8(%rbx), %rdi
	callq	_sata_scr_valid
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmoveq	%rcx, %r14
LBB0_19:
	movq	(%rbx), %rax
	movl	8(%rax), %r8d
	movl	12(%rax), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	movq	%r14, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ata_do_eh                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_QCFLAG_FAILED,4,2          ## @ATA_QCFLAG_FAILED
	.comm	_ATA_PROT_DMA,8,3               ## @ATA_PROT_DMA
	.comm	_ATAPI_PROT_DMA,8,3             ## @ATAPI_PROT_DMA
	.comm	_AC_ERR_TIMEOUT,8,3             ## @AC_ERR_TIMEOUT
	.comm	_ATA_DMA_ERR,4,2                ## @ATA_DMA_ERR
	.comm	_AC_ERR_HOST_BUS,8,3            ## @AC_ERR_HOST_BUS
	.comm	_ata_sff_softreset,8,3          ## @ata_sff_softreset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_sff_error_handler          ; -- Begin function ata_sff_error_handler
	.p2align	2
_ata_sff_error_handler:                 ; @ata_sff_error_handler
	.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
	ldr	x8, [x0]
	ldp	x21, x20, [x8, #48]
	mov	x22, x0
	ldr	w1, [x22, #8]!
	bl	___ata_qc_from_tag
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _ATA_QCFLAG_FAILED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_QCFLAG_FAILED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x23, xzr, x0, eq
	b	LBB0_3
LBB0_2:
	mov	x23, #0
LBB0_3:
	ldr	w0, [x19, #32]
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #24]
	cmp	x8, #0
	ccmp	x23, #0, #4, ne
	b.eq	LBB0_8
; %bb.4:
	ldr	x8, [x23, #16]
Lloh3:
	adrp	x9, _ATA_PROT_DMA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _ATAPI_PROT_DMA@GOTPAGE
Lloh7:
	ldr	x10, [x10, _ATAPI_PROT_DMA@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_8
; %bb.5:
	ldr	x8, [x19]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x23, #8]
Lloh9:
	adrp	x9, _AC_ERR_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AC_ERR_TIMEOUT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
Lloh12:
	adrp	x8, _ATA_DMA_ERR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATA_DMA_ERR@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.7:
Lloh15:
	adrp	x8, _AC_ERR_HOST_BUS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AC_ERR_HOST_BUS@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x23, #8]
	mov	w24, #1
	b	LBB0_10
LBB0_8:
	mov	w24, #0
	b	LBB0_11
LBB0_9:
	mov	w24, #0
LBB0_10:
	ldr	x8, [x19]
	ldr	x8, [x8, #40]
	mov	x0, x23
	blr	x8
LBB0_11:
	mov	x0, x19
	bl	_ata_sff_sync
	ldr	x8, [x19]
	ldr	x8, [x8, #32]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19]
	ldr	x8, [x8, #24]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x23
	blr	x8
LBB0_13:
	ldr	w0, [x19, #32]
	bl	_spin_unlock_irqrestore
	cbz	w24, LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_ata_eh_thaw_port
LBB0_15:
Lloh18:
	adrp	x8, _ata_sff_softreset@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ata_sff_softreset@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_17
; %bb.16:
	ldr	w8, [x19, #16]
	cmp	w8, #0
	csel	x20, xzr, x20, eq
LBB0_17:
	mov	x0, x21
	bl	_ata_is_builtin_hardreset
	cbz	x0, LBB0_19
; %bb.18:
	mov	x0, x22
	bl	_sata_scr_valid
	cmp	w0, #0
	csel	x21, xzr, x21, eq
LBB0_19:
	ldr	x8, [x19]
	ldp	w4, w1, [x8, #8]
	mov	x0, x19
	mov	x2, x20
	mov	x3, x21
	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
	b	_ata_do_eh
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_QCFLAG_FAILED,4,2          ; @ATA_QCFLAG_FAILED
	.comm	_ATA_PROT_DMA,8,3               ; @ATA_PROT_DMA
	.comm	_ATAPI_PROT_DMA,8,3             ; @ATAPI_PROT_DMA
	.comm	_AC_ERR_TIMEOUT,8,3             ; @AC_ERR_TIMEOUT
	.comm	_ATA_DMA_ERR,4,2                ; @ATA_DMA_ERR
	.comm	_AC_ERR_HOST_BUS,8,3            ; @AC_ERR_HOST_BUS
	.comm	_ata_sff_softreset,8,3          ; @ata_sff_softreset
.subsections_via_symbols
