	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_cs_user_fence_chunk
_amdgpu_cs_user_fence_chunk:            ## @amdgpu_cs_user_fence_chunk
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	movl	4(%rsi), %esi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_gem_to_amdgpu_bo
	movl	%eax, %edi
	callq	_amdgpu_bo_ref
	movq	%rax, %r12
	movq	%rax, -48(%rbp)
	movq	$0, 16(%rbx)
	movq	%rax, 8(%rbx)
	movl	$2, (%rbx)
	movq	%r13, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	%r12, %rdi
	callq	_amdgpu_bo_size
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movslq	(%r15), %rcx
	addq	$8, %rcx
	cmpq	%rcx, %rax
	jb	LBB0_6
## %bb.4:
	movl	(%r12), %edi
	callq	_amdgpu_ttm_tt_get_usermm
	testq	%rax, %rax
	je	LBB0_5
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	-48(%rbp), %rdi
	callq	_amdgpu_bo_unref
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	(%r15), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_amdgpu_cs_user_fence_chunk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_cs_user_fence_chunk
_amdgpu_cs_user_fence_chunk:            ; @amdgpu_cs_user_fence_chunk
	.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	x19, x2
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0, #24]
	ldr	w1, [x1, #4]
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_5
; %bb.1:
	mov	x23, x0
	bl	_gem_to_amdgpu_bo
	bl	_amdgpu_bo_ref
	mov	x21, x0
	str	x0, [sp, #8]
	stp	x0, xzr, [x22, #8]
	mov	w8, #2
	str	w8, [x22]
	mov	x0, x23
	bl	_drm_gem_object_put_unlocked
	mov	x0, x21
	bl	_amdgpu_bo_size
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	ldrsw	x8, [x20]
	add	x8, x8, #8
	cmp	x0, x8
	b.lo	LBB0_4
; %bb.3:
	ldr	w0, [x21]
	bl	_amdgpu_ttm_tt_get_usermm
	cbz	x0, LBB0_7
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	add	x0, sp, #8
	bl	_amdgpu_bo_unref
	b	LBB0_6
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	mov	x0, x21
	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
LBB0_7:
	mov	w21, #0
	ldr	w8, [x20]
	str	w8, [x19]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_amdgpu_cs_user_fence_chunk
.subsections_via_symbols
