	.file	"extr_resource_tracker.c_mlx4_grant_resource.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"VF %d port %d res %s: quota exceeded, count %d alloc %d quota %d\n"
	.align 8
.LC1:
	.string	"VF %d port %d res %s: free pool empty, free %d from_free %d rsvd %d\n"
	.text
	.p2align 4
	.type	mlx4_grant_resource, @function
mlx4_grant_resource:
.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	r14d, ecx
	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
	movsx	r12, r8d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	DWORD PTR 8[rsp], edx
	call	mlx4_priv@PLT
	mov	rdx, QWORD PTR 0[rbp]
	cmp	DWORD PTR [rdx], r13d
	jge	.L2
	mov	r15d, DWORD PTR EINVAL[rip]
	neg	r15d
.L1:
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L2:
	.cfi_restore_state
	mov	ebx, DWORD PTR 8[rsp]
	sal	rbx, 6
	add	rbx, QWORD PTR [rax]
	mov	eax, DWORD PTR EDQUOT[rip]
	mov	DWORD PTR 12[rsp], eax
	lea	rax, 56[rbx]
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	spin_lock@PLT
	movsx	rdx, r13d
	lea	r11, 0[0+rdx*4]
	test	r12d, r12d
	jle	.L4
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 8[rbx]
	mov	ecx, DWORD PTR [rax]
	lea	eax, -1[r12]
	add	ecx, 1
	imul	ecx, eax
	mov	rax, QWORD PTR [rbx]
	add	ecx, r13d
	movsx	rcx, ecx
	mov	esi, DWORD PTR [rax+rcx*4]
	movsx	rcx, r12d
	sal	rcx, 2
	mov	r9d, DWORD PTR -4[rdi+rcx]
	mov	rdi, QWORD PTR 24[rbx]
	mov	r8d, DWORD PTR -4[rdi+rcx]
.L5:
	mov	r10, QWORD PTR 48[rbx]
	mov	r15d, DWORD PTR 12[rsp]
	lea	ecx, [r14+rsi]
	mov	rdi, QWORD PTR 40[rbx]
	mov	edx, DWORD PTR [r10+rdx*4]
	neg	r15d
	add	rdi, r11
	cmp	ecx, edx
	jg	.L16
	mov	r10d, DWORD PTR [rdi]
	cmp	ecx, r10d
	jle	.L11
	sub	r10d, esi
	mov	edx, r14d
	test	r10d, r10d
	jle	.L12
	sub	edx, r10d
.L9:
	mov	ecx, r9d
	sub	ecx, edx
	cmp	ecx, r8d
	jl	.L17
	xor	r15d, r15d
.L8:
	test	r12d, r12d
	jle	.L10
.L18:
	mov	rdx, QWORD PTR 0[rbp]
	mov	esi, DWORD PTR [rdx]
	lea	edx, -1[r12]
	add	esi, 1
	imul	esi, edx
	mov	rdx, QWORD PTR 8[rbx]
	add	r13d, esi
	movsx	r13, r13d
	add	DWORD PTR [rax+r13*4], r14d
	lea	rax, -4[0+r12*4]
	add	rdx, rax
	add	rax, QWORD PTR 24[rbx]
	sub	DWORD PTR [rdx], r14d
	sub	DWORD PTR [rax], r10d
.L7:
	mov	rdi, QWORD PTR 16[rsp]
	call	spin_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR [rbx]
	mov	r9d, DWORD PTR 16[rbx]
	mov	r8d, DWORD PTR 32[rbx]
	mov	esi, DWORD PTR [rax+rdx*4]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	r10d, r14d
	xor	r15d, r15d
	test	r12d, r12d
	jg	.L18
.L10:
	add	DWORD PTR [rax+r11], r14d
	sub	DWORD PTR 16[rbx], r14d
	sub	DWORD PTR 32[rbx], r10d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	mov	edi, DWORD PTR 8[rsp]
	mov	DWORD PTR 24[rsp], esi
	mov	DWORD PTR 12[rsp], edx
	call	resource_str@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, rbp
	mov	r9d, r14d
	mov	r8d, eax
	mov	ecx, r12d
	push	rdx
	.cfi_def_cfa_offset 120
	mov	esi, DWORD PTR 32[rsp]
	mov	edx, r13d
	push	rsi
	.cfi_def_cfa_offset 128
	lea	rsi, .LC0[rip]
	call	mlx4_warn@PLT
	pop	rsi
	.cfi_def_cfa_offset 120
	pop	rdi
	.cfi_def_cfa_offset 112
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xor	r10d, r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR 8[rsp]
	mov	DWORD PTR 44[rsp], r10d
	mov	DWORD PTR 40[rsp], r9d
	mov	DWORD PTR 28[rsp], r8d
	mov	DWORD PTR 24[rsp], edx
	mov	QWORD PTR 32[rsp], r11
	call	resource_str@PLT
	mov	r8d, DWORD PTR 28[rsp]
	mov	ecx, r12d
	mov	rdi, rbp
	lea	rsi, .LC1[rip]
	push	r8
	.cfi_def_cfa_offset 120
	mov	edx, DWORD PTR 32[rsp]
	mov	r8d, eax
	push	rdx
	.cfi_def_cfa_offset 128
	mov	r9d, DWORD PTR 56[rsp]
	mov	edx, r13d
	call	mlx4_warn@PLT
	pop	rax
	.cfi_def_cfa_offset 120
	pop	rdx
	.cfi_def_cfa_offset 112
	mov	ecx, DWORD PTR 12[rsp]
	test	ecx, ecx
	jne	.L7
	mov	rax, QWORD PTR [rbx]
	mov	r11, QWORD PTR 32[rsp]
	mov	r10d, DWORD PTR 44[rsp]
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	mlx4_grant_resource, .-mlx4_grant_resource
	.comm	EINVAL,4,4
	.comm	EDQUOT,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_resource_tracker.c_mlx4_grant_resource.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"VF %d port %d res %s: quota exceeded, count %d allo"
	.ascii	"c %d quota %d\012\000"
	.align	2
.LC1:
	.ascii	"VF %d port %d res %s: free pool empty, free %d from"
	.ascii	"_free %d rsvd %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx4_grant_resource, %function
mlx4_grant_resource:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	mov	r10, r1
	sub	sp, sp, #44
	mov	r4, r3
	mov	r6, r2
	bl	mlx4_priv
	ldr	r3, [r5]
	ldr	r3, [r3]
	cmp	r3, r10
	bge	.L2
	ldr	r3, .L19
	ldr	r8, [r3]
	rsb	r8, r8, #0
	mov	r0, r8
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r8, [r0]
	ldr	r3, .L19+4
	add	r7, r8, r6, lsl #5
	ldr	r3, [r3]
	add	fp, r7, #28
	mov	r0, fp
	str	r3, [sp, #20]
	str	r8, [sp, #24]
	bl	spin_lock
	ldr	r3, [sp, #80]
	cmp	r3, #0
	ble	.L4
	ldr	r1, [r5]
	sub	r3, r3, #1
	ldr	lr, [r1]
	ldr	r0, [r8, r6, lsl #5]
	add	lr, lr, #1
	mla	lr, r3, lr, r10
	ldr	r3, [sp, #80]
	ldr	ip, [r7, #4]
	ldr	r1, [r7, #12]
	sub	r3, r3, #-1073741823
	ldr	r2, [ip, r3, lsl #2]
	ldr	r9, [r0, lr, lsl #2]
	ldr	r3, [r1, r3, lsl #2]
.L5:
	ldr	ip, [r7, #24]
	ldr	lr, [sp, #20]
	ldr	ip, [ip, r10, lsl #2]
	add	r1, r4, r9
	cmp	r1, ip
	rsb	r8, lr, #0
	ldr	ip, [r7, #20]
	bgt	.L16
	ldr	ip, [ip, r10, lsl #2]
	cmp	r1, ip
	ble	.L11
	sub	r9, ip, r9
	cmp	r9, #0
	movle	r1, r4
	subgt	r1, r4, r9
	sub	ip, r2, r1
	movle	r9, #0
	cmp	ip, r3
	movge	r8, #0
	blt	.L17
.L8:
	ldr	r3, [sp, #80]
	cmp	r3, #0
	ble	.L10
.L18:
	ldr	r1, [r5]
	ldr	r2, [sp, #80]
	ldr	r1, [r1]
	sub	r3, r3, #1
	add	r1, r1, #1
	sub	ip, r2, #-1073741823
	mla	r2, r3, r1, r10
	ldr	r3, [r0, r2, lsl #2]
	ldr	r1, [r7, #4]
	add	r3, r3, r4
	str	r3, [r0, r2, lsl #2]
	ldr	r3, [r1, ip, lsl #2]
	ldr	r2, [r7, #12]
	sub	r4, r3, r4
	str	r4, [r1, ip, lsl #2]
	ldr	r3, [r2, ip, lsl #2]
	sub	r9, r3, r9
	str	r9, [r2, ip, lsl #2]
.L7:
	mov	r0, fp
	bl	spin_unlock
	mov	r0, r8
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r3, [sp, #24]
	ldr	r2, [r7, #8]
	ldr	r0, [r3, r6, lsl #5]
	ldr	r3, [r7, #16]
	ldr	r9, [r0, r10, lsl #2]
	b	.L5
.L11:
	ldr	r3, [sp, #80]
	mov	r9, r4
	cmp	r3, #0
	mov	r8, #0
	bgt	.L18
.L10:
	ldr	r3, [r0, r10, lsl #2]
	add	r3, r3, r4
	str	r3, [r0, r10, lsl #2]
	ldr	r3, [r7, #8]
	ldr	r2, [r7, #16]
	sub	r4, r3, r4
	sub	r9, r2, r9
	str	r4, [r7, #8]
	str	r9, [r7, #16]
	b	.L7
.L16:
	mov	r0, r6
	bl	resource_str
	ldr	r1, [r7, #24]
	mov	r2, r10
	ldr	r1, [r1, r10, lsl #2]
	ldr	r3, [sp, #80]
	stm	sp, {r0, r4, r9}
	str	r1, [sp, #12]
	mov	r0, r5
	ldr	r1, .L19+8
	bl	mlx4_warn
	b	.L7
.L17:
	mov	r0, r6
	str	r2, [sp, #36]
	str	r3, [sp, #32]
	str	r1, [sp, #28]
	bl	resource_str
	ldr	r3, [sp, #32]
	ldr	r1, [sp, #28]
	ldr	r2, [sp, #36]
	str	r3, [sp, #12]
	str	r0, [sp]
	ldr	r3, [sp, #80]
	str	r1, [sp, #8]
	str	r2, [sp, #4]
	mov	r0, r5
	mov	r2, r10
	ldr	r1, .L19+12
	bl	mlx4_warn
	ldr	r3, [sp, #20]
	cmp	r3, #0
	bne	.L7
	ldr	r3, [sp, #24]
	ldr	r0, [r3, r6, lsl #5]
	b	.L8
.L20:
	.align	2
.L19:
	.word	EINVAL
	.word	EDQUOT
	.word	.LC0
	.word	.LC1
	.size	mlx4_grant_resource, .-mlx4_grant_resource
	.comm	EINVAL,4,4
	.comm	EDQUOT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
