	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_process_device_init_vm     ## -- Begin function kfd_process_device_init_vm
	.p2align	4, 0x90
_kfd_process_device_init_vm:            ## @kfd_process_device_init_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	xorl	%eax, %eax
	testq	%r14, %r14
	cmovel	%eax, %ebx
	jmp	LBB0_13
LBB0_2:
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	movq	24(%rdi), %r9
	leaq	4(%r9), %r8
	movl	(%r12), %edi
	movl	8(%r9), %edx
	testq	%r14, %r14
	je	LBB0_4
## %bb.3:
	movq	%r14, %rsi
	movq	%r15, %rcx
	callq	_amdgpu_amdkfd_gpuvm_acquire_process_vm
	jmp	LBB0_5
LBB0_4:
	movl	%edx, %esi
	movq	%r15, %rdx
	movq	%r8, %rcx
	movq	%r9, %r8
	callq	_amdgpu_amdkfd_gpuvm_create_process_vm
LBB0_5:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_13
LBB0_7:
	movq	(%r15), %rdi
	callq	_amdgpu_vm_set_task_info
	movq	%r15, %rdi
	callq	_kfd_process_device_reserve_ib_mem
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	movq	%r15, %rdi
	callq	_kfd_process_device_init_cwsr_dgpu
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_10:
	movq	%r15, %rdi
	callq	_kfd_process_device_free_bos
	testq	%r14, %r14
	jne	LBB0_12
## %bb.11:
	movl	(%r12), %edi
	movq	(%r15), %rsi
	callq	_amdgpu_amdkfd_gpuvm_destroy_process_vm
LBB0_12:
	movq	$0, (%r15)
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, 8(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create process VM object\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kfd_process_device_init_vm     ; -- Begin function kfd_process_device_init_vm
	.p2align	2
_kfd_process_device_init_vm:            ; @kfd_process_device_init_vm
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x20, #0
	csneg	w21, wzr, w8, eq
	b	LBB0_11
LBB0_2:
	mov	x19, x0
	ldp	x22, x5, [x0, #16]
	ldr	w0, [x22]
	ldr	w2, [x5, #8]
	add	x4, x5, #4
	cbz	x20, LBB0_5
; %bb.3:
	mov	x1, x20
	mov	x3, x19
	bl	_amdgpu_amdkfd_gpuvm_acquire_process_vm
	mov	x21, x0
	cbz	w0, LBB0_6
LBB0_4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_11
LBB0_5:
	mov	x1, x2
	mov	x2, x19
	mov	x3, x4
	mov	x4, x5
	bl	_amdgpu_amdkfd_gpuvm_create_process_vm
	mov	x21, x0
	cbnz	w0, LBB0_4
LBB0_6:
	ldr	x0, [x19]
	bl	_amdgpu_vm_set_task_info
	mov	x0, x19
	bl	_kfd_process_device_reserve_ib_mem
	mov	x21, x0
	cbnz	w0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_kfd_process_device_init_cwsr_dgpu
	mov	x21, x0
	cbz	w0, LBB0_12
LBB0_8:
	mov	x0, x19
	bl	_kfd_process_device_free_bos
	cbnz	x20, LBB0_10
; %bb.9:
	ldr	w0, [x22]
	ldr	x1, [x19]
	bl	_amdgpu_amdkfd_gpuvm_destroy_process_vm
LBB0_10:
	str	xzr, [x19]
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_12:
	str	x20, [x19, #8]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create process VM object\n"

.subsections_via_symbols
