	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_prdt
_write_prdt:                            ## @write_prdt
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, %r13
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rcx
	movq	_AHCI_CL_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%esi, %rdx
	imulq	%rax, %rdx
	movq	%rcx, %rax
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rcx,%rdx)
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_5
## %bb.1:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movl	$64, %r15d
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_DBCMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	andl	(%r14,%r15,8), %ebx
	incl	%ebx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_ahci_ctx
	movl	4(%r14,%r15,8), %esi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_paddr_guest2host
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_MIN
	movl	%eax, %r14d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_memcpy
	subl	%r14d, %r12d
	leal	-63(%r15), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpl	(%rdx,%rcx), %eax
	jge	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	%r14d, %rax
	addq	%rax, %r13
	incq	%r15
	testl	%r12d, %r12d
	jne	LBB0_3
LBB0_5:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	subl	%r12d, %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, 4(%rdx,%rcx)
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AHCI_CL_SIZE,4,2               ## @AHCI_CL_SIZE
	.comm	_DBCMASK,4,2                    ## @DBCMASK
	.no_dead_strip	_write_prdt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_prdt
_write_prdt:                            ; @write_prdt
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x4
                                        ; kill: def $w1 killed $w1 def $x1
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _AHCI_CL_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AHCI_CL_SIZE@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x9]
	sxtw	x10, w1
	madd	x25, x9, x10, x8
	ldr	w8, [x25]
	cmp	w8, #1
	ccmp	w4, #0, #4, ge
	mov	x22, x4
	b.eq	LBB0_3
; %bb.1:
	mov	x20, x3
	mov	x21, x0
	add	x26, x2, #512
	mov	w27, #1
Lloh3:
	adrp	x28, _DBCMASK@GOTPAGE
Lloh4:
	ldr	x28, [x28, _DBCMASK@GOTPAGEOFF]
	mov	x22, x19
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	ldr	w9, [x28]
	and	w8, w9, w8
	add	w23, w8, #1
	ldr	w0, [x21]
	bl	_ahci_ctx
	ldr	w1, [x26, #4]
	mov	x2, x23
	bl	_paddr_guest2host
	mov	x24, x0
	mov	x0, x22
	mov	x1, x23
	bl	_MIN
	mov	x23, x0
	mov	x0, x24
	mov	x1, x20
	mov	x2, x23
	bl	_memcpy
	sub	w22, w22, w23
	add	x20, x20, w23, sxtw
	ldr	w8, [x25]
	cmp	w27, w8
	add	w27, w27, #1
	add	x26, x26, #8
	ccmp	w22, #0, #4, lt
	b.ne	LBB0_2
LBB0_3:
	sub	w8, w19, w22
	str	w8, [x25, #4]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AHCI_CL_SIZE,4,2               ; @AHCI_CL_SIZE
	.comm	_DBCMASK,4,2                    ; @DBCMASK
	.no_dead_strip	_write_prdt
.subsections_via_symbols
