	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_vm_alloc_pt             ## -- Begin function radeon_vm_alloc_pt
	.p2align	4, 0x90
_radeon_vm_alloc_pt:                    ## @radeon_vm_alloc_pt
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	xorl	%ebx, %ebx
	cmpq	$0, 8(%rsi)
	jne	LBB0_11
## %bb.3:
	movq	%rdi, %r12
	leaq	8(%r14), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_radeon_vm_directory_size
	movl	%eax, %edi
	callq	_RADEON_GPU_PAGE_ALIGN
	movl	%eax, %r13d
	movq	_RADEON_GPU_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	movl	%r13d, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_sa_bo_new
	movl	%eax, %ebx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_radeon_vm_evict
	testl	%eax, %eax
	je	LBB0_4
## %bb.6:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	testl	%ebx, %ebx
	jne	LBB0_11
## %bb.8:
	movq	8(%r14), %rdi
	callq	_radeon_sa_bo_gpu_addr
	movl	%eax, 24(%r14)
	movq	8(%r14), %rdi
	callq	_radeon_sa_bo_cpu_addr
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
	movq	%r12, %rdi
	callq	_radeon_vm_num_pdes
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	jne	LBB0_11
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movl	(%r14), %edx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_radeon_sa_bo_free
	xorl	%ebx, %ebx
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_GPU_PAGE_SIZE,4,2       ## @RADEON_GPU_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory for page table array\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_vm_alloc_pt             ; -- Begin function radeon_vm_alloc_pt
	.p2align	2
_radeon_vm_alloc_pt:                    ; @radeon_vm_alloc_pt
	.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
	cbz	x1, LBB0_3
; %bb.1:
	mov	x20, x1
	mov	x21, x1
	ldr	x8, [x21, #8]!
	cbz	x8, LBB0_5
; %bb.2:
	mov	w0, #0
	b	LBB0_10
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
LBB0_4:
	neg	w0, w8
	b	LBB0_10
LBB0_5:
	mov	x19, x0
Lloh3:
	adrp	x24, _RADEON_GPU_PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x24, [x24, _RADEON_GPU_PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	adrp	x23, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x23, [x23, _ENOMEM@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_radeon_vm_directory_size
	bl	_RADEON_GPU_PAGE_ALIGN
	mov	x22, x0
	ldr	w4, [x24]
	mov	x0, x19
	mov	x1, x19
	mov	x2, x21
	mov	x3, x22
	mov	w5, #0
	bl	_radeon_sa_bo_new
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_vm_evict
	cbz	w0, LBB0_6
	b	LBB0_10
LBB0_8:
	cbnz	w0, LBB0_10
; %bb.9:
	ldr	x0, [x20, #8]
	bl	_radeon_sa_bo_gpu_addr
	str	w0, [x20, #24]
	ldr	x0, [x20, #8]
	bl	_radeon_sa_bo_cpu_addr
	mov	w1, #0
	mov	x2, x22
	bl	_memset
	mov	x0, x19
	bl	_radeon_vm_num_pdes
	lsl	w0, w0, #3
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_kzalloc
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20, #16]
	cbz	x8, LBB0_11
LBB0_10:
	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:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x21
	bl	_radeon_sa_bo_free
	ldr	w8, [x23]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_GPU_PAGE_SIZE,4,2       ; @RADEON_GPU_PAGE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory for page table array\n"

.subsections_via_symbols
