	.file	"extr_mthca_cq.c_mthca_poll_cq.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mthca_poll_cq
	.type	mthca_poll_cq, @function
mthca_poll_cq:
.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, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xor	ebx, ebx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR [rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	to_mdev@PLT
	mov	rdi, r12
	xor	r12d, r12d
	mov	rbp, rax
	call	to_mcq@PLT
	xor	esi, esi
	mov	DWORD PTR 28[rsp], 0
	mov	QWORD PTR 32[rsp], 0
	mov	r15, rax
	add	rax, 4
	mov	rdi, rax
	mov	QWORD PTR 8[rsp], rax
	call	spin_lock_irqsave@PLT
.L2:
	cmp	r12d, r13d
	jl	.L4
.L3:
	mov	eax, DWORD PTR 28[rsp]
	test	eax, eax
	jne	.L28
.L5:
	xor	edi, edi
	mov	eax, ebx
	add	eax, DWORD PTR EAGAIN[rip]
	je	.L29
.L6:
	call	unlikely@PLT
	test	rax, rax
	je	.L7
.L30:
	mov	rdi, rbp
	call	mthca_is_memfree@PLT
	mov	esi, DWORD PTR [r15]
	test	eax, eax
	jne	.L9
	and	esi, DWORD PTR 16[r15]
	mov	DWORD PTR [r15], esi
.L9:
	mov	rdi, QWORD PTR 8[r15]
	and	esi, DWORD PTR 8[rdi]
	add	rdi, 12
	call	get_cqe_from_buf@PLT
	mov	edi, eax
	call	cqe_sw@PLT
	test	rax, rax
	je	.L7
	mov	rax, QWORD PTR 8[r15]
	mov	rdx, QWORD PTR 16[r15]
	mov	ecx, DWORD PTR 12[rax]
	mov	DWORD PTR 20[r15], ecx
	mov	ecx, DWORD PTR 8[rax]
	mov	DWORD PTR 16[r15], ecx
	mov	QWORD PTR 8[rax], rdx
	mov	rdx, QWORD PTR CQ_RESIZE_SWAPPED[rip]
	mov	QWORD PTR [rax], rdx
	cmp	r12d, r13d
	jge	.L3
.L4:
	movsx	rax, r12d
	lea	rcx, 28[rsp]
	lea	rdx, 32[rsp]
	mov	rsi, r15
	lea	r8, [r14+rax*4]
	mov	rdi, rbp
	call	mthca_poll_one@PLT
	mov	ebx, eax
	test	eax, eax
	jne	.L3
	add	r12d, 1
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rax, QWORD PTR 8[r15]
	test	rax, rax
	je	.L6
	xor	edi, edi
	mov	rcx, QWORD PTR CQ_RESIZE_READY[rip]
	cmp	QWORD PTR [rax], rcx
	sete	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L30
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, QWORD PTR 8[rsp]
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	test	ebx, ebx
	jne	.L31
.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, r12d
	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
.L28:
	.cfi_restore_state
	xor	eax, eax
	call	wmb@PLT
	mov	edx, DWORD PTR 28[rsp]
	mov	rsi, r15
	mov	rdi, rbp
	call	update_cons_index@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	mov	eax, ebx
	add	eax, DWORD PTR EAGAIN[rip]
	cmovne	r12d, ebx
	jmp	.L1
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mthca_poll_cq, .-mthca_poll_cq
	.comm	EAGAIN,4,4
	.comm	CQ_RESIZE_SWAPPED,8,8
	.comm	CQ_RESIZE_READY,8,8
	.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_mthca_cq.c_mthca_poll_cq.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mthca_poll_cq
	.syntax unified
	.arm
	.fpu softvfp
	.type	mthca_poll_cq, %function
mthca_poll_cq:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L33
	sub	sp, sp, #36
	str	r2, [sp, #8]
	mov	r4, r0
	ldr	r0, [r0]
	mov	r8, r1
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	to_mdev
	mov	r7, r0
	mov	r0, r4
	bl	to_mcq
	mov	r3, #0
	add	r2, r0, #4
	mov	r4, r0
	mov	r1, r3
	mov	r0, r2
	mov	r6, r3
	mov	r5, r3
	str	r2, [sp, #12]
	str	r3, [sp, #20]
	str	r3, [sp, #24]
	bl	spin_lock_irqsave
	ldr	r9, .L33+4
	ldr	r10, .L33+8
	ldr	fp, .L33+12
.L2:
	cmp	r6, r8
	blt	.L4
.L3:
	ldr	r3, [sp, #24]
	cmp	r3, #0
	bne	.L30
.L5:
	ldr	r3, [r9]
	cmn	r5, r3
	movne	r0, #0
	bne	.L6
	ldr	r0, [r4, #8]
	cmp	r0, #0
	ldrne	r0, [r0]
	ldrne	r3, [fp]
	subne	r0, r0, r3
	clzne	r0, r0
	lsrne	r0, r0, #5
.L6:
	bl	unlikely
	cmp	r0, #0
	beq	.L7
	mov	r0, r7
	bl	mthca_is_memfree
	cmp	r0, #0
	ldr	r3, [r4]
	ldreq	r1, [r4, #12]
	ldr	r0, [r4, #8]
	andeq	r3, r3, r1
	ldr	r1, [r0, #4]
	streq	r3, [r4]
	and	r1, r1, r3
	add	r0, r0, #8
	bl	get_cqe_from_buf
	bl	cqe_sw
	cmp	r0, #0
	beq	.L7
	ldr	r3, [r4, #8]
	ldr	r0, [r4, #16]
	ldr	r2, [r3, #8]
	ldr	r1, [r4, #12]
	ldr	ip, [r3, #4]
	str	r2, [r4, #16]
	ldr	r2, [r10]
	cmp	r6, r8
	str	ip, [r4, #12]
	str	r0, [r3, #8]
	str	r1, [r3, #4]
	str	r2, [r3]
	bge	.L3
.L4:
	ldr	r3, [sp, #8]
	mov	r1, r4
	add	r3, r3, r6, lsl #2
	str	r3, [sp]
	mov	r0, r7
	add	r3, sp, #24
	add	r2, sp, #20
	bl	mthca_poll_one
	subs	r5, r0, #0
	bne	.L3
	add	r6, r6, #1
	b	.L2
.L30:
	bl	wmb
	mov	r1, r4
	mov	r0, r7
	ldr	r2, [sp, #24]
	bl	update_cons_index
	b	.L5
.L7:
	mov	r1, #0
	ldr	r0, [sp, #12]
	bl	spin_unlock_irqrestore
	cmp	r5, #0
	bne	.L31
.L1:
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	mov	r0, r6
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L31:
	ldr	r3, [r9]
	cmn	r5, r3
	movne	r6, r5
	b	.L1
.L32:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	EAGAIN
	.word	CQ_RESIZE_SWAPPED
	.word	CQ_RESIZE_READY
	.size	mthca_poll_cq, .-mthca_poll_cq
	.comm	EAGAIN,4,4
	.comm	CQ_RESIZE_SWAPPED,4,4
	.comm	CQ_RESIZE_READY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
