	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atapi_eh_clear_ua
_atapi_eh_clear_ua:                     ## @atapi_eh_clear_ua
	.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, %r15
	movq	_ATA_EH_UA_TRIES@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_11
## %bb.1:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	(%rax), %r13
	movq	$0, -48(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_atapi_eh_tur
	movl	%eax, %ecx
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jne	LBB0_4
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdx
	movq	_UNIT_ATTENTION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_atapi_eh_request_sense
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	(%r12), %ecx
	cmpl	%ecx, %ebx
	jl	LBB0_2
LBB0_11:
	movq	_KERN_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	callq	_ata_dev_printk
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_4:
	movq	_KERN_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	jmp	LBB0_9
LBB0_8:
	movq	_KERN_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r15, %rdi
	movl	%eax, %ecx
LBB0_9:
	callq	_ata_dev_printk
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_EH_UA_TRIES,4,2            ## @ATA_EH_UA_TRIES
	.comm	_AC_ERR_DEV,4,2                 ## @AC_ERR_DEV
	.comm	_KERN_WARNING,4,2               ## @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TEST_UNIT_READY failed (err_mask=0x%x)\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_UNIT_ATTENTION,8,3             ## @UNIT_ATTENTION
L_.str.1:                               ## @.str.1
	.asciz	"failed to clear UNIT ATTENTION (err_mask=0x%x)\n"

L_.str.2:                               ## @.str.2
	.asciz	"UNIT ATTENTION persists after %d tries\n"

	.no_dead_strip	_atapi_eh_clear_ua
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atapi_eh_clear_ua
_atapi_eh_clear_ua:                     ; @atapi_eh_clear_ua
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x21, _ATA_EH_UA_TRIES@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ATA_EH_UA_TRIES@GOTPAGEOFF]
	ldr	w3, [x21]
	cmp	w3, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w22, #0
Lloh2:
	adrp	x23, _AC_ERR_DEV@GOTPAGE
Lloh3:
	ldr	x23, [x23, _AC_ERR_DEV@GOTPAGEOFF]
Lloh4:
	adrp	x24, _UNIT_ATTENTION@GOTPAGE
Lloh5:
	ldr	x24, [x24, _UNIT_ATTENTION@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x20, [x8]
	str	xzr, [sp, #8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_atapi_eh_tur
	mov	x3, x0
	cbz	w0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x23]
	cmp	w3, w8
	b.ne	LBB0_10
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	w3, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x2, [sp, #8]
	ldr	x8, [x24]
	cmp	x2, x8
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_atapi_eh_request_sense
	cbnz	w0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w22, w22, #1
	ldr	w3, [x21]
	cmp	w22, w3
	b.lt	LBB0_2
LBB0_8:
Lloh6:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
LBB0_9:
	mov	w0, #0
	b	LBB0_13
LBB0_10:
Lloh11:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_11:
	mov	x3, x0
Lloh16:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_ata_dev_printk
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_EH_UA_TRIES,4,2            ; @ATA_EH_UA_TRIES
	.comm	_AC_ERR_DEV,4,2                 ; @AC_ERR_DEV
	.comm	_KERN_WARNING,4,2               ; @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TEST_UNIT_READY failed (err_mask=0x%x)\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_UNIT_ATTENTION,8,3             ; @UNIT_ATTENTION
l_.str.1:                               ; @.str.1
	.asciz	"failed to clear UNIT ATTENTION (err_mask=0x%x)\n"

l_.str.2:                               ; @.str.2
	.asciz	"UNIT ATTENTION persists after %d tries\n"

	.no_dead_strip	_atapi_eh_clear_ua
.subsections_via_symbols
