	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function map_bo_to_gpuvm
_map_bo_to_gpuvm:                       ## @map_bo_to_gpuvm
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	8(%rsi), %rbx
	movl	(%rsi), %r12d
	movl	(%rbx), %edi
	callq	_amdgpu_bo_size
	movl	4(%r14), %r9d
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	callq	_amdgpu_vm_bo_map
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r12d
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_err
	movl	%r12d, %r13d
	jmp	LBB0_5
LBB0_2:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_update_gpuvm_pte
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_unmap_bo_from_gpuvm
	movl	%ebx, %r13d
LBB0_5:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to map VA 0x%llx in vm. ret %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"update_gpuvm_pte() failed\n"

	.no_dead_strip	_map_bo_to_gpuvm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function map_bo_to_gpuvm
_map_bo_to_gpuvm:                       ; @map_bo_to_gpuvm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x23, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x22, [x1, #8]
	ldr	w24, [x1]
	ldr	w0, [x22]
	bl	_amdgpu_bo_size
	mov	x4, x0
	ldr	w5, [x19, #4]
	mov	x0, x21
	mov	x1, x22
	mov	x2, x24
	mov	w3, #0
	bl	_amdgpu_vm_bo_map
	cbz	w0, LBB0_2
; %bb.1:
	mov	x22, x0
	ldr	w8, [x19]
	stp	x8, x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_6
LBB0_2:
	cbz	w23, LBB0_4
; %bb.3:
	mov	w22, #0
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_update_gpuvm_pte
	mov	x22, x0
	cbz	w0, LBB0_6
; %bb.5:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_unmap_bo_from_gpuvm
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to map VA 0x%llx in vm. ret %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"update_gpuvm_pte() failed\n"

	.no_dead_strip	_map_bo_to_gpuvm
.subsections_via_symbols
