	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_create_reserved      ## -- Begin function amdgpu_bo_create_reserved
	.p2align	4, 0x90
_amdgpu_bo_create_reserved:             ## @amdgpu_bo_create_reserved
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r15
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movl	%ecx, %r13d
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	leaq	-88(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%r12, -88(%rbp)
	movl	%ebx, -80(%rbp)
	movl	%r13d, -56(%rbp)
	cmpq	$0, 16(%rbp)
	jne	LBB0_3
## %bb.4:
	movq	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movq	%r15, %rdi
	callq	_amdgpu_bo_unref
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_3:
	movq	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPCREL(%rip), %rax
LBB0_5:
	movq	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -60(%rbp)
	movq	_ttm_bo_type_kernel@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	$0, -72(%rbp)
	movq	(%r15), %r12
	movq	%r12, %rdi
	testq	%r12, %r12
	je	LBB0_6
LBB0_8:
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	testq	%r12, %r12
	jne	LBB0_23
	jmp	LBB0_22
LBB0_6:
	leaq	-88(%rbp), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_amdgpu_bo_create
	testl	%eax, %eax
	je	LBB0_7
## %bb.24:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_23
LBB0_10:
	movq	(%r15), %rdi
	movl	%r13d, %esi
	callq	_amdgpu_bo_pin
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_20
LBB0_7:
	movq	(%r15), %rdi
	jmp	LBB0_8
LBB0_12:
	movq	(%r15), %rdi
	callq	_amdgpu_ttm_alloc_gart
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	movl	(%r14), %edi
	movq	(%r15), %rdx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_14:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	(%r15), %rdi
	movq	%rax, %rbx
	callq	_amdgpu_bo_gpu_offset
	movl	%eax, (%rbx)
LBB0_16:
	xorl	%ebx, %ebx
	movq	16(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_23
## %bb.17:
	movq	(%r15), %rdi
	callq	_amdgpu_bo_kmap
	testl	%eax, %eax
	je	LBB0_23
## %bb.18:
	movl	%eax, %r13d
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r13d, %ebx
LBB0_19:
	movq	(%r15), %rdi
	callq	_amdgpu_bo_unpin
LBB0_20:
	movq	(%r15), %rdi
	callq	_amdgpu_bo_unreserve
	testq	%r12, %r12
	jne	LBB0_23
LBB0_22:
	movq	%r15, %rdi
	callq	_amdgpu_bo_unref
LBB0_23:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ## @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ## @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ## @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
	.comm	_ttm_bo_type_kernel,4,2         ## @ttm_bo_type_kernel
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) failed to allocate kernel bo\n"

L_.str.1:                               ## @.str.1
	.asciz	"(%d) failed to reserve kernel bo\n"

L_.str.2:                               ## @.str.2
	.asciz	"(%d) kernel bo pin failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"%p bind failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"(%d) kernel bo map failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_create_reserved      ; -- Begin function amdgpu_bo_create_reserved
	.p2align	2
_amdgpu_bo_create_reserved:             ; @amdgpu_bo_create_reserved
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x4
	cbz	x1, LBB0_4
; %bb.1:
	mov	x21, x6
	mov	x22, x5
	mov	x24, x3
	mov	x23, x2
	mov	x25, x1
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	str	x25, [sp, #8]
Lloh0:
	adrp	x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGEOFF]
	str	w23, [sp, #16]
	str	w24, [sp, #40]
Lloh2:
	adrp	x9, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGEOFF]
	cmp	x21, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh7:
	adrp	x9, _ttm_bo_type_kernel@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ttm_bo_type_kernel@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #32]
	str	xzr, [sp, #24]
	ldr	x25, [x19]
	mov	x0, x25
	cbz	x25, LBB0_5
LBB0_2:
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	cbz	w0, LBB0_7
; %bb.3:
	mov	x23, x0
	ldr	w0, [x20]
	str	x23, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	cbnz	x25, LBB0_15
	b	LBB0_14
LBB0_4:
	mov	x0, x19
	bl	_amdgpu_bo_unref
	mov	w23, #0
	b	LBB0_15
LBB0_5:
	add	x1, sp, #8
	mov	x0, x20
	mov	x2, x19
	bl	_amdgpu_bo_create
	cbz	w0, LBB0_9
; %bb.6:
	mov	x23, x0
	ldr	w0, [x20]
	str	x23, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_15
LBB0_7:
	ldr	x0, [x19]
	mov	x1, x24
	bl	_amdgpu_bo_pin
	cbz	w0, LBB0_10
; %bb.8:
	mov	x23, x0
	ldr	w0, [x20]
	str	x23, [sp]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	b	LBB0_13
LBB0_9:
	ldr	x0, [x19]
	b	LBB0_2
LBB0_10:
	ldr	x0, [x19]
	bl	_amdgpu_ttm_alloc_gart
	cbz	w0, LBB0_16
; %bb.11:
	mov	x23, x0
	ldr	w0, [x20]
	ldr	x8, [x19]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_12:
	ldr	x0, [x19]
	bl	_amdgpu_bo_unpin
LBB0_13:
	ldr	x0, [x19]
	bl	_amdgpu_bo_unreserve
	cbnz	x25, LBB0_15
LBB0_14:
	mov	x0, x19
	bl	_amdgpu_bo_unref
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
	cbz	x22, LBB0_18
; %bb.17:
	ldr	x0, [x19]
	bl	_amdgpu_bo_gpu_offset
	str	w0, [x22]
LBB0_18:
	cbz	x21, LBB0_21
; %bb.19:
	ldr	x0, [x19]
	mov	x1, x21
	bl	_amdgpu_bo_kmap
	mov	x23, x0
	cbz	w0, LBB0_15
; %bb.20:
	ldr	w0, [x20]
	str	x23, [sp]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	b	LBB0_12
LBB0_21:
	mov	w23, #0
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ; @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ; @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ; @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
	.comm	_ttm_bo_type_kernel,4,2         ; @ttm_bo_type_kernel
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) failed to allocate kernel bo\n"

l_.str.1:                               ; @.str.1
	.asciz	"(%d) failed to reserve kernel bo\n"

l_.str.2:                               ; @.str.2
	.asciz	"(%d) kernel bo pin failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"%p bind failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"(%d) kernel bo map failed\n"

.subsections_via_symbols
