	.file	"extr_amdgpu_cs.c_amdgpu_cs_wait_any_fence.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	amdgpu_cs_wait_any_fence, @function
amdgpu_cs_wait_any_fence:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rcx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR 4[rdx]
	mov	QWORD PTR 16[rsp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	amdgpu_gem_timeout@PLT
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	esi, 8
	mov	DWORD PTR 36[rsp], -1
	mov	QWORD PTR 24[rsp], rax
	mov	eax, DWORD PTR [r15]
	mov	edi, eax
	mov	DWORD PTR 4[rsp], eax
	call	kcalloc@PLT
	test	rax, rax
	je	.L29
	mov	rbp, rax
	mov	eax, DWORD PTR 4[rsp]
	xor	r15d, r15d
	lea	esi, -1[rax]
	mov	QWORD PTR 8[rsp], rsi
	test	eax, eax
	jne	.L7
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L4:
	test	r12, r12
	je	.L6
	mov	QWORD PTR 0[rbp+r15*8], r12
	lea	rax, 1[r15]
	add	rbx, 4
	cmp	QWORD PTR 8[rsp], r15
	je	.L31
	mov	r15, rax
.L7:
	mov	rdi, r13
	mov	rdx, rbx
	mov	rsi, r14
	call	amdgpu_cs_get_fence@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	rax, rax
	je	.L4
	mov	rdi, r12
	call	PTR_ERR@PLT
	mov	r13d, eax
.L5:
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, QWORD PTR 0[rbp+rbx*8]
	add	rbx, 1
	call	dma_fence_put@PLT
	cmp	DWORD PTR 4[rsp], ebx
	ja	.L14
.L16:
	mov	rdi, rbp
	call	kfree@PLT
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L32
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	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
.L6:
	.cfi_restore_state
	mov	rbx, QWORD PTR 16[rsp]
	mov	edx, 8
	xor	esi, esi
	mov	DWORD PTR 36[rsp], r15d
	mov	rdi, rbx
	call	memset@PLT
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR [rbx], 1
	mov	DWORD PTR 4[rbx], eax
	cmp	DWORD PTR 4[rsp], eax
	ja	.L9
.L13:
	xor	r13d, r13d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rcx, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR 4[rsp]
	lea	r8, 36[rsp]
	mov	rdi, rbp
	mov	edx, 1
	call	dma_fence_wait_any_timeout@PLT
	mov	r13, rax
	test	rax, rax
	js	.L5
.L12:
	endbr64
	mov	rbx, QWORD PTR 16[rsp]
	xor	esi, esi
	mov	edx, 8
	mov	rdi, rbx
	call	memset@PLT
	xor	eax, eax
	test	r13, r13
	setg	al
	mov	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR 4[rbx], eax
	cmp	eax, DWORD PTR 4[rsp]
	jnb	.L13
.L9:
	mov	rax, QWORD PTR 0[rbp+rax*8]
	test	rax, rax
	je	.L13
	mov	r13d, DWORD PTR [rax]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L29:
	mov	r13d, DWORD PTR ENOMEM[rip]
	neg	r13d
	jmp	.L1
.L30:
	mov	rcx, QWORD PTR 24[rsp]
	lea	r8, 36[rsp]
	xor	esi, esi
	mov	rdi, rbp
	mov	edx, 1
	call	dma_fence_wait_any_timeout@PLT
	mov	r13, rax
	test	rax, rax
	js	.L16
	mov	rbx, QWORD PTR 16[rsp]
	xor	esi, esi
	mov	edx, 8
	mov	rdi, rbx
	call	memset@PLT
	xor	eax, eax
	test	r13, r13
	setg	al
	xor	r13d, r13d
	mov	DWORD PTR [rbx], eax
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR 4[rbx], eax
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	amdgpu_cs_wait_any_fence, .-amdgpu_cs_wait_any_fence
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,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_cs.c_amdgpu_cs_wait_any_fence.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	amdgpu_cs_wait_any_fence, %function
amdgpu_cs_wait_any_fence:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	sub	sp, sp, #36
	ldr	r3, .L36
	str	r2, [sp, #16]
	mov	r8, r0
	ldr	r0, [r2, #4]
	mov	r5, r2
	mov	r9, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	amdgpu_gem_timeout
	mvn	r3, #0
	mov	ip, r0
	ldr	r5, [r5]
	ldr	r2, .L36+4
	mov	r0, r5
	mov	r1, #4
	ldr	r2, [r2]
	str	r3, [sp, #24]
	str	ip, [sp, #20]
	bl	kcalloc
	subs	r3, r0, #0
	str	r3, [sp, #8]
	beq	.L30
	cmp	r5, #0
	beq	.L31
	ldr	r3, [sp, #8]
	mov	r10, r4
	sub	r7, r3, #4
	mov	r6, #0
	str	r7, [sp, #12]
	b	.L7
.L4:
	cmp	fp, #0
	beq	.L6
	add	r6, r6, #1
	cmp	r5, r6
	str	fp, [r7, #4]!
	add	r10, r10, #4
	beq	.L32
.L7:
	mov	r2, r10
	mov	r1, r9
	mov	r0, r8
	bl	amdgpu_cs_get_fence
	mov	fp, r0
	bl	IS_ERR
	cmp	r0, #0
	lsl	r3, r6, #2
	beq	.L4
	mov	r0, fp
	bl	PTR_ERR
	mov	r4, r0
.L5:
	mov	r7, #0
	ldr	r6, [sp, #12]
.L14:
	ldr	r0, [r6, #4]!
	add	r7, r7, #1
	bl	dma_fence_put
	cmp	r5, r7
	bhi	.L14
.L15:
	ldr	r0, [sp, #8]
	bl	kfree
.L1:
	ldr	r3, .L36
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	mov	r2, #1
	mov	r4, r0
	mov	r0, r3
	ldr	r3, [sp, #16]
	cmp	r5, r6
	stm	r3, {r2, r6}
	str	r6, [sp, #24]
	bls	.L5
	ldr	r3, [sp, #8]
	ldr	r3, [r3, r0]
	cmp	r3, #0
	beq	.L5
.L35:
	ldr	r4, [r3]
	b	.L5
.L32:
	add	r2, sp, #24
	str	r2, [sp]
	mov	r4, r0
	mov	r2, #1
	mov	r1, r5
	ldr	r3, [sp, #20]
	ldr	r0, [sp, #8]
	bl	dma_fence_wait_any_timeout
	cmp	r0, #0
	blt	.L34
.L12:
	movgt	r3, #1
	movle	r3, #0
	ldr	r0, [sp, #24]
	ldr	r2, [sp, #16]
	cmp	r0, r5
	str	r3, [r2]
	str	r0, [r2, #4]
	bcs	.L5
	ldr	r3, [sp, #8]
	lsl	r0, r0, #2
	ldr	r3, [r3, r0]
	cmp	r3, #0
	bne	.L35
	b	.L5
.L34:
	mov	r4, r0
	b	.L5
.L30:
	ldr	r3, .L36+8
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L31:
	add	r2, sp, #24
	str	r2, [sp]
	mov	r1, r5
	mov	r2, #1
	ldr	r3, [sp, #20]
	bl	dma_fence_wait_any_timeout
	subs	r4, r0, #0
	blt	.L15
	movgt	r2, #1
	movle	r2, #0
	ldr	r3, [sp, #24]
	ldr	r1, [sp, #16]
	mov	r4, r5
	stm	r1, {r2, r3}
	b	.L15
.L33:
	bl	__stack_chk_fail
.L37:
	.align	2
.L36:
	.word	.LC0
	.word	GFP_KERNEL
	.word	ENOMEM
	.size	amdgpu_cs_wait_any_fence, .-amdgpu_cs_wait_any_fence
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
