	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_object_open         ## -- Begin function amdgpu_gem_object_open
	.p2align	4, 0x90
_amdgpu_gem_object_open:                ## @amdgpu_gem_object_open
	.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, %rbx
	callq	_gem_to_amdgpu_bo
	movq	%rax, %r12
	movl	20(%rax), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, %r15
	movq	(%rbx), %r14
	movl	16(%r12), %edi
	callq	_amdgpu_ttm_tt_get_usermm
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_current@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
LBB0_3:
	movq	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.4:
	movq	8(%r12), %rax
	movq	(%r14), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
LBB0_5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	testl	%eax, %eax
	jne	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_amdgpu_vm_bo_find
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	incl	(%rax)
	jmp	LBB0_9
LBB0_2:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_7:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_amdgpu_vm_bo_add
LBB0_9:
	movq	%r12, %rdi
	callq	_amdgpu_bo_unreserve
	xorl	%eax, %eax
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_current,8,3                    ## @current
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,2 ## @AMDGPU_GEM_CREATE_VM_ALWAYS_VALID
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_object_open         ; -- Begin function amdgpu_gem_object_open
	.p2align	2
_amdgpu_gem_object_open:                ; @amdgpu_gem_object_open
	.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
	bl	_gem_to_amdgpu_bo
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_amdgpu_ttm_adev
	mov	x21, x0
	ldr	x20, [x20]
	ldr	w0, [x19, #16]
	bl	_amdgpu_ttm_tt_get_usermm
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _current@GOTPAGE
Lloh1:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
LBB0_2:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_VM_ALWAYS_VALID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
LBB0_4:
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	cbnz	w0, LBB0_10
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_amdgpu_vm_bo_find
	cbz	x0, LBB0_8
; %bb.6:
	ldr	w8, [x0]
	add	w8, w8, #1
	str	w8, [x0]
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x8, _EPERM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_amdgpu_vm_bo_add
LBB0_9:
	mov	x0, x19
	bl	_amdgpu_bo_unreserve
	mov	w0, #0
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_current,8,3                    ; @current
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,2 ; @AMDGPU_GEM_CREATE_VM_ALWAYS_VALID
.subsections_via_symbols
