	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_find_mapping         ## -- Begin function amdgpu_cs_find_mapping
	.p2align	4, 0x90
_amdgpu_cs_find_mapping:                ## @amdgpu_cs_find_mapping
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %r14
	movl	%esi, %eax
	movq	%rdi, %rbx
	movq	8(%rdi), %rcx
	movq	(%rcx), %rdi
	movq	$0, -32(%rbp)
	movq	_AMDGPU_GPU_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %esi
	callq	_amdgpu_vm_bo_lookup_mapping
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.2:
	movq	(%rcx), %rcx
	testq	%rcx, %rcx
	je	LBB0_3
## %bb.4:
	movq	%rcx, (%r14)
	movq	%rax, (%r15)
	movq	(%r14), %rax
	movl	4(%rax), %edi
	callq	_dma_resv_locking_ctx
	cmpq	%rbx, %rax
	je	LBB0_5
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%r14), %rdi
	movl	(%rdi), %eax
	movq	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_6
LBB0_8:
	addq	$4, %rdi
	callq	_amdgpu_ttm_alloc_gart
	jmp	LBB0_9
LBB0_6:
	orl	%eax, %ecx
	movl	%ecx, (%rdi)
	movl	12(%rdi), %esi
	callq	_amdgpu_bo_placement_from_domain
	movq	(%r14), %rsi
	leaq	4(%rsi), %rdi
	addq	$8, %rsi
	leaq	-32(%rbp), %rdx
	callq	_ttm_bo_validate
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	(%r14), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GPU_PAGE_SIZE,4,2       ## @AMDGPU_GPU_PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ## @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_find_mapping         ; -- Begin function amdgpu_cs_find_mapping
	.p2align	2
_amdgpu_cs_find_mapping:                ; @amdgpu_cs_find_mapping
	.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	x21, x3
	mov	x19, x2
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x0, [x8]
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _AMDGPU_GPU_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GPU_PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sdiv	w1, w1, w8
	bl	_amdgpu_vm_bo_lookup_mapping
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.3:
	str	x8, [x19]
	str	x0, [x21]
	ldr	x8, [x19]
	ldr	w0, [x8, #4]
	bl	_dma_resv_locking_ctx
	cmp	x0, x20
	b.eq	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
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
LBB0_6:
	ldr	x0, [x19]
	ldr	w8, [x0]
Lloh6:
	adrp	x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_7:
	add	x0, x0, #4
	bl	_amdgpu_ttm_alloc_gart
	b	LBB0_5
LBB0_8:
	orr	w8, w9, w8
	str	w8, [x0]
	ldr	w1, [x0, #12]
	bl	_amdgpu_bo_placement_from_domain
	ldr	x8, [x19]
	add	x0, x8, #4
	add	x1, x8, #8
	add	x2, sp, #8
	bl	_ttm_bo_validate
	cbnz	w0, LBB0_5
; %bb.9:
	ldr	x0, [x19]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GPU_PAGE_SIZE,4,2       ; @AMDGPU_GPU_PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS,4,2 ; @AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS
.subsections_via_symbols
