	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cayman_vm_set_page             ## -- Begin function cayman_vm_set_page
	.p2align	4, 0x90
_cayman_vm_set_page:                    ## @cayman_vm_set_page
	.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, -56(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r12d
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movl	16(%rbp), %esi
	callq	_cayman_vm_page_flags
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_RADEON_RING_TYPE_GFX_INDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	testl	%r12d, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	(%r12,%r12), %r14d
	incl	%r14d
	cmpl	$16383, %r14d                   ## imm = 0x3FFF
	movl	$16383, %eax                    ## imm = 0x3FFF
	cmovael	%eax, %r14d
	movq	_PACKET3_ME_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_PACKET3
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	movslq	8(%rbx), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%rbx)
	movl	%r13d, (%rcx,%rax,4)
	movl	%r13d, %edi
	callq	_upper_32_bits
	movzbl	%al, %eax
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	cmpl	$1, %r14d
	je	LBB0_5
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=2
	movq	_RADEON_VM_PAGE_VALID@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	andl	%eax, %edi
	cmovnel	%r15d, %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=2
	addl	-56(%rbp), %r15d                ## 4-byte Folded Reload
	orl	-52(%rbp), %edi                 ## 4-byte Folded Reload
	movq	%rax, %rbx
	movslq	8(%rax), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%rbx)
	movl	%edi, (%rcx,%rax,4)
	callq	_upper_32_bits
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	addl	$-2, %r14d
	decl	%r12d
	addl	$8, %r13d
	cmpl	$1, %r14d
	jbe	LBB0_5
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	16(%rbp), %eax
	movq	_RADEON_VM_PAGE_SYSTEM@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_radeon_vm_map_gart
	movl	%eax, %edi
	andl	$-4096, %edi                    ## imm = 0xF000
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	(%r12,%r12), %r14d
	cmpl	$1048574, %r14d                 ## imm = 0xFFFFE
	movl	$1048574, %eax                  ## imm = 0xFFFFE
	cmovael	%eax, %r14d
	movq	_DMA_PACKET_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	%r14d, %ecx
	callq	_DMA_PACKET
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	movslq	8(%rbx), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%rbx)
	movl	%r13d, (%rcx,%rax,4)
	movl	%r13d, %edi
	callq	_upper_32_bits
	movzbl	%al, %eax
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	testl	%r14d, %r14d
	jne	LBB0_3
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=2
	movq	_RADEON_VM_PAGE_VALID@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	andl	%eax, %edi
	cmovnel	%r15d, %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=2
	addl	-56(%rbp), %r15d                ## 4-byte Folded Reload
	orl	-52(%rbp), %edi                 ## 4-byte Folded Reload
	movq	%rax, %rbx
	movslq	8(%rax), %rax
	leal	1(%rax), %edx
	movl	%edx, 8(%rbx)
	movl	%edi, (%rcx,%rax,4)
	callq	_upper_32_bits
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	decl	%r12d
	addl	$8, %r13d
	addl	$-2, %r14d
	je	LBB0_1
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	16(%rbp), %eax
	movq	_RADEON_VM_PAGE_SYSTEM@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	callq	_radeon_vm_map_gart
	movl	%eax, %edi
	andl	$-4096, %edi                    ## imm = 0xF000
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	jmp	LBB0_16
LBB0_11:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	testb	$7, 8(%rbx)
	je	LBB0_14
## %bb.12:
	movq	_DMA_PACKET_NOP@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_DMA_PACKET
	movq	(%rbx), %rcx
	movslq	8(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rbx)
	movl	%eax, (%rcx,%rdx,4)
	testb	$7, 8(%rbx)
	jne	LBB0_13
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ## @RADEON_RING_TYPE_GFX_INDEX
	.comm	_PACKET3_ME_WRITE,4,2           ## @PACKET3_ME_WRITE
	.comm	_RADEON_VM_PAGE_SYSTEM,4,2      ## @RADEON_VM_PAGE_SYSTEM
	.comm	_RADEON_VM_PAGE_VALID,4,2       ## @RADEON_VM_PAGE_VALID
	.comm	_DMA_PACKET_WRITE,4,2           ## @DMA_PACKET_WRITE
	.comm	_DMA_PACKET_NOP,4,2             ## @DMA_PACKET_NOP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cayman_vm_set_page             ; -- Begin function cayman_vm_set_page
	.p2align	2
_cayman_vm_set_page:                    ; @cayman_vm_set_page
	.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	x20, x6
	mov	x21, x5
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x19, x1
	mov	x25, x0
	mov	x1, x6
	bl	_cayman_vm_page_flags
	mov	x26, x0
	ldr	x8, [x25]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_RING_TYPE_GFX_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	cbz	w22, LBB0_20
; %bb.2:
Lloh3:
	adrp	x28, _RADEON_VM_PAGE_SYSTEM@GOTPAGE
Lloh4:
	ldr	x28, [x28, _RADEON_VM_PAGE_SYSTEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	w22, LBB0_20
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	w8, #1
	bfi	w8, w22, #1, #31
	mov	w9, #16383
	cmp	w8, w9
	csel	w27, w8, w9, lo
Lloh5:
	adrp	x8, _PACKET3_ME_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PACKET3_ME_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x27
	bl	_PACKET3
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w24, [x8, x9, lsl #2]
	mov	x0, x24
	bl	_upper_32_bits
	and	w9, w0, #0xff
	ldr	x8, [x19]
	ldrsw	x10, [x19, #8]
	add	w11, w10, #1
	str	w11, [x19, #8]
	str	w9, [x8, x10, lsl #2]
	cmp	w27, #1
	b.ne	LBB0_7
	b	LBB0_3
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
Lloh8:
	adrp	x9, _RADEON_VM_PAGE_VALID@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RADEON_VM_PAGE_VALID@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w20
	csel	w9, wzr, w23, eq
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	w23, w23, w21
	orr	w0, w9, w26
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	bl	_upper_32_bits
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	sub	w27, w27, #2
	sub	w22, w22, #1
	add	w24, w24, #8
	cmp	w27, #1
	b.ls	LBB0_3
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x28]
	tst	w9, w20
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	mov	x1, x23
	bl	_radeon_vm_map_gart
	and	w9, w0, #0xfffff000
	ldr	x8, [x19]
	b	LBB0_6
LBB0_9:
	cbz	w22, LBB0_17
; %bb.10:
Lloh11:
	adrp	x28, _RADEON_VM_PAGE_SYSTEM@GOTPAGE
Lloh12:
	ldr	x28, [x28, _RADEON_VM_PAGE_SYSTEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	cbz	w22, LBB0_17
LBB0_12:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	lsl	w8, w22, #1
	mov	w9, #1048574
	cmp	w8, w9
	csel	w27, w8, w9, lo
Lloh13:
	adrp	x8, _DMA_PACKET_WRITE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DMA_PACKET_WRITE@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	w1, #0
	mov	w2, #0
	mov	x3, x27
	bl	_DMA_PACKET
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w24, [x8, x9, lsl #2]
	mov	x0, x24
	bl	_upper_32_bits
	and	w9, w0, #0xff
	ldr	x8, [x19]
	ldrsw	x10, [x19, #8]
	add	w11, w10, #1
	str	w11, [x19, #8]
	str	w9, [x8, x10, lsl #2]
	cbnz	w27, LBB0_15
	b	LBB0_11
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=2
Lloh16:
	adrp	x9, _RADEON_VM_PAGE_VALID@GOTPAGE
Lloh17:
	ldr	x9, [x9, _RADEON_VM_PAGE_VALID@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w20
	csel	w9, wzr, w23, eq
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	add	w23, w23, w21
	orr	w0, w9, w26
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	bl	_upper_32_bits
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	sub	w22, w22, #1
	add	w24, w24, #8
	sub	w27, w27, #2
	cbz	w27, LBB0_11
LBB0_15:                                ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x28]
	tst	w9, w20
	b.eq	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=2
	mov	x0, x25
	mov	x1, x23
	bl	_radeon_vm_map_gart
	and	w9, w0, #0xfffff000
	ldr	x8, [x19]
	b	LBB0_14
LBB0_17:
	ldrb	w8, [x19, #8]
	tst	w8, #0x7
	b.eq	LBB0_20
; %bb.18:
Lloh19:
	adrp	x20, _DMA_PACKET_NOP@GOTPAGE
Lloh20:
	ldr	x20, [x20, _DMA_PACKET_NOP@GOTPAGEOFF]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_DMA_PACKET
	ldr	x8, [x19]
	ldrsw	x9, [x19, #8]
	add	w10, w9, #1
	str	w10, [x19, #8]
	str	w0, [x8, x9, lsl #2]
	ldrb	w8, [x19, #8]
	tst	w8, #0x7
	b.ne	LBB0_19
LBB0_20:
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_RING_TYPE_GFX_INDEX,8,3 ; @RADEON_RING_TYPE_GFX_INDEX
	.comm	_PACKET3_ME_WRITE,4,2           ; @PACKET3_ME_WRITE
	.comm	_RADEON_VM_PAGE_SYSTEM,4,2      ; @RADEON_VM_PAGE_SYSTEM
	.comm	_RADEON_VM_PAGE_VALID,4,2       ; @RADEON_VM_PAGE_VALID
	.comm	_DMA_PACKET_WRITE,4,2           ; @DMA_PACKET_WRITE
	.comm	_DMA_PACKET_NOP,4,2             ; @DMA_PACKET_NOP
.subsections_via_symbols
