	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r13d, %r13d
	cmpq	$0, 40(%rsi)
	je	LBB0_18
## %bb.1:
	movq	%rsi, %rbx
	movq	_RADEON_CS_USE_VM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_18
## %bb.2:
	movq	%rdi, %r15
	movq	48(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	24(%rbx), %r12
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_radeon_ring_ib_parse
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
LBB0_4:
	movq	8(%rbx), %rsi
	leaq	16(%rbx), %r14
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_radeon_ring_ib_parse
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rax
	movq	_R600_RING_TYPE_UVD_INDEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_radeon_uvd_note_usage
LBB0_7:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_radeon_bo_vm_update_pte
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.8:
	movq	%rbx, %rdi
	callq	_radeon_cs_sync_rings
	testl	%eax, %eax
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_11
## %bb.9:
	movl	%eax, %r13d
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	je	LBB0_16
## %bb.10:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	callq	_DRM_ERROR
	jmp	LBB0_16
LBB0_11:
	movq	(%r15), %rax
	movq	_CHIP_TAHITI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_14
## %bb.12:
	cmpq	$0, 32(%rbx)
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	movq	%r12, %rdx
	jmp	LBB0_15
LBB0_14:
	movq	%r15, %rdi
	xorl	%edx, %edx
LBB0_15:
	movl	$1, %ecx
	callq	_radeon_ib_schedule
	movl	%eax, %r13d
LBB0_16:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_17:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_18:
	movl	%r13d, %eax
	addq	$24, %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	_R600_RING_TYPE_UVD_INDEX,8,3   ## @R600_RING_TYPE_UVD_INDEX
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to sync rings: %i\n"

	.comm	_CHIP_TAHITI,8,3                ## @CHIP_TAHITI
	.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:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x1, #40]
	cbz	x8, LBB0_9
; %bb.1:
	mov	x21, x1
	ldr	w8, [x1]
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_9
; %bb.2:
	mov	x20, x0
	ldr	x8, [x21, #48]
	ldr	x19, [x8]
	mov	x22, x21
	ldr	x8, [x22, #24]!
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x1, [x21, #8]
	mov	x0, x20
	mov	x2, x22
	bl	_radeon_ring_ib_parse
	mov	x24, x0
	cbnz	w0, LBB0_10
LBB0_4:
	ldr	x1, [x21, #8]
	add	x23, x21, #16
	mov	x0, x20
	mov	x2, x23
	bl	_radeon_ring_ib_parse
	mov	x24, x0
	cbnz	w0, LBB0_10
; %bb.5:
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x9, _R600_RING_TYPE_UVD_INDEX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _R600_RING_TYPE_UVD_INDEX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_radeon_uvd_note_usage
LBB0_7:
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	mov	x1, x19
	bl	_radeon_bo_vm_update_pte
	mov	x24, x0
	cbz	w0, LBB0_11
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_10
LBB0_9:
	mov	w24, #0
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x0, x21
	bl	_radeon_cs_sync_rings
	cbz	w0, LBB0_14
; %bb.12:
	mov	x24, x0
Lloh6:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_8
; %bb.13:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x24
	bl	_DRM_ERROR
	b	LBB0_8
LBB0_14:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _CHIP_TAHITI@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CHIP_TAHITI@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_17
; %bb.15:
	ldr	x8, [x21, #32]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	b	LBB0_18
LBB0_17:
	mov	x0, x20
	mov	x1, x23
	mov	x2, #0
LBB0_18:
	mov	w3, #1
	bl	_radeon_ib_schedule
	mov	x24, x0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CS_USE_VM,4,2           ; @RADEON_CS_USE_VM
	.comm	_R600_RING_TYPE_UVD_INDEX,8,3   ; @R600_RING_TYPE_UVD_INDEX
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to sync rings: %i\n"

	.comm	_CHIP_TAHITI,8,3                ; @CHIP_TAHITI
	.no_dead_strip	_radeon_cs_ib_vm_chunk
.subsections_via_symbols
