	.file	"extr_qib_tx.c_find_ctxt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	find_ctxt, @function
find_ctxt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	lea	r12, 8[rdi]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	mov	rdi, r12
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	spin_lock@PLT
	mov	ecx, DWORD PTR [rbx]
	mov	eax, DWORD PTR 4[rbx]
	cmp	ecx, eax
	jnb	.L9
	sub	eax, 1
	mov	edi, ecx
	mov	rsi, QWORD PTR 16[rbx]
	sub	eax, ecx
	add	rax, rdi
	lea	rdx, [rsi+rdi*8]
	lea	rcx, 8[rsi+rax*8]
.L5:
	mov	rbp, QWORD PTR [rdx]
	test	rbp, rbp
	je	.L3
	mov	eax, DWORD PTR 0[rbp]
	cmp	eax, r13d
	ja	.L3
	add	eax, DWORD PTR 4[rbp]
	cmp	eax, r13d
	jbe	.L3
	mov	rsi, QWORD PTR 16[rbp]
	test	rsi, rsi
	je	.L7
	mov	edi, DWORD PTR _QIB_EVENT_DISARM_BUFS_BIT[rip]
	call	set_bit@PLT
	cmp	DWORD PTR 8[rbp], 1
	jle	.L7
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L8:
	lea	rbx, 1[rax]
	mov	rax, QWORD PTR 16[rbp]
	mov	edi, DWORD PTR _QIB_EVENT_DISARM_BUFS_BIT[rip]
	lea	rsi, [rax+rbx*4]
	call	set_bit@PLT
	mov	rax, rbx
	lea	edx, 1[rbx]
	cmp	DWORD PTR 8[rbp], edx
	jg	.L8
.L7:
	mov	r13d, 1
.L2:
	mov	rdi, r12
	call	spin_unlock@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	add	rdx, 8
	cmp	rdx, rcx
	jne	.L5
.L9:
	xor	r13d, r13d
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	find_ctxt, .-find_ctxt
	.comm	_QIB_EVENT_DISARM_BUFS_BIT,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_qib_tx.c_find_ctxt.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_ctxt, %function
find_ctxt:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	add	r6, r0, #8
	mov	r0, r6
	mov	r5, r1
	bl	spin_lock
	ldr	r3, [r4]
	ldr	r1, [r4, #4]
	cmp	r3, r1
	bcs	.L9
	ldr	r0, [r4, #12]
	sub	r2, r3, #-1073741823
	add	r0, r0, r2, lsl #2
.L5:
	ldr	r4, [r0, #4]!
	add	r3, r3, #1
	cmp	r4, #0
	beq	.L3
	ldr	r2, [r4]
	cmp	r2, r5
	bhi	.L3
	ldr	ip, [r4, #4]
	add	r2, r2, ip
	cmp	r2, r5
	bls	.L3
	ldr	r1, [r4, #12]
	cmp	r1, #0
	beq	.L7
	ldr	r7, .L17
	ldr	r0, [r7]
	bl	set_bit
	ldr	r3, [r4, #8]
	cmp	r3, #1
	ble	.L7
	mov	r5, #1
.L8:
	ldr	r1, [r4, #12]
	ldr	r0, [r7]
	add	r1, r1, r5, lsl #2
	bl	set_bit
	ldr	r3, [r4, #8]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L8
.L7:
	mov	r4, #1
.L2:
	mov	r0, r6
	bl	spin_unlock
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	cmp	r3, r1
	bne	.L5
.L9:
	mov	r4, #0
	b	.L2
.L18:
	.align	2
.L17:
	.word	_QIB_EVENT_DISARM_BUFS_BIT
	.size	find_ctxt, .-find_ctxt
	.comm	_QIB_EVENT_DISARM_BUFS_BIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
