	.file	"extr_en_netdev.c_mlx4_en_alloc_resources.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Failed to allocate NIC resources\n"
	.text
	.p2align 4
	.type	mlx4_en_alloc_resources, @function
mlx4_en_alloc_resources:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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, rdi
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	r9d, DWORD PTR MLX4_EN_NUM_TX_TYPES[rip]
	mov	r12, QWORD PTR 80[rdi]
	test	r9d, r9d
	jle	.L3
	mov	QWORD PTR 24[rsp], 0
	mov	rax, QWORD PTR [rdi]
.L2:
	mov	rcx, QWORD PTR 24[rsp]
	xor	r15d, r15d
	mov	r8d, DWORD PTR [rax+rcx*4]
	lea	rdx, 0[0+rcx*4]
	mov	DWORD PTR 12[rsp], ecx
	lea	r13, 0[0+rcx*8]
	mov	QWORD PTR 16[rsp], rdx
	test	r8d, r8d
	jg	.L5
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rax, QWORD PTR 24[rbx]
	mov	edx, DWORD PTR 4[r12]
	mov	r9d, r15d
	mov	r8d, ebp
	mov	ecx, DWORD PTR TXBB_SIZE[rip]
	mov	rdi, rbx
	mov	rsi, QWORD PTR [rax+r13]
	add	rsi, r14
	call	mlx4_en_create_tx_ring@PLT
	test	rax, rax
	jne	.L4
	mov	rax, QWORD PTR [rbx]
	mov	rcx, QWORD PTR 16[rsp]
	add	r15, 1
	cmp	DWORD PTR [rax+rcx], r15d
	jle	.L7
.L5:
	xor	eax, eax
	lea	r14, 0[0+r15*8]
	call	num_online_cpus@PLT
	mov	r8d, eax
	mov	eax, r15d
	cdq
	idiv	r8d
	mov	edi, edx
	call	cpu_to_node@PLT
	mov	edx, DWORD PTR 4[r12]
	mov	ecx, r15d
	mov	rdi, rbx
	mov	ebp, eax
	mov	rax, QWORD PTR 16[rbx]
	mov	r8d, DWORD PTR 12[rsp]
	mov	r9d, ebp
	mov	rsi, QWORD PTR [rax+r13]
	add	rsi, r14
	call	mlx4_en_create_cq@PLT
	test	rax, rax
	je	.L34
.L4:
	lea	rsi, .LC0[rip]
	mov	rdi, rbx
	call	en_err@PLT
	mov	esi, DWORD PTR 8[rbx]
	test	esi, esi
	jle	.L11
	xor	r13d, r13d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rsi, QWORD PTR 32[rbx]
	add	rsi, rbp
	cmp	QWORD PTR [rsi], 0
	jne	.L35
.L13:
	add	r13, 1
	cmp	DWORD PTR 8[rbx], r13d
	jle	.L11
.L14:
	mov	rsi, QWORD PTR 48[rbx]
	lea	rbp, 0[0+r13*8]
	add	rsi, rbp
	cmp	QWORD PTR [rsi], 0
	je	.L12
	mov	ecx, DWORD PTR 40[rbx]
	mov	edx, DWORD PTR [r12]
	mov	rdi, rbx
	call	mlx4_en_destroy_rx_ring@PLT
	mov	rsi, QWORD PTR 32[rbx]
	add	rsi, rbp
	cmp	QWORD PTR [rsi], 0
	je	.L13
.L35:
	mov	rdi, rbx
	add	r13, 1
	call	mlx4_en_destroy_cq@PLT
	cmp	DWORD PTR 8[rbx], r13d
	jg	.L14
.L11:
	mov	ecx, DWORD PTR MLX4_EN_NUM_TX_TYPES[rip]
	test	ecx, ecx
	jle	.L16
	mov	rax, QWORD PTR [rbx]
	xor	r14d, r14d
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edx, DWORD PTR [rax+r14*4]
	lea	r13, 0[0+r14*4]
	lea	r15, 0[0+r14*8]
	xor	r12d, r12d
	test	edx, edx
	jg	.L19
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rax, QWORD PTR 16[rbx]
	mov	rsi, QWORD PTR [rax+r15]
	add	rsi, rbp
	cmp	QWORD PTR [rsi], 0
	jne	.L36
	mov	rax, QWORD PTR [rbx]
	add	r12, 1
	cmp	DWORD PTR [rax+r13], r12d
	jle	.L21
.L19:
	mov	rax, QWORD PTR 24[rbx]
	lea	rbp, 0[0+r12*8]
	mov	rsi, QWORD PTR [rax+r15]
	add	rsi, rbp
	cmp	QWORD PTR [rsi], 0
	je	.L17
	mov	rdi, rbx
	call	mlx4_en_destroy_tx_ring@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L36:
	mov	rdi, rbx
	add	r12, 1
	call	mlx4_en_destroy_cq@PLT
	mov	rax, QWORD PTR [rbx]
	cmp	DWORD PTR [rax+r13], r12d
	jg	.L19
.L21:
	add	r14, 1
	cmp	DWORD PTR MLX4_EN_NUM_TX_TYPES[rip], r14d
	jg	.L15
.L16:
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L7:
	.cfi_restore_state
	add	QWORD PTR 24[rsp], 1
	mov	rcx, QWORD PTR 24[rsp]
	cmp	DWORD PTR MLX4_EN_NUM_TX_TYPES[rip], ecx
	jg	.L2
.L3:
	mov	edi, DWORD PTR 8[rbx]
	xor	ebp, ebp
	test	edi, edi
	jg	.L8
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L37:
	mov	rsi, QWORD PTR 48[rbx]
	mov	ecx, DWORD PTR 40[rbx]
	mov	r9d, ebp
	mov	r8d, r14d
	mov	edx, DWORD PTR [r12]
	mov	rdi, rbx
	add	rsi, r13
	call	mlx4_en_create_rx_ring@PLT
	test	rax, rax
	jne	.L4
	add	rbp, 1
	cmp	DWORD PTR 8[rbx], ebp
	jle	.L10
.L8:
	xor	eax, eax
	lea	r13, 0[0+rbp*8]
	call	num_online_cpus@PLT
	mov	r8d, eax
	mov	eax, ebp
	cdq
	idiv	r8d
	mov	edi, edx
	call	cpu_to_node@PLT
	mov	rsi, QWORD PTR 32[rbx]
	mov	edx, DWORD PTR [r12]
	mov	ecx, ebp
	mov	r8d, DWORD PTR RX[rip]
	mov	r9d, eax
	mov	rdi, rbx
	mov	r14d, eax
	add	rsi, r13
	call	mlx4_en_create_cq@PLT
	test	rax, rax
	je	.L37
	jmp	.L4
.L10:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	mlx4_en_alloc_resources, .-mlx4_en_alloc_resources
	.comm	TXBB_SIZE,4,4
	.comm	RX,4,4
	.comm	MLX4_EN_NUM_TX_TYPES,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_en_netdev.c_mlx4_en_alloc_resources.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed to allocate NIC resources\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mlx4_en_alloc_resources, %function
mlx4_en_alloc_resources:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, .L47
	mov	r5, r0
	ldr	r3, [r7]
	ldr	r8, [r0, #40]
	cmp	r3, #0
	sub	sp, sp, #12
	ble	.L3
	mov	r9, #0
	ldr	r3, [r0]
	ldr	r10, .L47+4
.L2:
	ldr	r2, [r3, r9, lsl #2]
	lsl	r6, r9, #2
	cmp	r2, #0
	movgt	r4, #0
	bgt	.L5
	b	.L6
.L43:
	ldr	r1, [r5, #12]
	ldr	r2, [r8, #4]
	ldr	r1, [r1, r6]
	mov	r0, r5
	add	r1, r1, r3
	str	r4, [sp, #4]
	ldr	r3, [r10]
	str	fp, [sp]
	bl	mlx4_en_create_tx_ring
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L4
	ldr	r3, [r5]
	ldr	r2, [r3, r6]
	cmp	r2, r4
	ble	.L6
.L5:
	bl	num_online_cpus
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_idivmod
	mov	r0, r1
	bl	cpu_to_node
	mov	fp, r0
	ldr	r3, [r5, #8]
	ldr	r2, [r8, #4]
	ldr	r1, [r3, r6]
	mov	r0, r5
	mov	r3, r4
	stm	sp, {r9, fp}
	add	r1, r1, r4, lsl #2
	bl	mlx4_en_create_cq
	cmp	r0, #0
	lsl	r3, r4, #2
	beq	.L43
.L4:
	mov	r0, r5
	ldr	r1, .L47+8
	bl	en_err
	ldr	r3, [r5, #4]
	cmp	r3, #0
	ble	.L10
	mov	r4, #0
	b	.L13
.L11:
	ldr	r1, [r5, #16]
	ldr	r3, [r1, r6]
	add	r1, r1, r6
	cmp	r3, #0
	bne	.L44
	ldr	r3, [r5, #4]
	cmp	r3, r4
	ble	.L10
.L13:
	ldr	r1, [r5, #24]
	lsl	r6, r4, #2
	ldr	r3, [r1, r4, lsl #2]
	add	r1, r1, r4, lsl #2
	cmp	r3, #0
	add	r4, r4, #1
	beq	.L11
	mov	r0, r5
	ldr	r3, [r5, #20]
	ldr	r2, [r8]
	bl	mlx4_en_destroy_rx_ring
	b	.L11
.L44:
	mov	r0, r5
	bl	mlx4_en_destroy_cq
	ldr	r3, [r5, #4]
	cmp	r3, r4
	bgt	.L13
.L10:
	ldr	r3, [r7]
	cmp	r3, #0
	movgt	r6, #0
	ldrgt	r3, [r5]
	ble	.L15
.L14:
	ldr	r2, [r3, r6, lsl #2]
	lsl	r8, r6, #2
	cmp	r2, #0
	movgt	r4, #0
	bgt	.L18
	b	.L19
.L16:
	ldr	r3, [r5, #8]
	ldr	r1, [r3, r8]
	ldr	r3, [r1, r9]
	add	r1, r1, r9
	cmp	r3, #0
	bne	.L45
	ldr	r3, [r5]
	ldr	r2, [r3, r8]
	cmp	r2, r4
	ble	.L19
.L18:
	ldr	r3, [r5, #12]
	lsl	r9, r4, #2
	ldr	r1, [r3, r8]
	ldr	r3, [r1, r4, lsl #2]
	add	r1, r1, r4, lsl #2
	cmp	r3, #0
	add	r4, r4, #1
	beq	.L16
	mov	r0, r5
	bl	mlx4_en_destroy_tx_ring
	b	.L16
.L45:
	mov	r0, r5
	bl	mlx4_en_destroy_cq
	ldr	r3, [r5]
	ldr	r2, [r3, r8]
	cmp	r2, r4
	bgt	.L18
.L19:
	ldr	r2, [r7]
	add	r6, r6, #1
	cmp	r2, r6
	bgt	.L14
.L15:
	ldr	r3, .L47+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L6:
	ldr	r2, [r7]
	add	r9, r9, #1
	cmp	r2, r9
	bgt	.L2
.L3:
	ldr	r3, [r5, #4]
	cmp	r3, #0
	movgt	r4, #0
	ldrgt	r9, .L47+16
	bgt	.L7
	b	.L9
.L46:
	ldr	r1, [r5, #24]
	ldr	r2, [r8]
	str	r4, [sp, #4]
	str	r6, [sp]
	add	r1, r1, r3
	mov	r0, r5
	ldr	r3, [r5, #20]
	bl	mlx4_en_create_rx_ring
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L4
	ldr	r3, [r5, #4]
	cmp	r3, r4
	ble	.L9
.L7:
	bl	num_online_cpus
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_idivmod
	mov	r0, r1
	bl	cpu_to_node
	ldr	r1, [r5, #16]
	ldr	r3, [r9]
	ldr	r2, [r8]
	mov	r6, r0
	str	r0, [sp, #4]
	str	r3, [sp]
	mov	r0, r5
	mov	r3, r4
	add	r1, r1, r4, lsl #2
	bl	mlx4_en_create_cq
	cmp	r0, #0
	lsl	r3, r4, #2
	beq	.L46
	b	.L4
.L9:
	mov	r0, #0
	b	.L1
.L48:
	.align	2
.L47:
	.word	MLX4_EN_NUM_TX_TYPES
	.word	TXBB_SIZE
	.word	.LC0
	.word	ENOMEM
	.word	RX
	.size	mlx4_en_alloc_resources, .-mlx4_en_alloc_resources
	.comm	TXBB_SIZE,4,4
	.comm	RX,4,4
	.comm	MLX4_EN_NUM_TX_TYPES,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
