	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_gen_passthru_sense
_ata_gen_passthru_sense:                ## @ata_gen_passthru_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	40(%rdi), %r13
	movq	8(%rax), %rax
	xorl	%r15d, %r15d
	cmpq	$0, (%rax)
	movq	(%r13), %rbx
	sete	%r12b
	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(%r13)
	cmpq	$0, 8(%r14)
	movl	16(%r14), %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	%r12b, %r15b
	movq	(%r14), %rax
	movl	(%rax), %edi
	movzbl	20(%r14), %edx
	leaq	1(%rbx), %rcx
	leaq	2(%rbx), %r8
	leaq	3(%rbx), %r9
	movl	%r15d, (%rsp)
	callq	_ata_to_sense_error
	andb	$15, 1(%rbx)
LBB0_3:
	movb	$114, (%rbx)
	movl	$788750, 7(%rbx)                ## imm = 0xC090E
	movb	20(%r14), %al
	movb	%al, 11(%rbx)
	movb	21(%r14), %al
	movb	%al, 13(%rbx)
	movb	22(%r14), %al
	movb	%al, 15(%rbx)
	movb	23(%r14), %al
	movb	%al, 17(%rbx)
	movb	24(%r14), %al
	movb	%al, 19(%rbx)
	movb	25(%r14), %al
	movb	%al, 20(%rbx)
	movb	16(%r14), %al
	movb	%al, 21(%rbx)
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 28(%r14)
	je	LBB0_5
## %bb.4:
	movb	$1, 10(%rbx)
	movb	32(%r14), %al
	movb	%al, 12(%rbx)
	movb	33(%r14), %al
	movb	%al, 14(%rbx)
	movb	34(%r14), %al
	movb	%al, 16(%rbx)
	movb	35(%r14), %al
	movb	%al, 18(%rbx)
LBB0_5:
	addq	$8, %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
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.no_dead_strip	_ata_gen_passthru_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_passthru_sense
_ata_gen_passthru_sense:                ; @ata_gen_passthru_sense
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x22, [x0, #40]
	ldr	x20, [x22]
	ldr	x8, [x0]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w21, eq
Lloh0:
	adrp	x8, _SCSI_SENSE_BUFFERSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCSI_SENSE_BUFFERSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_memset
Lloh3:
	adrp	x8, _DRIVER_SENSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRIVER_SENSE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _SAM_STAT_CHECK_CONDITION@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SAM_STAT_CHECK_CONDITION@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8, lsl #24
	str	w8, [x22, #8]
	ldr	x8, [x19, #8]
	ldr	w1, [x19, #16]
	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, [x19]
	ldr	w0, [x8]
	ldrb	w2, [x19, #20]
	add	x3, x20, #1
	add	x4, x20, #2
	add	x5, x20, #3
	mov	x6, x21
	bl	_ata_to_sense_error
	ldrb	w8, [x20, #1]
	and	w8, w8, #0xf
	strb	w8, [x20, #1]
LBB0_3:
	mov	w8, #114
	strb	w8, [x20]
	mov	w8, #2318
	movk	w8, #12, lsl #16
	stur	w8, [x20, #7]
	ldrb	w8, [x19, #20]
	strb	w8, [x20, #11]
	ldrb	w8, [x19, #21]
	strb	w8, [x20, #13]
	ldrb	w8, [x19, #22]
	strb	w8, [x20, #15]
	ldrb	w8, [x19, #23]
	strb	w8, [x20, #17]
	ldrb	w8, [x19, #24]
	strb	w8, [x20, #19]
	ldrb	w8, [x19, #25]
	strb	w8, [x20, #20]
	ldr	w8, [x19, #16]
	strb	w8, [x20, #21]
	ldr	w8, [x19, #28]
Lloh21:
	adrp	x9, _ATA_TFLAG_LBA48@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	w8, #1
	strb	w8, [x20, #10]
	ldrb	w8, [x19, #32]
	strb	w8, [x20, #12]
	ldrb	w8, [x19, #33]
	strb	w8, [x20, #14]
	ldrb	w8, [x19, #34]
	strb	w8, [x20, #16]
	ldrb	w8, [x19, #35]
	strb	w8, [x20, #18]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.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
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.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
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.no_dead_strip	_ata_gen_passthru_sense
.subsections_via_symbols
