	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_eh_analyze_ncq_error       ## -- Begin function ata_eh_analyze_ncq_error
	.p2align	4, 0x90
_ata_eh_analyze_ncq_error:              ## @ata_eh_analyze_ncq_error
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rdi), %rbx
	movq	_ATA_PFLAG_FROZEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_1
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r14
	cmpl	$0, (%rdi)
	je	LBB0_13
## %bb.2:
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r14)
	je	LBB0_13
## %bb.3:
	movq	8(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)
	movq	_ATA_MAX_QUEUE@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_8
## %bb.4:
	movl	$1, %r15d
	movq	_ATA_QCFLAG_FAILED@GOTPCREL(%rip), %r13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, -44(%rbp)
	leal	1(%r15), %eax
	cmpl	(%r12), %r15d
	movl	%eax, %r15d
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%r15), %esi
	movq	%rbx, %rdi
	callq	___ata_qc_from_tag
	movl	(%r13), %ecx
	testl	%ecx, (%rax)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, 4(%rax)
	je	LBB0_7
	jmp	LBB0_13
LBB0_8:
	leaq	-48(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	-44(%rbp), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_ata_eh_read_log_10h
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movq	_KERN_ERR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_ata_link_printk
	jmp	LBB0_13
LBB0_10:
	movl	(%r14), %eax
	movl	-44(%rbp), %ecx
	btl	%ecx, %eax
	jae	LBB0_11
## %bb.12:
	movq	%rbx, %rdi
	movl	%ecx, %esi
	callq	___ata_qc_from_tag
	movq	%rax, %rbx
	leaq	8(%rax), %rdi
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	_ATA_TFLAG_ISADDR@GOTPCREL(%rip), %rax
	movq	_ATA_TFLAG_LBA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AC_ERR_NCQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	orl	%ecx, 4(%rbx)
	notl	%eax
	andl	%eax, 16(%r14)
	jmp	LBB0_13
LBB0_11:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	callq	_ata_link_printk
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_PFLAG_FROZEN,4,2           ## @ATA_PFLAG_FROZEN
	.comm	_AC_ERR_DEV,4,2                 ## @AC_ERR_DEV
	.comm	_ATA_MAX_QUEUE,4,2              ## @ATA_MAX_QUEUE
	.comm	_ATA_QCFLAG_FAILED,4,2          ## @ATA_QCFLAG_FAILED
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read log page 10h (errno=%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"log page 10h reported inactive tag %d\n"

	.comm	_ATA_TFLAG_ISADDR,4,2           ## @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_LBA,4,2              ## @ATA_TFLAG_LBA
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_AC_ERR_NCQ,4,2                 ## @AC_ERR_NCQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_eh_analyze_ncq_error       ; -- Begin function ata_eh_analyze_ncq_error
	.p2align	2
_ata_eh_analyze_ncq_error:              ; @ata_eh_analyze_ncq_error
	.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
	ldr	x20, [x0, #24]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _ATA_PFLAG_FROZEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_PFLAG_FROZEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
LBB0_1:
	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_2:
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_1
; %bb.3:
	ldr	w8, [x19, #16]
Lloh3:
	adrp	x22, _AC_ERR_DEV@GOTPAGE
Lloh4:
	ldr	x22, [x22, _AC_ERR_DEV@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.4:
	ldr	x21, [x19, #8]
	str	wzr, [sp, #4]
Lloh5:
	adrp	x23, _ATA_MAX_QUEUE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _ATA_MAX_QUEUE@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.5:
	mov	w24, #1
Lloh7:
	adrp	x25, _ATA_QCFLAG_FAILED@GOTPAGE
Lloh8:
	ldr	x25, [x25, _ATA_QCFLAG_FAILED@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	str	w24, [sp, #4]
	ldr	w8, [x23]
	add	w9, w24, #1
	cmp	w24, w8
	mov	x24, x9
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w1, w24, #1
	mov	x0, x20
	bl	___ata_qc_from_tag
	ldr	w8, [x0]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_6
	b	LBB0_1
LBB0_9:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x1, sp, #4
	add	x2, sp, #8
	mov	x0, x21
	bl	_ata_eh_read_log_10h
	cbz	w0, LBB0_11
; %bb.10:
	mov	x3, x0
Lloh9:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ata_link_printk
	b	LBB0_1
LBB0_11:
	ldr	w8, [x19]
	ldr	w3, [sp, #4]
	lsr	w8, w8, w3
	tbz	w8, #0, LBB0_13
; %bb.12:
	mov	x0, x20
	mov	x1, x3
	bl	___ata_qc_from_tag
	mov	x20, x0
	add	x0, x0, #8
	add	x1, sp, #8
	mov	w2, #4
	bl	_memcpy
Lloh14:
	adrp	x8, _ATA_TFLAG_ISADDR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATA_TFLAG_ISADDR@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _ATA_TFLAG_LBA@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATA_TFLAG_LBA@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh20:
	adrp	x9, _ATA_TFLAG_LBA48@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x22]
Lloh23:
	adrp	x10, _AC_ERR_NCQ@GOTPAGE
Lloh24:
	ldr	x10, [x10, _AC_ERR_NCQ@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	orr	w10, w10, w9
	ldr	w11, [x20, #4]
	orr	w10, w10, w11
	stp	w10, w8, [x20, #4]
	ldr	w8, [x19, #16]
	bic	w8, w8, w9
	str	w8, [x19, #16]
	b	LBB0_1
LBB0_13:
Lloh26:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str.1@PAGE
Lloh30:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_ata_link_printk
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_PFLAG_FROZEN,4,2           ; @ATA_PFLAG_FROZEN
	.comm	_AC_ERR_DEV,4,2                 ; @AC_ERR_DEV
	.comm	_ATA_MAX_QUEUE,4,2              ; @ATA_MAX_QUEUE
	.comm	_ATA_QCFLAG_FAILED,4,2          ; @ATA_QCFLAG_FAILED
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read log page 10h (errno=%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"log page 10h reported inactive tag %d\n"

	.comm	_ATA_TFLAG_ISADDR,4,2           ; @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_LBA,4,2              ; @ATA_TFLAG_LBA
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_AC_ERR_NCQ,4,2                 ; @AC_ERR_NCQ
.subsections_via_symbols
