	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cs_ib_vm_chunk
_radeon_cs_ib_vm_chunk:                 ## @radeon_cs_ib_vm_chunk
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %eax
	xorl	%ebx, %ebx
	cmpl	$-1, %eax
	je	LBB0_29
## %bb.1:
	movq	%rsi, %r12
	movq	_RADEON_CS_USE_VM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rsi)
	je	LBB0_29
## %bb.2:
	movq	56(%r12), %rcx
	movq	(%rcx), %rbx
	movq	(%rdi), %rcx
	movq	_CHIP_TAHITI@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jl	LBB0_14
## %bb.3:
	movslq	8(%r12), %r13
	cmpq	$-1, %r13
	je	LBB0_14
## %bb.4:
	movq	48(%r12), %r14
	movl	(%r14,%r13,8), %r8d
	movq	_RADEON_IB_VM_MAX_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_7
## %bb.5:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_6
LBB0_7:
	movl	44(%r12), %esi
	leaq	28(%r12), %rdx
	shll	$2, %r8d
	movq	%rdi, %r15
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rcx
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_10:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$1, 28(%r12)
	movl	(%r14,%r13,8), %edx
	movl	%edx, 32(%r12)
	movl	40(%r12), %edi
	movl	4(%r14,%r13,8), %esi
	shll	$2, %edx
	callq	_DRM_COPY_FROM_USER
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:
	movl	44(%r12), %esi
	movq	%r15, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_radeon_ring_ib_parse
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_29
## %bb.13:
	movq	%r15, %rdi
	movl	(%r12), %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:
	movq	48(%r12), %r14
	movslq	%eax, %r13
	movl	(%r14,%r13,8), %r8d
	movq	_RADEON_IB_VM_MAX_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	xorl	%ebx, %ebx
	movl	%r8d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_29
LBB0_16:
	movl	44(%r12), %esi
	leaq	12(%r12), %rdx
	shll	$2, %r8d
	movq	%rdi, %r15
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rcx
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
LBB0_9:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_29
LBB0_18:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%r14,%r13,8), %edx
	movl	%edx, 16(%r12)
	movl	24(%r12), %edi
	movl	4(%r14,%r13,8), %esi
	shll	$2, %edx
	callq	_DRM_COPY_FROM_USER
	testq	%rax, %rax
	je	LBB0_19
LBB0_11:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_29
LBB0_19:
	movl	44(%r12), %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %r13
	movq	%r15, %rdx
	callq	_radeon_ring_ib_parse
	movq	%rbx, %r15
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_29
## %bb.20:
	leaq	8(%r15), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_vm_alloc_pt
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_28
## %bb.21:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_radeon_bo_vm_update_pte
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_28
## %bb.22:
	movq	%r12, %rdi
	callq	_radeon_cs_sync_rings
	movl	4(%r14), %esi
	movq	%r13, %rdi
	callq	_radeon_ib_sync_to
	movl	44(%r12), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_vm_grab_id
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_radeon_ib_sync_to
	movq	(%r15), %rax
	movq	_CHIP_TAHITI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_25
## %bb.23:
	cmpl	$-1, 8(%r12)
	je	LBB0_25
## %bb.24:
	leaq	28(%r12), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	jmp	LBB0_26
LBB0_25:
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
LBB0_26:
	callq	_radeon_ib_schedule
	movl	%eax, %ebx
	testl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_28
## %bb.27:
	movl	20(%r12), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_vm_fence
	xorl	%ebx, %ebx
LBB0_28:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_radeon_vm_add_to_lru
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_29:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CS_USE_VM,4,2           ## @RADEON_CS_USE_VM
	.comm	_CHIP_TAHITI,8,3                ## @CHIP_TAHITI
	.comm	_RADEON_IB_VM_MAX_SIZE,4,2      ## @RADEON_IB_VM_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cs IB CONST too big: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get const ib !\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.2:                               ## @.str.2
	.asciz	"cs IB too big: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to get ib !\n"

	.no_dead_strip	_radeon_cs_ib_vm_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cs_ib_vm_chunk
_radeon_cs_ib_vm_chunk:                 ; @radeon_cs_ib_vm_chunk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	w26, [x1]
	cmn	w26, #1
	b.eq	LBB0_6
; %bb.1:
	mov	x21, x1
	ldr	w8, [x1, #4]
Lloh0:
	adrp	x9, _RADEON_CS_USE_VM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_CS_USE_VM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.2:
	mov	x19, x0
	ldr	x8, [x21, #56]
	ldr	x20, [x8]
	ldr	x8, [x0]
Lloh3:
	adrp	x25, _CHIP_TAHITI@GOTPAGE
Lloh4:
	ldr	x25, [x25, _CHIP_TAHITI@GOTPAGEOFF]
	ldr	x9, [x25]
Lloh5:
	adrp	x23, _RADEON_IB_VM_MAX_SIZE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _RADEON_IB_VM_MAX_SIZE@GOTPAGEOFF]
	cmp	x8, x9
	b.lt	LBB0_12
; %bb.3:
	ldrsw	x27, [x21, #8]
	cmn	w27, #1
	b.eq	LBB0_12
; %bb.4:
	ldr	x26, [x21, #48]
	add	x28, x26, x27, lsl #3
	ldr	w8, [x28]
	ldr	w9, [x23]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.5:
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_6:
	mov	w24, #0
	b	LBB0_19
LBB0_7:
	ldr	w1, [x21, #44]
	add	x22, x21, #28
	lsl	w4, w8, #2
	mov	x0, x19
	mov	x2, x22
	mov	x3, x20
	bl	_radeon_ib_get
	cbz	w0, LBB0_9
; %bb.8:
	mov	x24, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_9:
	mov	w8, #1
	ldr	w9, [x28]
	stp	w8, w9, [x21, #28]
	ldr	w0, [x21, #40]
	add	x8, x26, x27, lsl #3
	ldr	w1, [x8, #4]
	lsl	w2, w9, #2
	bl	_DRM_COPY_FROM_USER
	cbnz	x0, LBB0_21
; %bb.10:
	ldr	w1, [x21, #44]
	mov	x0, x19
	mov	x2, x22
	bl	_radeon_ring_ib_parse
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.11:
	ldr	w26, [x21]
LBB0_12:
	ldr	x27, [x21, #48]
	add	x28, x27, w26, sxtw #3
	ldr	w8, [x28]
	ldr	w9, [x23]
	cmp	w8, w9
	b.le	LBB0_16
; %bb.13:
	str	x8, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_DRM_ERROR
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_19
LBB0_16:
	ldr	w1, [x21, #44]
	add	x22, x21, #12
	lsl	w4, w8, #2
	mov	x0, x19
	mov	x2, x22
	mov	x3, x20
	bl	_radeon_ib_get
	cbz	w0, LBB0_20
; %bb.17:
	mov	x24, x0
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_18:
	bl	_DRM_ERROR
LBB0_19:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	sxtw	x8, w26
	ldr	w9, [x28]
	str	w9, [x21, #16]
	ldr	w0, [x21, #24]
	add	x8, x27, x8, lsl #3
	ldr	w1, [x8, #4]
	lsl	w2, w9, #2
	bl	_DRM_COPY_FROM_USER
	cbz	x0, LBB0_22
LBB0_21:
Lloh17:
	adrp	x8, _EFAULT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_15
LBB0_22:
	ldr	w1, [x21, #44]
	mov	x0, x19
	mov	x2, x22
	bl	_radeon_ring_ib_parse
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.23:
	add	x23, x19, #8
	mov	x0, x23
	bl	_mutex_lock
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_vm_alloc_pt
	mov	x24, x0
	cbnz	w0, LBB0_31
; %bb.24:
	mov	x0, x21
	mov	x1, x20
	bl	_radeon_bo_vm_update_pte
	mov	x24, x0
	cbnz	w0, LBB0_31
; %bb.25:
	mov	x0, x21
	bl	_radeon_cs_sync_rings
	ldr	w1, [x20, #4]
	mov	x0, x22
	bl	_radeon_ib_sync_to
	ldr	w2, [x21, #44]
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_vm_grab_id
	mov	x1, x0
	mov	x0, x22
	bl	_radeon_ib_sync_to
	ldr	x8, [x19]
	ldr	x9, [x25]
	cmp	x8, x9
	b.lt	LBB0_28
; %bb.26:
	ldr	w8, [x21, #8]
	cmn	w8, #1
	b.eq	LBB0_28
; %bb.27:
	add	x2, x21, #28
	mov	x0, x19
	mov	x1, x22
	b	LBB0_29
LBB0_28:
	mov	x0, x19
	mov	x1, x22
	mov	x2, #0
LBB0_29:
	bl	_radeon_ib_schedule
	mov	x24, x0
	cbnz	w0, LBB0_31
; %bb.30:
	ldr	w2, [x21, #20]
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_vm_fence
LBB0_31:
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_vm_add_to_lru
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CS_USE_VM,4,2           ; @RADEON_CS_USE_VM
	.comm	_CHIP_TAHITI,8,3                ; @CHIP_TAHITI
	.comm	_RADEON_IB_VM_MAX_SIZE,4,2      ; @RADEON_IB_VM_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cs IB CONST too big: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get const ib !\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.2:                               ; @.str.2
	.asciz	"cs IB too big: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to get ib !\n"

	.no_dead_strip	_radeon_cs_ib_vm_chunk
.subsections_via_symbols
