	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_amdkfd_bo_validate
_amdgpu_amdkfd_bo_validate:             ## @amdgpu_amdkfd_bo_validate
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	$0, -40(%rbp)
	movl	4(%rdi), %edi
	callq	_amdgpu_ttm_tt_get_usermm
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_WARN
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_2:
	leaq	4(%r15), %r12
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_amdgpu_bo_placement_from_domain
	leaq	-40(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ttm_bo_validate
	movl	%eax, %ebx
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.3:
	testl	%ebx, %ebx
	jne	LBB0_5
## %bb.4:
	movq	_AMDGPU_FENCE_OWNER_KFD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_amdgpu_bo_sync_wait
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Called with userptr BO"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AMDGPU_FENCE_OWNER_KFD,4,2     ## @AMDGPU_FENCE_OWNER_KFD
	.no_dead_strip	_amdgpu_amdkfd_bo_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_amdkfd_bo_validate
_amdgpu_amdkfd_bo_validate:             ; @amdgpu_amdkfd_bo_validate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	str	xzr, [sp, #8]
	mov	x21, x0
	ldr	w0, [x21, #4]!
	bl	_amdgpu_ttm_tt_get_usermm
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_2:
	mov	x0, x19
	mov	x1, x22
	bl	_amdgpu_bo_placement_from_domain
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	bl	_ttm_bo_validate
	cbz	w20, LBB0_5
; %bb.3:
	cbnz	w0, LBB0_5
; %bb.4:
Lloh5:
	adrp	x8, _AMDGPU_FENCE_OWNER_KFD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AMDGPU_FENCE_OWNER_KFD@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_amdgpu_bo_sync_wait
	mov	w0, #0
LBB0_5:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Called with userptr BO"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AMDGPU_FENCE_OWNER_KFD,4,2     ; @AMDGPU_FENCE_OWNER_KFD
	.no_dead_strip	_amdgpu_amdkfd_bo_validate
.subsections_via_symbols
