	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_scsi_write_same_xlat
_ata_scsi_write_same_xlat:              ## @ata_scsi_write_same_xlat
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	8(%rdi), %rbx
	movq	(%rbx), %r15
	xorl	%edi, %edi
	cmpl	$0, (%rax)
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	xorl	%edi, %edi
	cmpl	$16, 8(%rbx)
	setl	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	leaq	-32(%rbp), %rsi
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	callq	_scsi_16_lba_len
	xorl	%edi, %edi
	testb	$8, 4(%r15)
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
LBB0_5:
	movq	_ILLEGAL_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$36, %edx
	xorl	%ecx, %ecx
	callq	_ata_scsi_set_sense
	movl	$1, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_scsi_sg_count
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_scsi_sglist
	movl	%eax, %edi
	callq	_sg_page
	movl	%eax, %edi
	callq	_page_address
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	%rax, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_ata_set_lba_range_entries
                                        ## kill: def $eax killed $eax def $rax
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%r14)
	movq	$0, 40(%r14)
	movq	_ATA_DSM_TRIM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%r14)
	leal	511(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	movl	%ecx, %eax
	sarl	$9, %eax
	sarl	$17, %ecx
	movl	%ecx, 16(%r14)
	movl	%eax, 20(%r14)
	movq	_ATA_CMD_DSM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	movq	_ATA_TFLAG_ISADDR@GOTPCREL(%rip), %rax
	movq	_ATA_TFLAG_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	%ecx, 24(%r14)
	movq	%r14, %rdi
	callq	_ata_qc_set_pc_nbytes
	xorl	%eax, %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_PROT_DMA,4,2               ## @ATA_PROT_DMA
	.comm	_ATA_DSM_TRIM,4,2               ## @ATA_DSM_TRIM
	.comm	_ATA_CMD_DSM,4,2                ## @ATA_CMD_DSM
	.comm	_ATA_TFLAG_ISADDR,4,2           ## @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_DEVICE,4,2           ## @ATA_TFLAG_DEVICE
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_ILLEGAL_REQUEST,4,2            ## @ILLEGAL_REQUEST
	.no_dead_strip	_ata_scsi_write_same_xlat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_scsi_write_same_xlat
_ata_scsi_write_same_xlat:              ; @ata_scsi_write_same_xlat
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldp	x8, x20, [x0]
	ldr	x21, [x20]
	ldr	w8, [x8]
	cmp	w8, #0
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x20, #8]
	cmp	w8, #16
	cset	w0, lt
	bl	_unlikely
	cbnz	x0, LBB0_3
; %bb.2:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x21
	bl	_scsi_16_lba_len
	ldr	w8, [x21, #4]
	mov	w9, #1
	bic	w0, w9, w8, lsr #3
	bl	_unlikely
	cbz	x0, LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _ILLEGAL_REQUEST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ILLEGAL_REQUEST@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #36
	mov	w3, #0
	bl	_ata_scsi_set_sense
	mov	w0, #1
LBB0_4:
	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
	add	sp, sp, #64
	ret
LBB0_5:
	mov	x0, x20
	bl	_scsi_sg_count
	cbz	w0, LBB0_3
; %bb.6:
	mov	x0, x20
	bl	_scsi_sglist
	bl	_sg_page
	bl	_page_address
	ldp	w3, w2, [sp, #8]
	mov	w1, #512
	bl	_ata_set_lba_range_entries
Lloh3:
	adrp	x8, _ATA_PROT_DMA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #48]
	str	xzr, [x19, #40]
Lloh6:
	adrp	x8, _ATA_DSM_TRIM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_DSM_TRIM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	add	w8, w0, #511
	cmp	w0, #0
	csel	w8, w8, w0, lt
	asr	w9, w8, #9
	asr	w8, w8, #17
	stp	w8, w9, [x19, #16]
Lloh9:
	adrp	x8, _ATA_TFLAG_ISADDR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_TFLAG_ISADDR@GOTPAGEOFF]
Lloh11:
	adrp	x9, _ATA_TFLAG_DEVICE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_TFLAG_DEVICE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _ATA_TFLAG_LBA48@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _ATA_TFLAG_WRITE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x19, #24]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _ATA_CMD_DSM@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ATA_CMD_DSM@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #24]
	mov	x0, x19
	bl	_ata_qc_set_pc_nbytes
	mov	w0, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_PROT_DMA,4,2               ; @ATA_PROT_DMA
	.comm	_ATA_DSM_TRIM,4,2               ; @ATA_DSM_TRIM
	.comm	_ATA_CMD_DSM,4,2                ; @ATA_CMD_DSM
	.comm	_ATA_TFLAG_ISADDR,4,2           ; @ATA_TFLAG_ISADDR
	.comm	_ATA_TFLAG_DEVICE,4,2           ; @ATA_TFLAG_DEVICE
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_ILLEGAL_REQUEST,4,2            ; @ILLEGAL_REQUEST
	.no_dead_strip	_ata_scsi_write_same_xlat
.subsections_via_symbols
