	.file	"extr_qib_iba7322.c_qib_7322_config_ctxts.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	qib_7322_config_ctxts, @function
qib_7322_config_ctxts:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	esi, DWORD PTR kr_contextcnt[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	call	qib_read_kreg32@PLT
	mov	rdi, QWORD PTR 32[rbx]
	mov	ecx, DWORD PTR qib_n_krcv_queues[rip]
	mov	rbp, rax
	mov	DWORD PTR [rdi], eax
	cmp	ecx, 1
	jle	.L2
	mov	esi, DWORD PTR [rbx]
	mov	edx, DWORD PTR NUM_IB_PORTS[rip]
	test	esi, esi
	jne	.L28
.L3:
	mov	eax, DWORD PTR qib_cfgctxts[rip]
	mov	DWORD PTR 4[rbx], edx
	mov	DWORD PTR 8[rbx], 1
	test	eax, eax
	je	.L29
.L7:
	mov	edx, DWORD PTR [rbx]
	cmp	eax, edx
	jge	.L12
	mov	DWORD PTR 12[rbx], edx
.L13:
	test	edx, edx
	jne	.L15
.L26:
	mov	DWORD PTR 12[rbx], ebp
.L15:
	add	rdi, 16
	xor	esi, esi
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR 12[rbx]
	cmp	eax, 10
	jg	.L30
	mov	edi, DWORD PTR RcvCtrl[rip]
	cmp	eax, 6
	jg	.L31
.L17:
	mov	esi, DWORD PTR XrcTypeCode[rip]
	call	SYM_LSB@PLT
	mov	edx, 5
	mov	esi, DWORD PTR kr_rcvctrl[rip]
	mov	rdi, rbx
	mov	ecx, eax
	sal	rdx, cl
	or	rdx, QWORD PTR 16[rbx]
	mov	QWORD PTR 16[rbx], rdx
	call	qib_write_kreg@PLT
	mov	rax, QWORD PTR 32[rbx]
	xor	esi, esi
	lea	rdi, 16[rax]
	call	spin_unlock_irqrestore@PLT
	mov	esi, DWORD PTR kr_rcvegrcnt[rip]
	mov	rdi, rbx
	mov	rbp, QWORD PTR 32[rbx]
	call	qib_read_kreg32@PLT
	mov	esi, DWORD PTR qib_rcvhdrcnt[rip]
	mov	QWORD PTR 8[rbp], rax
	test	esi, esi
	jne	.L32
	cmp	DWORD PTR [rbx], 1
	mov	eax, 2048
	mov	esi, 1024
	cmovle	esi, eax
	mov	rax, QWORD PTR 32[rbx]
	mov	rdi, QWORD PTR 8[rax]
	call	max@PLT
	add	eax, eax
	mov	DWORD PTR 24[rbx], eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	cmp	eax, ebp
	jg	.L11
	mov	DWORD PTR 12[rbx], eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L28:
	lea	eax, -1[rcx]
	imul	eax, esi
	lea	eax, [rax+rdx]
	cmp	eax, ebp
	jg	.L4
	mov	DWORD PTR 4[rbx], eax
.L5:
	cdq
	idiv	esi
	mov	DWORD PTR 8[rbx], eax
	mov	eax, DWORD PTR qib_cfgctxts[rip]
	test	eax, eax
	jne	.L7
.L29:
	mov	r12d, DWORD PTR 4[rbx]
	call	num_online_cpus@PLT
	add	eax, r12d
	cmp	eax, 6
	jle	.L33
	mov	rdi, QWORD PTR 32[rbx]
	cmp	eax, 10
	jg	.L10
	mov	DWORD PTR 12[rbx], 10
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	cmp	ebp, eax
	jge	.L26
	.p2align 4,,10
	.p2align 3
.L11:
	mov	edx, DWORD PTR 12[rbx]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edx, DWORD PTR NUM_IB_PORTS[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	mov	rax, QWORD PTR 32[rbx]
	mov	rdi, QWORD PTR 8[rax]
	call	max@PLT
	mov	DWORD PTR 24[rbx], eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	mov	edi, DWORD PTR RcvCtrl[rip]
	mov	esi, DWORD PTR ContextCfg[rip]
	call	SYM_LSB@PLT
	mov	edx, 2
	mov	edi, DWORD PTR RcvCtrl[rip]
	mov	ecx, eax
	sal	rdx, cl
	or	QWORD PTR 16[rbx], rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, DWORD PTR ContextCfg[rip]
	call	SYM_LSB@PLT
	mov	edx, 1
	mov	edi, DWORD PTR RcvCtrl[rip]
	mov	ecx, eax
	sal	rdx, cl
	or	QWORD PTR 16[rbx], rdx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L33:
	mov	DWORD PTR 12[rbx], 6
	mov	rdi, QWORD PTR 32[rbx]
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L4:
	mov	DWORD PTR 4[rbx], ebp
	mov	eax, ebp
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	qib_7322_config_ctxts, .-qib_7322_config_ctxts
	.comm	qib_rcvhdrcnt,4,4
	.comm	qib_n_krcv_queues,4,4
	.comm	qib_cfgctxts,4,4
	.comm	kr_rcvegrcnt,4,4
	.comm	kr_rcvctrl,4,4
	.comm	kr_contextcnt,4,4
	.comm	XrcTypeCode,4,4
	.comm	RcvCtrl,4,4
	.comm	NUM_IB_PORTS,4,4
	.comm	ContextCfg,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_iba7322.c_qib_7322_config_ctxts.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qib_7322_config_ctxts, %function
qib_7322_config_ctxts:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L35
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r1, [r3]
	bl	qib_read_kreg32
	ldr	r3, .L35+4
	ldr	r6, [r4, #28]
	ldr	r3, [r3]
	mov	r5, r0
	cmp	r3, #1
	str	r0, [r6]
	ble	.L2
	ldr	r1, [r4]
	ldr	r2, .L35+8
	cmp	r1, #0
	ldr	r0, [r2]
	bne	.L28
.L3:
	mov	r3, #1
	stmib	r4, {r0, r3}
	ldr	r3, .L35+12
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L29
.L7:
	ldr	r2, [r4]
	cmp	r3, r2
	strlt	r2, [r4, #12]
	bge	.L30
.L13:
	cmp	r2, #0
	bne	.L15
.L26:
	str	r5, [r4, #12]
.L15:
	mov	r1, #0
	add	r0, r6, #8
	bl	spin_lock_irqsave
	ldr	r3, [r4, #12]
	cmp	r3, #10
	bgt	.L31
	ldr	r5, .L35+16
	cmp	r3, #6
	ldr	r0, [r5]
	bgt	.L32
.L17:
	ldr	r3, .L35+20
	ldr	r1, [r3]
	bl	SYM_LSB
	mov	r1, #5
	sub	r3, r0, #32
	ldr	ip, [r4, #20]
	rsb	r2, r0, #32
	lsl	r3, r1, r3
	orr	r3, r3, r1, lsr r2
	ldr	r2, [r4, #16]
	orr	r3, r3, ip
	ldr	ip, .L35+24
	orr	r2, r2, r1, lsl r0
	str	r3, [r4, #20]
	ldr	r1, [ip]
	str	r2, [r4, #16]
	mov	r0, r4
	bl	qib_write_kreg
	ldr	r0, [r4, #28]
	mov	r1, #0
	add	r0, r0, #8
	bl	spin_unlock_irqrestore
	ldr	r3, .L35+28
	mov	r0, r4
	ldr	r1, [r3]
	ldr	r5, [r4, #28]
	bl	qib_read_kreg32
	ldr	r3, .L35+32
	str	r0, [r5, #4]
	ldr	r1, [r3]
	cmp	r1, #0
	bne	.L33
	ldr	r2, [r4]
	ldr	r3, [r4, #28]
	cmp	r2, #1
	movgt	r1, #1024
	movle	r1, #2048
	ldr	r0, [r3, #4]
	bl	max
	lsl	r0, r0, #1
	str	r0, [r4, #24]
	pop	{r4, r5, r6, pc}
.L30:
	cmp	r3, r5
	strle	r3, [r4, #12]
	ble	.L15
.L11:
	ldr	r2, [r4, #12]
	b	.L13
.L28:
	sub	r3, r3, #1
	mla	r0, r1, r3, r0
	cmp	r0, r5
	movgt	r0, r5
	strle	r0, [r4, #4]
	strgt	r5, [r4, #4]
	bl	__aeabi_idiv
	ldr	r3, .L35+12
	str	r0, [r4, #8]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L7
.L29:
	ldr	r6, [r4, #4]
	bl	num_online_cpus
	add	r0, r6, r0
	cmp	r0, #6
	ble	.L34
	cmp	r0, #10
	movle	r3, #10
	ldr	r6, [r4, #28]
	strle	r3, [r4, #12]
	ble	.L15
	cmp	r5, r0
	blt	.L11
	b	.L26
.L32:
	ldr	r3, .L35+36
	ldr	r1, [r3]
	bl	SYM_LSB
	mov	lr, #1
	mov	r3, r0
	sub	r2, r0, #32
	rsb	r1, r0, #32
	lsl	r2, lr, r2
	ldr	ip, [r4, #20]
	orr	r2, r2, lr, lsr r1
	ldr	r1, [r4, #16]
	orr	r2, ip, r2
	orr	r3, r1, lr, lsl r3
	ldr	r0, [r5]
	str	r2, [r4, #20]
	str	r3, [r4, #16]
	b	.L17
.L2:
	ldr	r3, .L35+8
	ldr	r0, [r3]
	b	.L3
.L33:
	ldr	r3, [r4, #28]
	ldr	r0, [r3, #4]
	bl	max
	str	r0, [r4, #24]
	pop	{r4, r5, r6, pc}
.L31:
	ldr	r3, .L35+36
	ldr	r5, .L35+16
	ldr	r1, [r3]
	ldr	r0, [r5]
	bl	SYM_LSB
	mov	ip, #2
	sub	r3, r0, #32
	rsb	r2, r0, #32
	lsl	r3, ip, r3
	ldr	r1, [r4, #20]
	orr	r3, r3, ip, lsr r2
	ldr	r2, [r4, #16]
	orr	r3, r1, r3
	orr	r2, r2, ip, lsl r0
	str	r3, [r4, #20]
	ldr	r0, [r5]
	str	r2, [r4, #16]
	b	.L17
.L34:
	mov	r3, #6
	ldr	r6, [r4, #28]
	str	r3, [r4, #12]
	b	.L15
.L36:
	.align	2
.L35:
	.word	kr_contextcnt
	.word	qib_n_krcv_queues
	.word	NUM_IB_PORTS
	.word	qib_cfgctxts
	.word	RcvCtrl
	.word	XrcTypeCode
	.word	kr_rcvctrl
	.word	kr_rcvegrcnt
	.word	qib_rcvhdrcnt
	.word	ContextCfg
	.size	qib_7322_config_ctxts, .-qib_7322_config_ctxts
	.comm	qib_rcvhdrcnt,4,4
	.comm	qib_n_krcv_queues,4,4
	.comm	qib_cfgctxts,4,4
	.comm	kr_rcvegrcnt,4,4
	.comm	kr_rcvctrl,4,4
	.comm	kr_contextcnt,4,4
	.comm	XrcTypeCode,4,4
	.comm	RcvCtrl,4,4
	.comm	NUM_IB_PORTS,4,4
	.comm	ContextCfg,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
