	.file	"extr_drm_gem_vram_helper.c_drm_gem_vram_unpin.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	drm_gem_vram_unpin
	.type	drm_gem_vram_unpin, @function
drm_gem_vram_unpin:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	ecx, ecx
	xor	edx, edx
	mov	esi, 1
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	QWORD PTR [rsp], 0
	call	ttm_bo_reserve@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	xor	edi, edi
	cmp	QWORD PTR 16[rbp], 0
	sete	dil
	call	WARN_ON_ONCE@PLT
	test	rax, rax
	jne	.L3
	sub	QWORD PTR 16[rbp], 1
	jne	.L3
	mov	eax, DWORD PTR 4[rbp]
	test	eax, eax
	jle	.L4
	mov	rcx, QWORD PTR 8[rbp]
	sub	eax, 1
	lea	rdx, 4[rcx]
	lea	rsi, [rdx+rax*4]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	add	rdx, 4
.L5:
	mov	eax, DWORD PTR TTM_PL_FLAG_NO_EVICT[rip]
	not	eax
	and	DWORD PTR [rcx], eax
	mov	rcx, rdx
	cmp	rdx, rsi
	jne	.L10
.L4:
	mov	rdx, rsp
	lea	rsi, 4[rbp]
	mov	rdi, rbp
	call	ttm_bo_validate@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L11
.L3:
	mov	rdi, rbp
	xor	r12d, r12d
	call	ttm_bo_unreserve@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, rbp
	call	ttm_bo_unreserve@PLT
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	drm_gem_vram_unpin, .-drm_gem_vram_unpin
	.comm	TTM_PL_FLAG_NO_EVICT,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_drm_gem_vram_helper.c_drm_gem_vram_unpin.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	drm_gem_vram_unpin
	.syntax unified
	.arm
	.fpu softvfp
	.type	drm_gem_vram_unpin, %function
drm_gem_vram_unpin:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r3, #0
	push	{r4, r5, lr}
	ldr	ip, .L12
	sub	sp, sp, #20
	mov	r2, r3
	mov	r1, #1
	ldr	ip, [ip]
	str	ip, [sp, #12]
	mov	ip,#0
	mov	r5, r0
	str	r3, [sp, #4]
	str	r3, [sp, #8]
	bl	ttm_bo_reserve
	subs	r4, r0, #0
	blt	.L1
	ldr	r0, [r5, #12]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	WARN_ON_ONCE
	cmp	r0, #0
	bne	.L3
	ldr	r3, [r5, #12]
	sub	r3, r3, #1
	cmp	r3, #0
	str	r3, [r5, #12]
	bne	.L3
	ldr	r0, [r5, #4]
	cmp	r0, #0
	ble	.L4
	ldr	r3, [r5, #8]
	ldr	ip, .L12+4
	sub	r3, r3, #4
	add	r0, r3, r0, lsl #2
.L5:
	ldr	r2, [r3, #4]!
	ldr	r1, [ip]
	cmp	r0, r3
	bic	r2, r2, r1
	str	r2, [r3]
	bne	.L5
.L4:
	mov	r0, r5
	add	r2, sp, #4
	add	r1, r5, #4
	bl	ttm_bo_validate
	subs	r4, r0, #0
	blt	.L10
.L3:
	mov	r0, r5
	bl	ttm_bo_unreserve
	mov	r4, #0
.L1:
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, pc}
.L10:
	mov	r0, r5
	bl	ttm_bo_unreserve
	b	.L1
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	.LC0
	.word	TTM_PL_FLAG_NO_EVICT
	.size	drm_gem_vram_unpin, .-drm_gem_vram_unpin
	.comm	TTM_PL_FLAG_NO_EVICT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
