	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_vm_clear_bo
_radeon_vm_clear_bo:                    ## @radeon_vm_clear_bo
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	$1, -64(%rbp)
	movq	%rsi, %rdi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	leaq	4(%r15), %rdi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rsi
	callq	_ttm_bo_validate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	%r15, %rdi
	callq	_radeon_bo_gpu_offset
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_radeon_bo_size
	movl	%eax, %r13d
	movq	_R600_RING_TYPE_DMA_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$256, %r8d                      ## imm = 0x100
	callq	_radeon_ib_get
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	leal	7(%r13), %r8d
	testl	%r13d, %r13d
	cmovnsl	%r13d, %r8d
	sarl	$3, %r8d
	movl	$0, -56(%rbp)
	movl	$0, (%rsp)
	leaq	-56(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_vm_set_pages
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_radeon_asic_vm_pad_ib
	xorl	%edi, %edi
	cmpl	$65, -56(%rbp)
	setge	%dil
	callq	_WARN_ON
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_radeon_ib_schedule
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rsi
	movl	$1, (%rsi)
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_radeon_bo_fence
LBB0_5:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_radeon_ib_free
LBB0_6:
	movq	%r15, %rdi
	callq	_radeon_bo_unreserve
LBB0_7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R600_RING_TYPE_DMA_INDEX,4,2   ## @R600_RING_TYPE_DMA_INDEX
	.no_dead_strip	_radeon_vm_clear_bo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_vm_clear_bo
_radeon_vm_clear_bo:                    ; @radeon_vm_clear_bo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x1
	mov	x20, x0
	mov	w8, #1
	str	x8, [sp, #24]
	mov	x0, x1
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.1:
	add	x0, x19, #4
	add	x2, sp, #24
	mov	x1, x19
	bl	_ttm_bo_validate
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_radeon_bo_gpu_offset
	mov	x22, x0
	mov	x0, x19
	bl	_radeon_bo_size
	mov	x23, x0
Lloh0:
	adrp	x8, _R600_RING_TYPE_DMA_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R600_RING_TYPE_DMA_INDEX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	mov	x3, #0
	mov	w4, #256
	bl	_radeon_ib_get
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.3:
	add	w8, w23, #7
	cmp	w23, #0
	csel	w8, w8, w23, lt
	asr	w4, w8, #3
	str	wzr, [sp, #8]
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x22
	mov	w3, #0
	mov	w5, #0
	mov	w6, #0
	bl	_radeon_vm_set_pages
	add	x1, sp, #8
	mov	x0, x20
	bl	_radeon_asic_vm_pad_ib
	ldr	w8, [sp, #8]
	cmp	w8, #64
	cset	w0, gt
	bl	_WARN_ON
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, #0
	mov	w3, #0
	bl	_radeon_ib_schedule
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.4:
	ldr	x1, [sp, #16]
	mov	w8, #1
	str	w8, [x1]
	mov	x0, x19
	mov	w2, #0
	bl	_radeon_bo_fence
LBB0_5:
	add	x1, sp, #8
	mov	x0, x20
	bl	_radeon_ib_free
LBB0_6:
	mov	x0, x19
	bl	_radeon_bo_unreserve
LBB0_7:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_R600_RING_TYPE_DMA_INDEX,4,2   ; @R600_RING_TYPE_DMA_INDEX
	.no_dead_strip	_radeon_vm_clear_bo
.subsections_via_symbols
