	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_finish_pages         ## -- Begin function radeon_cs_finish_pages
	.p2align	4, 0x90
_radeon_cs_finish_pages:                ## @radeon_cs_finish_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %r12d
	leaq	(%rax,%rax,2), %rax
	movl	(%rcx,%rax,8), %ebx
	leaq	(%rcx,%rax,8), %r13
	addq	$4, %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %ecx
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	leal	3(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$2, %eax
	imull	%ebx, %eax
	movslq	%eax, %rdi
	addq	8(%r14), %rdi
	imull	%ebx, %ecx
	movslq	%ecx, %rsi
	addq	12(%r13), %rsi
	movl	%r12d, %edx
	callq	_DRM_COPY_FROM_USER
	testq	%rax, %rax
	jne	LBB0_8
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	cmpl	%eax, %ebx
	jge	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%ebx
	cmpl	%eax, %ebx
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r13), %eax
	shll	$2, %eax
	movl	(%r15), %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %r12d
	testl	%edx, %edx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%edx, %r12d
	jmp	LBB0_7
LBB0_8:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_2:
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_finish_pages         ; -- Begin function radeon_cs_finish_pages
	.p2align	2
_radeon_cs_finish_pages:                ; @radeon_cs_finish_pages
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x9, [x0]
Lloh0:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w20, [x21]
	mov	w10, #24
	madd	x24, x9, x10, x8
	add	x22, x24, #4
	add	x23, x24, #8
	ldr	w25, [x24], #16
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x23]
	lsl	w10, w9, #2
	ldr	w9, [x21]
	sdiv	w11, w10, w9
	msub	w10, w11, w9, w10
	cmp	w10, #0
	csel	w20, w9, w10, eq
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x19, #8]
	add	w11, w9, #3
	cmp	w9, #0
	csel	w11, w11, w9, lt
	asr	w11, w11, #2
	mul	w11, w11, w8
	add	x0, x10, w11, sxtw
	ldr	x10, [x24]
	mul	w8, w9, w8
	add	x1, x10, w8, sxtw
	mov	x2, x20
	bl	_DRM_COPY_FROM_USER
	add	w25, w25, #1
	cbnz	x0, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x22]
	cmp	w25, w9
	b.ge	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w8, w25, #1
	cmp	w8, w9
	b.eq	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x21]
	b	LBB0_2
LBB0_6:
Lloh2:
	adrp	x8, _EFAULT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
