	.file	"extr_amdgpu_gem.c_amdgpu_gem_object_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	amdgpu_gem_object_open
	.type	amdgpu_gem_object_open, @function
amdgpu_gem_object_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	gem_to_amdgpu_bo@PLT
	mov	edi, DWORD PTR 20[rax]
	mov	rbp, rax
	call	amdgpu_ttm_adev@PLT
	mov	edi, DWORD PTR 16[rbp]
	mov	r14, QWORD PTR [r12]
	mov	r13, rax
	call	amdgpu_ttm_tt_get_usermm@PLT
	test	rax, rax
	je	.L2
	mov	rdx, QWORD PTR current[rip]
	cmp	QWORD PTR [rdx], rax
	je	.L2
.L5:
	mov	r12d, DWORD PTR EPERM[rip]
	neg	r12d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR AMDGPU_GEM_CREATE_VM_ALWAYS_VALID[rip], eax
	je	.L4
	mov	rax, QWORD PTR [r14]
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR 8[rbp], rax
	jne	.L5
.L4:
	xor	esi, esi
	mov	rdi, rbp
	call	amdgpu_bo_reserve@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	rsi, rbp
	mov	rdi, r14
	call	amdgpu_vm_bo_find@PLT
	test	rax, rax
	je	.L16
	add	DWORD PTR [rax], 1
.L7:
	mov	rdi, rbp
	call	amdgpu_bo_unreserve@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rdx, rbp
	mov	rsi, r14
	mov	rdi, r13
	call	amdgpu_vm_bo_add@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	amdgpu_gem_object_open, .-amdgpu_gem_object_open
	.comm	current,8,8
	.comm	EPERM,4,4
	.comm	AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_amdgpu_gem.c_amdgpu_gem_object_open.c"
	.text
	.align	2
	.global	amdgpu_gem_object_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	amdgpu_gem_object_open, %function
amdgpu_gem_object_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	bl	gem_to_amdgpu_bo
	mov	r4, r0
	ldr	r0, [r0, #12]
	bl	amdgpu_ttm_adev
	mov	r6, r0
	ldr	r0, [r4, #8]
	ldr	r7, [r5]
	bl	amdgpu_ttm_tt_get_usermm
	subs	r3, r0, #0
	beq	.L2
	ldr	r2, .L17
	ldr	r2, [r2]
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L2
.L5:
	ldr	r3, .L17+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r3, .L17+8
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L4
	ldr	r3, [r7]
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L5
.L4:
	mov	r1, #0
	mov	r0, r4
	bl	amdgpu_bo_reserve
	subs	r5, r0, #0
	bne	.L1
	mov	r1, r4
	mov	r0, r7
	bl	amdgpu_vm_bo_find
	cmp	r0, #0
	beq	.L16
	ldr	r3, [r0]
	add	r3, r3, #1
	str	r3, [r0]
.L7:
	mov	r0, r4
	bl	amdgpu_bo_unreserve
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r1, r7
	mov	r0, r6
	mov	r2, r4
	bl	amdgpu_vm_bo_add
	b	.L7
.L18:
	.align	2
.L17:
	.word	current
	.word	EPERM
	.word	AMDGPU_GEM_CREATE_VM_ALWAYS_VALID
	.size	amdgpu_gem_object_open, .-amdgpu_gem_object_open
	.comm	current,4,4
	.comm	EPERM,4,4
	.comm	AMDGPU_GEM_CREATE_VM_ALWAYS_VALID,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
