	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reserve_bo_and_vm
_reserve_bo_and_vm:                     ## @reserve_bo_and_vm
	.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	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rdi), %r13
	xorl	%edi, %edi
	testq	%rsi, %rsi
	sete	%dil
	callq	_WARN_ON
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, (%rbx)
	movq	%r15, 56(%rbx)
	leaq	20(%rbx), %r15
	movq	%r15, %rdi
	callq	_INIT_LIST_HEAD
	leaq	16(%rbx), %r12
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
	movl	4(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	$0, 48(%rbx)
	movq	%r13, 40(%rbx)
	movl	$1, 32(%rbx)
	leaq	36(%rbx), %rdi
	movq	%r15, %rsi
	callq	_list_add
	movq	8(%rbx), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_amdgpu_vm_get_pd_bo
	leaq	24(%rbx), %rdi
	xorl	%r14d, %r14d
	movq	%r15, %rsi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movl	$1, %r8d
	callq	_ttm_eu_reserve_buffers
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	$0, 8(%rbx)
	movl	%r15d, %r14d
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_5
LBB0_3:
	movl	$1, (%rbx)
LBB0_5:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to reserve buffers in ttm\n"

	.no_dead_strip	_reserve_bo_and_vm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function reserve_bo_and_vm
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_reserve_bo_and_vm:                     ; @reserve_bo_and_vm
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x23, [x0, #8]
	cmp	x1, #0
	cset	w0, eq
	bl	_WARN_ON
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	str	x21, [x19, #56]
	add	x21, x19, #20
	mov	x0, x21
	bl	_INIT_LIST_HEAD
	add	x22, x19, #16
	mov	x0, x22
	bl	_INIT_LIST_HEAD
	ldr	w0, [x19, #4]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.1:
	stp	x23, xzr, [x19, #40]
	mov	w23, #1
	str	w23, [x19, #32]
	add	x0, x19, #36
	mov	x1, x21
	bl	_list_add
	ldr	x2, [x19, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_amdgpu_vm_get_pd_bo
	add	x0, x19, #24
	mov	x1, x21
	mov	w2, #0
	mov	x3, x22
	mov	w4, #1
	bl	_ttm_eu_reserve_buffers
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
	b	LBB0_5
LBB0_3:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
	str	w23, [x19]
LBB0_5:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to reserve buffers in ttm\n"

	.no_dead_strip	_reserve_bo_and_vm
.subsections_via_symbols
