	.file	"extr_nouveau_gem.c_nouveau_gem_pushbuf_reloc_apply.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"reloc bo index invalid\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"reloc container bo index invalid\n"
	.section	.rodata.str1.1
.LC2:
	.string	"reloc outside of bo\n"
.LC3:
	.string	"failed kmap for reloc\n"
.LC4:
	.string	"reloc wait_idle failed: %d\n"
	.text
	.p2align 4
	.type	nouveau_gem_pushbuf_reloc_apply, @function
nouveau_gem_pushbuf_reloc_apply:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	QWORD PTR 40[rsp], rdi
	mov	edi, DWORD PTR 16[rsi]
	mov	esi, DWORD PTR [rsi]
	mov	QWORD PTR 8[rsp], rdx
	mov	edx, 40
	call	u_memcpya@PLT
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L2
	mov	edx, DWORD PTR [r12]
	test	edx, edx
	je	.L16
	xor	ebp, ebp
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L34:
	add	r10d, DWORD PTR [rbx]
.L12:
	test	DWORD PTR NOUVEAU_GEM_RELOC_OR[rip], eax
	je	.L13
	mov	rax, QWORD PTR NOUVEAU_GEM_DOMAIN_GART[rip]
	cmp	QWORD PTR 8[rbx], rax
	je	.L28
	or	r10d, DWORD PTR 32[r14]
.L13:
	mov	rdi, QWORD PTR 8[r13]
	mov	DWORD PTR 24[rsp], r10d
	mov	QWORD PTR 32[rsp], r11
	call	spin_lock@PLT
	mov	r11, QWORD PTR 32[rsp]
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	mov	rdi, r11
	call	ttm_bo_wait@PLT
	mov	rdi, QWORD PTR 8[r13]
	mov	r15d, eax
	call	spin_unlock@PLT
	test	r15d, r15d
	mov	r10d, DWORD PTR 24[rsp]
	jne	.L29
	mov	esi, DWORD PTR 16[r14]
	mov	edx, r10d
	mov	rdi, r13
	sar	esi, 2
	call	nouveau_bo_wr32@PLT
.L6:
	add	ebp, 1
	cmp	DWORD PTR [r12], ebp
	jbe	.L16
.L3:
	mov	rcx, QWORD PTR 16[rsp]
	mov	eax, ebp
	xor	edi, edi
	lea	rax, [rax+rax*4]
	lea	r14, [rcx+rax*8]
	mov	rax, QWORD PTR 8[r12]
	cmp	QWORD PTR [r14], rax
	seta	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L30
	mov	rbx, QWORD PTR [r14]
	sal	rbx, 5
	add	rbx, QWORD PTR 8[rsp]
	cmp	QWORD PTR 16[rbx], 0
	jne	.L6
	xor	edi, edi
	mov	rax, QWORD PTR 8[r12]
	cmp	QWORD PTR 8[r14], rax
	seta	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L31
	mov	rax, QWORD PTR 8[r14]
	mov	rdx, QWORD PTR 8[rsp]
	xor	edi, edi
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	sal	rax, 5
	mov	r13, QWORD PTR 24[rdx+rax]
	mov	eax, DWORD PTR 16[r14]
	lea	edx, 3[rax]
	mov	eax, DWORD PTR 16[r13]
	sal	eax, cl
	cmp	edx, eax
	setge	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L32
	mov	eax, DWORD PTR 24[r13]
	lea	r11, 8[r13]
	test	eax, eax
	je	.L33
.L9:
	mov	eax, DWORD PTR 20[r14]
	mov	r10d, DWORD PTR 24[r14]
	test	DWORD PTR NOUVEAU_GEM_RELOC_LOW[rip], eax
	jne	.L34
	test	DWORD PTR NOUVEAU_GEM_RELOC_HIGH[rip], eax
	je	.L12
	add	r10d, DWORD PTR [rbx]
	mov	ecx, 32
	sar	r10d, cl
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L33:
	mov	edx, DWORD PTR 16[r13]
	xor	esi, esi
	mov	rdi, r11
	lea	rcx, 24[r13]
	mov	QWORD PTR 24[rsp], r11
	call	ttm_bo_kmap@PLT
	mov	r11, QWORD PTR 24[rsp]
	test	eax, eax
	mov	r15d, eax
	jne	.L35
	mov	DWORD PTR 0[r13], 1
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L28:
	or	r10d, DWORD PTR 28[r14]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L16:
	xor	r15d, r15d
.L4:
	mov	rdi, QWORD PTR 16[rsp]
	call	kfree@PLT
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
.L26:
	mov	rdi, QWORD PTR 40[rsp]
	xor	eax, eax
	call	NV_ERROR@PLT
	mov	r15d, DWORD PTR EINVAL[rip]
	neg	r15d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, QWORD PTR 16[rsp]
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	PTR_ERR@PLT
.L31:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	jmp	.L26
.L32:
	lea	rsi, .LC2[rip]
	jmp	.L26
.L29:
	mov	rdi, QWORD PTR 40[rsp]
	mov	edx, r15d
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	NV_ERROR@PLT
	jmp	.L4
.L35:
	mov	rdi, QWORD PTR 40[rsp]
	lea	rsi, .LC3[rip]
	xor	eax, eax
	call	NV_ERROR@PLT
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	nouveau_gem_pushbuf_reloc_apply, .-nouveau_gem_pushbuf_reloc_apply
	.comm	PAGE_SHIFT,4,4
	.comm	NOUVEAU_GEM_RELOC_OR,4,4
	.comm	NOUVEAU_GEM_RELOC_LOW,4,4
	.comm	NOUVEAU_GEM_RELOC_HIGH,4,4
	.comm	NOUVEAU_GEM_DOMAIN_GART,8,8
	.comm	EINVAL,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_nouveau_gem.c_nouveau_gem_pushbuf_reloc_apply.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"reloc bo index invalid\012\000"
	.align	2
.LC1:
	.ascii	"reloc container bo index invalid\012\000"
	.align	2
.LC2:
	.ascii	"reloc outside of bo\012\000"
	.align	2
.LC3:
	.ascii	"failed kmap for reloc\012\000"
	.align	2
.LC4:
	.ascii	"reloc wait_idle failed: %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nouveau_gem_pushbuf_reloc_apply, %function
nouveau_gem_pushbuf_reloc_apply:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r1
	mov	ip, r0
	sub	sp, sp, #20
	ldr	r1, [r1]
	mov	fp, r2
	ldr	r0, [r6, #8]
	mov	r2, #28
	str	ip, [sp, #12]
	bl	u_memcpya
	str	r0, [sp, #8]
	bl	IS_ERR
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L2
	ldr	r3, [r6]
	cmp	r3, #0
	beq	.L4
	ldr	r4, [sp, #8]
	ldr	r7, [sp, #4]
	b	.L16
.L33:
	ldr	r2, [fp, r8, lsl #4]
	add	r10, r10, r2
.L12:
	ldr	r2, .L35
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L13
	ldr	r3, .L35+4
	ldr	r2, [r9, #4]
	ldr	r3, [r3]
	cmp	r2, r3
	ldreq	r3, [r4, #20]
	ldrne	r3, [r4, #24]
	orr	r10, r10, r3
.L13:
	ldr	r0, [r5, #4]
	bl	spin_lock
	mov	r3, #0
	add	r0, r5, #4
	mov	r2, r3
	mov	r1, r3
	bl	ttm_bo_wait
	mov	r8, r0
	ldr	r0, [r5, #4]
	bl	spin_unlock
	cmp	r8, #0
	bne	.L28
	ldr	r1, [r4, #8]
	mov	r2, r10
	mov	r0, r5
	asr	r1, r1, #2
	bl	nouveau_bo_wr32
.L6:
	ldr	r3, [r6]
	add	r7, r7, #1
	cmp	r3, r7
	add	r4, r4, #28
	bls	.L4
.L16:
	ldr	r0, [r4]
	ldr	r3, [r6, #4]
	cmp	r0, r3
	movls	r0, #0
	movhi	r0, #1
	bl	unlikely
	cmp	r0, #0
	bne	.L29
	ldr	r8, [r4]
	add	r9, fp, r8, lsl #4
	ldr	r3, [r9, #8]
	cmp	r3, #0
	bne	.L6
	ldr	r0, [r4, #4]
	ldr	r3, [r6, #4]
	cmp	r0, r3
	movls	r0, #0
	movhi	r0, #1
	bl	unlikely
	cmp	r0, #0
	bne	.L30
	ldmib	r4, {r2, r3}
	add	r2, fp, r2, lsl #4
	ldr	r5, [r2, #12]
	ldr	r2, .L35+8
	ldr	r1, [r5, #8]
	ldr	r2, [r2]
	add	r3, r3, #3
	cmp	r3, r1, lsl r2
	movge	r0, #1
	movlt	r0, #0
	bl	unlikely
	cmp	r0, #0
	bne	.L31
	ldr	r1, [r5, #12]
	add	r3, r5, #4
	cmp	r1, #0
	str	r3, [sp]
	beq	.L32
.L9:
	ldr	r2, .L35+12
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	ldr	r10, [r4, #16]
	tst	r3, r2
	bne	.L33
	ldr	r2, .L35+16
	ldr	r2, [r2]
	tst	r3, r2
	movne	r1, #32
	ldrne	r2, [fp, r8, lsl #4]
	addne	r10, r10, r2
	asrne	r10, r10, r1
	b	.L12
.L32:
	ldr	r2, [r5, #8]
	add	r3, r5, #12
	add	r0, r5, #4
	bl	ttm_bo_kmap
	cmp	r0, #0
	bne	.L34
	mov	r3, #1
	str	r3, [r5]
	b	.L9
.L30:
	ldr	r0, [sp, #12]
	ldr	r1, .L35+20
.L26:
	bl	NV_ERROR
	ldr	r3, .L35+24
	ldr	r3, [r3]
	rsb	r3, r3, #0
	str	r3, [sp, #4]
.L4:
	ldr	r0, [sp, #8]
	bl	kfree
	ldr	r0, [sp, #4]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L29:
	ldr	r0, [sp, #12]
	ldr	r1, .L35+28
	bl	NV_ERROR
	ldr	r3, .L35+24
	ldr	r0, [r3]
	rsb	r3, r0, #0
	str	r3, [sp, #4]
	b	.L4
.L2:
	ldr	r0, [sp, #8]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	PTR_ERR
.L31:
	ldr	r0, [sp, #12]
	ldr	r1, .L35+32
	b	.L26
.L28:
	mov	r2, r8
	ldr	r0, [sp, #12]
	ldr	r1, .L35+36
	str	r8, [sp, #4]
	bl	NV_ERROR
	b	.L4
.L34:
	mov	r3, r0
	ldr	r1, .L35+40
	ldr	r0, [sp, #12]
	str	r3, [sp, #4]
	bl	NV_ERROR
	b	.L4
.L36:
	.align	2
.L35:
	.word	NOUVEAU_GEM_RELOC_OR
	.word	NOUVEAU_GEM_DOMAIN_GART
	.word	PAGE_SHIFT
	.word	NOUVEAU_GEM_RELOC_LOW
	.word	NOUVEAU_GEM_RELOC_HIGH
	.word	.LC1
	.word	EINVAL
	.word	.LC0
	.word	.LC2
	.word	.LC4
	.word	.LC3
	.size	nouveau_gem_pushbuf_reloc_apply, .-nouveau_gem_pushbuf_reloc_apply
	.comm	PAGE_SHIFT,4,4
	.comm	NOUVEAU_GEM_RELOC_OR,4,4
	.comm	NOUVEAU_GEM_RELOC_LOW,4,4
	.comm	NOUVEAU_GEM_RELOC_HIGH,4,4
	.comm	NOUVEAU_GEM_DOMAIN_GART,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
