	.file	"extr_amdgpu_ctx.c_amdgpu_ctx_add_fence.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	amdgpu_ctx_add_fence
	.type	amdgpu_ctx_add_fence, @function
amdgpu_ctx_add_fence:
.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
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	mov	rdi, 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, 24
	.cfi_def_cfa_offset 80
	call	to_amdgpu_ctx_entity@PLT
	mov	edx, DWORD PTR amdgpu_sched_jobs[rip]
	mov	rbx, rax
	mov	eax, DWORD PTR [rax]
	lea	ebp, -1[rdx]
	and	ebp, eax
	mov	DWORD PTR 12[rsp], eax
	mov	rax, QWORD PTR 8[rbx]
	mov	r15, QWORD PTR [rax+rbp*8]
	test	r15, r15
	je	.L2
	mov	rdi, r15
	call	dma_fence_is_signaled@PLT
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	BUG_ON@PLT
.L2:
	mov	rdi, r13
	call	dma_fence_get@PLT
	mov	rdi, r12
	call	spin_lock@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	rdi, r12
	mov	QWORD PTR [rax+rbp*8], r13
	add	DWORD PTR [rbx], 1
	call	spin_unlock@PLT
	mov	rdi, r15
	call	dma_fence_put@PLT
	test	r14, r14
	je	.L1
	mov	eax, DWORD PTR 12[rsp]
	mov	DWORD PTR [r14], eax
.L1:
	add	rsp, 24
	.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
	ret
	.cfi_endproc
.LFE0:
	.size	amdgpu_ctx_add_fence, .-amdgpu_ctx_add_fence
	.comm	amdgpu_sched_jobs,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_ctx.c_amdgpu_ctx_add_fence.c"
	.text
	.align	2
	.global	amdgpu_ctx_add_fence
	.syntax unified
	.arm
	.fpu softvfp
	.type	amdgpu_ctx_add_fence, %function
amdgpu_ctx_add_fence:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r7, r0
	mov	r0, r1
	mov	r8, r3
	mov	r6, r2
	bl	to_amdgpu_ctx_entity
	ldr	r3, .L12
	ldr	r9, [r0]
	ldr	r5, [r3]
	ldr	r3, [r0, #4]
	sub	r5, r5, #1
	and	r5, r5, r9
	ldr	r10, [r3, r5, lsl #2]
	mov	r4, r0
	cmp	r10, #0
	beq	.L2
	mov	r0, r10
	bl	dma_fence_is_signaled
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
.L2:
	mov	r0, r6
	bl	dma_fence_get
	mov	r0, r7
	bl	spin_lock
	ldr	r3, [r4]
	ldr	r2, [r4, #4]
	add	r3, r3, #1
	str	r6, [r2, r5, lsl #2]
	mov	r0, r7
	str	r3, [r4]
	bl	spin_unlock
	mov	r0, r10
	bl	dma_fence_put
	cmp	r8, #0
	strne	r9, [r8]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	.align	2
.L12:
	.word	amdgpu_sched_jobs
	.size	amdgpu_ctx_add_fence, .-amdgpu_ctx_add_fence
	.comm	amdgpu_sched_jobs,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
