	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdc20621_ata_pkt
_pdc20621_ata_pkt:                      ## @pdc20621_ata_pkt
	.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
	movl	%ecx, %r14d
	movq	_PDC_20621_DIMM_BASE@GOTPCREL(%rip), %rax
	movq	_PDC_DIMM_WINDOW_STEP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	imull	%r14d, %ebx
	addl	(%rax), %ebx
	movq	%rdx, %r15
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	_PDC_DIMM_APKT_PRD@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%ebx, %edx
	callq	_VPRINTK
	movq	%r13, %rdi
	movq	_PDC_DIMM_ATA_PKT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	(%rdi), %rax
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%rdi)
	je	LBB0_2
LBB0_3:
	movq	_ATA_PROT_NODATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.4:
	movq	_PDC_PKT_NODATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r15,%r13,4)
	movq	%rax, %rcx
	jmp	LBB0_6
LBB0_5:
	movl	$0, (%r15,%r13,4)
	jmp	LBB0_6
LBB0_2:
	movq	_PDC_PKT_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%r15,%r13,4)
	movq	_ATA_PROT_NODATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_6:
	leal	1(%r13), %edx
	leal	2(%r13), %esi
	movl	$0, (%r15,%rdx,4)
	incl	%r14d
	leal	3(%r13), %edx
	movl	%r14d, (%r15,%rsi,4)
	movl	$255, (%r15,%rdx,4)
	cmpq	%rcx, %rax
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_8:
	movq	%rdi, %r14
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movq	%r14, %rdi
LBB0_9:
	leal	4(%r13), %ecx
	shrl	$2, %ecx
	movq	%rax, (%r15,%rcx,8)
	movq	$0, 8(%r15,%rcx,8)
	movq	_ATA_DEVICE_OBS@GOTPCREL(%rip), %rax
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.10:
	movq	_ATA_DEV1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
LBB0_11:
	orl	(%rax), %r12d
	leal	12(%r13), %eax
	movq	_PDC_PKT_CLEAR_BSY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_ATA_REG_DEVICE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	orl	$32, %ecx
	leal	13(%r13), %edx
	movl	%ecx, (%r15,%rax,4)
	leal	14(%r13), %eax
	movl	%r12d, (%r15,%rdx,4)
	movq	_PDC_REG_DEVCTL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	$32, %ecx
	leal	15(%r13), %edx
	movl	%ecx, (%r15,%rax,4)
	movl	12(%rdi), %eax
	addl	$16, %r13d
	movl	%eax, (%r15,%rdx,4)
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PDC_20621_DIMM_BASE,4,2        ## @PDC_20621_DIMM_BASE
	.comm	_PDC_DIMM_WINDOW_STEP,4,2       ## @PDC_DIMM_WINDOW_STEP
	.comm	_PDC_DIMM_APKT_PRD,4,2          ## @PDC_DIMM_APKT_PRD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENTER, dimm_sg == 0x%x, %d\n"

	.comm	_PDC_DIMM_ATA_PKT,4,2           ## @PDC_DIMM_ATA_PKT
	.comm	_ATA_PROT_DMA,8,3               ## @ATA_PROT_DMA
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_PDC_PKT_READ,4,2               ## @PDC_PKT_READ
	.comm	_ATA_PROT_NODATA,8,3            ## @ATA_PROT_NODATA
	.comm	_PDC_PKT_NODATA,4,2             ## @PDC_PKT_NODATA
	.comm	_ATA_DEVICE_OBS,4,2             ## @ATA_DEVICE_OBS
	.comm	_ATA_DEV1,4,2                   ## @ATA_DEV1
	.comm	_PDC_PKT_CLEAR_BSY,4,2          ## @PDC_PKT_CLEAR_BSY
	.comm	_ATA_REG_DEVICE,4,2             ## @ATA_REG_DEVICE
	.comm	_PDC_REG_DEVCTL,4,2             ## @PDC_REG_DEVCTL
	.no_dead_strip	_pdc20621_ata_pkt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdc20621_ata_pkt
_pdc20621_ata_pkt:                      ; @pdc20621_ata_pkt
	.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	x22, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PDC_20621_DIMM_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PDC_20621_DIMM_BASE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PDC_DIMM_WINDOW_STEP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PDC_DIMM_WINDOW_STEP@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	madd	w8, w9, w3, w8
Lloh6:
	adrp	x9, _PDC_DIMM_APKT_PRD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PDC_DIMM_APKT_PRD@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	add	w23, w8, w9
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x2, x23
	bl	_VPRINTK
Lloh11:
	adrp	x8, _PDC_DIMM_ATA_PKT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PDC_DIMM_ATA_PKT@GOTPAGEOFF]
Lloh13:
	ldr	w24, [x8]
	ldr	x8, [x20]
Lloh14:
	adrp	x9, _ATA_PROT_DMA@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w9, [x20, #8]
Lloh17:
	adrp	x10, _ATA_TFLAG_WRITE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
LBB0_2:
Lloh20:
	adrp	x9, _ATA_PROT_NODATA@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ATA_PROT_NODATA@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh23:
	adrp	x9, _PDC_PKT_NODATA@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PDC_PKT_NODATA@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	str	w9, [x19, x24, lsl #2]
	mov	x9, x8
	b	LBB0_6
LBB0_4:
	str	wzr, [x19, x24, lsl #2]
	b	LBB0_6
LBB0_5:
Lloh26:
	adrp	x9, _PDC_PKT_READ@GOTPAGE
Lloh27:
	ldr	x9, [x9, _PDC_PKT_READ@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	str	w9, [x19, x24, lsl #2]
Lloh29:
	adrp	x9, _ATA_PROT_NODATA@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ATA_PROT_NODATA@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
LBB0_6:
	add	w10, w24, #1
	add	w11, w24, #2
	str	wzr, [x19, w10, uxtw #2]
	add	w10, w22, #1
	add	w12, w24, #3
	str	w10, [x19, w11, uxtw #2]
	mov	w10, #255
	str	w10, [x19, w12, uxtw #2]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	mov	x0, #0
	b	LBB0_9
LBB0_8:
	mov	x0, x23
	bl	_cpu_to_le32
LBB0_9:
	add	w8, w24, #4
	lsr	w8, w8, #2
	str	x0, [x19, w8, uxtw #3]
	add	w8, w8, #1
	str	xzr, [x19, w8, uxtw #3]
Lloh32:
	adrp	x8, _ATA_DEVICE_OBS@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ATA_DEVICE_OBS@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, _ATA_DEV1@GOTPAGE
Lloh36:
	ldr	x9, [x9, _ATA_DEV1@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w21, #0
	csel	w9, wzr, w9, eq
	orr	w8, w9, w8
	add	w9, w24, #12
Lloh38:
	adrp	x10, _PDC_PKT_CLEAR_BSY@GOTPAGE
Lloh39:
	ldr	x10, [x10, _PDC_PKT_CLEAR_BSY@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
Lloh41:
	adrp	x11, _ATA_REG_DEVICE@GOTPAGE
Lloh42:
	ldr	x11, [x11, _ATA_REG_DEVICE@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	orr	w10, w10, w11
	orr	w10, w10, #0x20
	add	w11, w24, #13
	str	w10, [x19, w9, uxtw #2]
	add	w9, w24, #14
	str	w8, [x19, w11, uxtw #2]
Lloh44:
	adrp	x8, _PDC_REG_DEVCTL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _PDC_REG_DEVCTL@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	orr	w8, w8, #0x20
	str	w8, [x19, w9, uxtw #2]
	add	w8, w24, #15
	ldr	w9, [x20, #12]
	add	w0, w24, #16
	str	w9, [x19, w8, uxtw #2]
	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	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PDC_20621_DIMM_BASE,4,2        ; @PDC_20621_DIMM_BASE
	.comm	_PDC_DIMM_WINDOW_STEP,4,2       ; @PDC_DIMM_WINDOW_STEP
	.comm	_PDC_DIMM_APKT_PRD,4,2          ; @PDC_DIMM_APKT_PRD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENTER, dimm_sg == 0x%x, %d\n"

	.comm	_PDC_DIMM_ATA_PKT,4,2           ; @PDC_DIMM_ATA_PKT
	.comm	_ATA_PROT_DMA,8,3               ; @ATA_PROT_DMA
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_PDC_PKT_READ,4,2               ; @PDC_PKT_READ
	.comm	_ATA_PROT_NODATA,8,3            ; @ATA_PROT_NODATA
	.comm	_PDC_PKT_NODATA,4,2             ; @PDC_PKT_NODATA
	.comm	_ATA_DEVICE_OBS,4,2             ; @ATA_DEVICE_OBS
	.comm	_ATA_DEV1,4,2                   ; @ATA_DEV1
	.comm	_PDC_PKT_CLEAR_BSY,4,2          ; @PDC_PKT_CLEAR_BSY
	.comm	_ATA_REG_DEVICE,4,2             ; @ATA_REG_DEVICE
	.comm	_PDC_REG_DEVCTL,4,2             ; @PDC_REG_DEVCTL
	.no_dead_strip	_pdc20621_ata_pkt
.subsections_via_symbols
