	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cik_sdma_vm_write_pages        ## -- Begin function cik_sdma_vm_write_pages
	.p2align	4, 0x90
_cik_sdma_vm_write_pages:               ## @cik_sdma_vm_write_pages
	.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
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	testl	%r8d, %r8d
	je	LBB0_9
## %bb.1:
	movl	%r8d, %r15d
	movl	%ecx, %ebx
	movl	%edx, %r12d
	movq	%rsi, %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	testl	%r15d, %r15d
	je	LBB0_9
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	leal	(%r15,%r15), %r14d
	cmpl	$1048574, %r14d                 ## imm = 0xFFFFE
	movl	$1048574, %eax                  ## imm = 0xFFFFE
	cmovael	%eax, %r14d
	movq	_SDMA_OPCODE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_SDMA_PACKET
	movq	(%r13), %rcx
	movslq	8(%r13), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r13)
	movl	%eax, (%rcx,%rdx,4)
	movslq	8(%r13), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%r13)
	movl	%r12d, (%rcx,%rax,4)
	movl	%r12d, %edi
	callq	_upper_32_bits
	movq	(%r13), %rcx
	movslq	8(%r13), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r13)
	movl	%eax, (%rcx,%rdx,4)
	movslq	8(%r13), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%r13)
	movl	%r14d, (%rcx,%rax,4)
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	16(%rbp), %eax
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=2
	movq	_R600_PTE_VALID@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	andl	%eax, %edi
	cmovnel	%ebx, %edi
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	addl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%eax, %edi
	movslq	8(%r13), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%r13)
	movl	%edi, (%rcx,%rax,4)
	callq	_upper_32_bits
	movq	(%r13), %rcx
	movslq	8(%r13), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%r13)
	movl	%eax, (%rcx,%rdx,4)
	movl	16(%rbp), %eax
	decl	%r15d
	addl	$8, %r12d
	addl	$-2, %r14d
	je	LBB0_2
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_R600_PTE_SYSTEM@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_radeon_vm_map_gart
	movl	%eax, %edi
	movl	16(%rbp), %eax
	movq	(%r13), %rcx
	jmp	LBB0_8
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMA_OPCODE_WRITE,4,2          ## @SDMA_OPCODE_WRITE
	.comm	_SDMA_WRITE_SUB_OPCODE_LINEAR,4,2 ## @SDMA_WRITE_SUB_OPCODE_LINEAR
	.comm	_R600_PTE_SYSTEM,4,2            ## @R600_PTE_SYSTEM
	.comm	_R600_PTE_VALID,4,2             ## @R600_PTE_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cik_sdma_vm_write_pages        ; -- Begin function cik_sdma_vm_write_pages
	.p2align	2
_cik_sdma_vm_write_pages:               ; @cik_sdma_vm_write_pages
	.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
	cbz	w4, LBB0_8
; %bb.1:
	mov	x19, x6
	mov	x20, x5
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
Lloh0:
	adrp	x27, _R600_PTE_SYSTEM@GOTPAGE
Lloh1:
	ldr	x27, [x27, _R600_PTE_SYSTEM@GOTPAGEOFF]
Lloh2:
	adrp	x28, _R600_PTE_VALID@GOTPAGE
Lloh3:
	ldr	x28, [x28, _R600_PTE_VALID@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cbz	w21, LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	lsl	w8, w21, #1
	mov	w9, #1048574
	cmp	w8, w9
	csel	w26, w8, w9, lo
Lloh4:
	adrp	x8, _SDMA_OPCODE_WRITE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SDMA_OPCODE_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x8, _SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SDMA_WRITE_SUB_OPCODE_LINEAR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_SDMA_PACKET
	ldr	x8, [x24]
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w0, [x8, x9, lsl #2]
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w23, [x8, x9, lsl #2]
	mov	x0, x23
	bl	_upper_32_bits
	ldr	x8, [x24]
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w0, [x8, x9, lsl #2]
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w26, [x8, x9, lsl #2]
	cbnz	w26, LBB0_6
	b	LBB0_2
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	w9, [x28]
	tst	w9, w19
	csel	w0, wzr, w22, eq
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	w22, w22, w20
	orr	w0, w0, w19
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w0, [x8, x9, lsl #2]
	bl	_upper_32_bits
	ldr	x8, [x24]
	ldrsw	x9, [x24, #8]
	add	w10, w9, #1
	str	w10, [x24, #8]
	str	w0, [x8, x9, lsl #2]
	sub	w21, w21, #1
	add	w23, w23, #8
	sub	w26, w26, #2
	cbz	w26, LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x27]
	tst	w9, w19
	b.eq	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x25
	mov	x1, x22
	bl	_radeon_vm_map_gart
	ldr	x8, [x24]
	b	LBB0_5
LBB0_8:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMA_OPCODE_WRITE,4,2          ; @SDMA_OPCODE_WRITE
	.comm	_SDMA_WRITE_SUB_OPCODE_LINEAR,4,2 ; @SDMA_WRITE_SUB_OPCODE_LINEAR
	.comm	_R600_PTE_SYSTEM,4,2            ; @R600_PTE_SYSTEM
	.comm	_R600_PTE_VALID,4,2             ; @R600_PTE_VALID
.subsections_via_symbols
