	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_gen_ata_sense
_ata_gen_ata_sense:                     ## @ata_gen_ata_sense
	.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	%rdi, %r15
	movq	32(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	24(%rdi), %r14
	movq	8(%rax), %rax
	xorl	%r12d, %r12d
	cmpq	$0, (%rax)
	movq	(%r14), %rbx
	sete	%r13b
	movq	_SCSI_SENSE_BUFFERSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_DRIVER_SENSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$24, %eax
	movq	_SAM_STAT_CHECK_CONDITION@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%r14)
	movb	$114, (%rbx)
	cmpq	$0, 16(%r15)
	movl	(%r15), %esi
	jne	LBB0_2
## %bb.1:
	movq	_ATA_BUSY@GOTPCREL(%rip), %rax
	movq	_ATA_DF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ATA_ERR@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ATA_DRQ@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%esi, %ecx
	je	LBB0_3
LBB0_2:
	movb	%r13b, %r12b
	movq	8(%r15), %rax
	movl	(%rax), %edi
	movl	4(%r15), %edx
	leaq	1(%rbx), %rcx
	leaq	2(%rbx), %r8
	leaq	3(%rbx), %r9
	movl	%r12d, (%rsp)
	callq	_ata_to_sense_error
	andb	$15, 1(%rbx)
LBB0_3:
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_ata_tf_read_block
	movw	$12, 7(%rbx)
	movb	$10, 9(%rbx)
	orb	$-128, 10(%rbx)
	movl	%eax, %ecx
	shrl	$24, %ecx
	movb	%cl, 16(%rbx)
	movl	%eax, %ecx
	shrl	$16, %ecx
	movb	%cl, 17(%rbx)
	movb	%ah, 18(%rbx)
	movb	%al, 19(%rbx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SCSI_SENSE_BUFFERSIZE,4,2      ## @SCSI_SENSE_BUFFERSIZE
	.comm	_DRIVER_SENSE,4,2               ## @DRIVER_SENSE
	.comm	_SAM_STAT_CHECK_CONDITION,4,2   ## @SAM_STAT_CHECK_CONDITION
	.comm	_ATA_BUSY,4,2                   ## @ATA_BUSY
	.comm	_ATA_DF,4,2                     ## @ATA_DF
	.comm	_ATA_ERR,4,2                    ## @ATA_ERR
	.comm	_ATA_DRQ,4,2                    ## @ATA_DRQ
	.no_dead_strip	_ata_gen_ata_sense
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_gen_ata_sense
_ata_gen_ata_sense:                     ; @ata_gen_ata_sense
	.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	x21, x0
	ldp	x23, x20, [x0, #24]
	ldr	x19, [x23]
	ldr	x8, [x0, #8]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w22, eq
Lloh0:
	adrp	x8, _SCSI_SENSE_BUFFERSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCSI_SENSE_BUFFERSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_memset
Lloh3:
	adrp	x8, _DRIVER_SENSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRIVER_SENSE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _SAM_STAT_CHECK_CONDITION@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SAM_STAT_CHECK_CONDITION@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8, lsl #24
	str	w8, [x23, #8]
	mov	w8, #114
	strb	w8, [x19]
	ldr	x8, [x21, #16]
	ldr	w1, [x21]
	cbnz	x8, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _ATA_BUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_BUSY@GOTPAGEOFF]
Lloh11:
	adrp	x9, _ATA_DF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_DF@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _ATA_ERR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATA_ERR@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _ATA_DRQ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_DRQ@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	tst	w8, w1
	b.eq	LBB0_3
LBB0_2:
	ldr	x8, [x21, #8]
	ldr	w0, [x8]
	ldr	w2, [x21, #4]
	add	x3, x19, #1
	add	x4, x19, #2
	add	x5, x19, #3
	mov	x6, x22
	bl	_ata_to_sense_error
	ldrb	w8, [x19, #1]
	and	w8, w8, #0xf
	strb	w8, [x19, #1]
LBB0_3:
	mov	x0, x21
	mov	x1, x20
	bl	_ata_tf_read_block
	mov	w8, #12
	sturh	w8, [x19, #7]
	mov	w8, #10
	strb	w8, [x19, #9]
	ldrb	w8, [x19, #10]
	orr	w8, w8, #0x80
	strb	w8, [x19, #10]
	lsr	w8, w0, #24
	strb	w8, [x19, #16]
	lsr	w8, w0, #16
	strb	w8, [x19, #17]
	lsr	w8, w0, #8
	strb	w8, [x19, #18]
	strb	w0, [x19, #19]
	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
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SCSI_SENSE_BUFFERSIZE,4,2      ; @SCSI_SENSE_BUFFERSIZE
	.comm	_DRIVER_SENSE,4,2               ; @DRIVER_SENSE
	.comm	_SAM_STAT_CHECK_CONDITION,4,2   ; @SAM_STAT_CHECK_CONDITION
	.comm	_ATA_BUSY,4,2                   ; @ATA_BUSY
	.comm	_ATA_DF,4,2                     ; @ATA_DF
	.comm	_ATA_ERR,4,2                    ; @ATA_ERR
	.comm	_ATA_DRQ,4,2                    ; @ATA_DRQ
	.no_dead_strip	_ata_gen_ata_sense
.subsections_via_symbols
