	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rs400_gart_set_page            ## -- Begin function rs400_gart_set_page
	.p2align	4, 0x90
_rs400_gart_set_page:                   ## @rs400_gart_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_2
## %bb.1:
	movl	%esi, %r15d
	cmpl	%esi, 8(%rdi)
	jge	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_3:
	movl	%edx, %r14d
	movq	(%rdi), %r12
	movl	%edx, %edi
	callq	_lower_32_bits
	movl	%eax, %ebx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movl	%r14d, %edi
	callq	_upper_32_bits
	movzbl	%al, %eax
	shll	$4, %eax
	movq	_RS400_PTE_WRITEABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	movq	_RS400_PTE_READABLE@GOTPCREL(%rip), %rcx
	orl	%eax, %ebx
	orl	(%rcx), %ebx
	movl	%ebx, %edi
	callq	_cpu_to_le32
	movl	%r15d, %ecx
	movl	%eax, (%r12,%rcx,4)
	xorl	%eax, %eax
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_RS400_PTE_WRITEABLE,4,2        ## @RS400_PTE_WRITEABLE
	.comm	_RS400_PTE_READABLE,4,2         ## @RS400_PTE_READABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rs400_gart_set_page            ; -- Begin function rs400_gart_set_page
	.p2align	2
_rs400_gart_set_page:                   ; @rs400_gart_set_page
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	tbnz	w1, #31, LBB0_2
; %bb.1:
	mov	x19, x1
	ldr	w8, [x0, #8]
	cmp	w8, w1
	b.ge	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	mov	x20, x2
	ldr	x21, [x0]
	mov	x0, x2
	bl	_lower_32_bits
Lloh3:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w22, w8, w0
	mov	x0, x20
	bl	_upper_32_bits
	ubfiz	w8, w0, #4, #8
Lloh6:
	adrp	x9, _RS400_PTE_WRITEABLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RS400_PTE_WRITEABLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _RS400_PTE_READABLE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _RS400_PTE_READABLE@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w9, w9, w22
	orr	w8, w9, w8
	orr	w0, w8, w10
	bl	_cpu_to_le32
	mov	x8, x0
	mov	w0, #0
	str	w8, [x21, w19, uxtw #2]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_RS400_PTE_WRITEABLE,4,2        ; @RS400_PTE_WRITEABLE
	.comm	_RS400_PTE_READABLE,4,2         ; @RS400_PTE_READABLE
.subsections_via_symbols
