	.file	"extr_qlnx_os.c_qlnx_alloc_mem_rxq.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Rx buffers allocation failed\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Allocated less buffers than desired (%d allocated)\n"
	.text
	.p2align 4
	.type	qlnx_alloc_mem_rxq, @function
qlnx_alloc_mem_rxq:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	lea	r13, 12[rdi]
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	esi, DWORD PTR RX_RING_SIZE[rip]
	mov	eax, DWORD PTR 8[rdi]
	mov	rdi, QWORD PTR 40[rbp]
	mov	DWORD PTR 0[rbp], esi
	sal	esi, 2
	mov	DWORD PTR 24[rbp], eax
	call	bzero@PLT
	lea	rax, 32[rbp]
	push	0
	.cfi_def_cfa_offset 56
	mov	rdi, r13
	push	rax
	.cfi_def_cfa_offset 64
	mov	r8d, DWORD PTR RX_RING_SIZE[rip]
	mov	r9d, 4
	mov	ecx, DWORD PTR ECORE_CHAIN_CNT_TYPE_U16[rip]
	mov	edx, DWORD PTR ECORE_CHAIN_MODE_NEXT_PTR[rip]
	mov	esi, DWORD PTR ECORE_CHAIN_USE_TO_CONSUME_PRODUCE[rip]
	call	ecore_chain_alloc@PLT
	pop	rdi
	.cfi_def_cfa_offset 56
	pop	r8
	.cfi_def_cfa_offset 48
	test	eax, eax
	je	.L21
.L12:
	mov	rsi, rbp
	mov	rdi, r12
	call	qlnx_free_mem_rxq@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L21:
	.cfi_restore_state
	lea	rax, 28[rbp]
	push	0
	.cfi_def_cfa_offset 56
	mov	ecx, DWORD PTR ECORE_CHAIN_CNT_TYPE_U16[rip]
	mov	rdi, r13
	push	rax
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR ECORE_CHAIN_USE_TO_CONSUME[rip]
	mov	r9d, 4
	mov	r8d, DWORD PTR RX_RING_SIZE[rip]
	mov	edx, DWORD PTR ECORE_CHAIN_MODE_PBL[rip]
	call	ecore_chain_alloc@PLT
	pop	rcx
	.cfi_def_cfa_offset 56
	pop	rsi
	.cfi_def_cfa_offset 48
	test	eax, eax
	jne	.L12
	mov	edx, DWORD PTR ETH_TPA_MAX_AGGS_NUM[rip]
	test	edx, edx
	jle	.L3
	xor	ebx, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L22:
	add	rbx, 1
	cmp	DWORD PTR ETH_TPA_MAX_AGGS_NUM[rip], ebx
	jle	.L3
.L5:
	mov	rax, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR 24[rbp]
	mov	rdi, r12
	lea	rdx, [rax+rbx*4]
	call	qlnx_alloc_tpa_mbuf@PLT
	test	eax, eax
	je	.L22
.L3:
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L6
	xor	r13d, r13d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L23:
	add	r13d, 1
	cmp	DWORD PTR 0[rbp], r13d
	jle	.L1
.L7:
	mov	rsi, rbp
	mov	rdi, r12
	call	qlnx_alloc_rx_buffer@PLT
	test	eax, eax
	je	.L23
	test	r13d, r13d
	je	.L6
	cmp	DWORD PTR 0[rbp], r13d
	jle	.L19
	mov	edx, r13d
	lea	rsi, .LC1[rip]
	mov	rdi, r12
	xor	eax, eax
	call	QL_DPRINT1@PLT
.L19:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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
.L6:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	rdi, r12
	xor	eax, eax
	call	QL_DPRINT1@PLT
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	qlnx_alloc_mem_rxq, .-qlnx_alloc_mem_rxq
	.comm	RX_RING_SIZE,4,4
	.comm	ETH_TPA_MAX_AGGS_NUM,4,4
	.comm	ENOMEM,4,4
	.comm	ECORE_CHAIN_USE_TO_CONSUME_PRODUCE,4,4
	.comm	ECORE_CHAIN_USE_TO_CONSUME,4,4
	.comm	ECORE_CHAIN_MODE_PBL,4,4
	.comm	ECORE_CHAIN_MODE_NEXT_PTR,4,4
	.comm	ECORE_CHAIN_CNT_TYPE_U16,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_qlnx_os.c_qlnx_alloc_mem_rxq.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Rx buffers allocation failed\012\000"
	.align	2
.LC1:
	.ascii	"Allocated less buffers than desired (%d allocated)\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	qlnx_alloc_mem_rxq, %function
qlnx_alloc_mem_rxq:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r1
	ldr	r5, .L24
	ldr	r3, [r0, #4]
	ldr	r1, [r5]
	sub	sp, sp, #20
	mov	r6, r0
	str	r3, [r4, #16]
	str	r1, [r4]
	ldr	r0, [r4, #28]
	lsl	r1, r1, #2
	bl	bzero
	mov	r9, #4
	mov	r3, #0
	ldr	ip, [r5]
	add	lr, r4, #24
	ldr	r8, .L24+4
	ldr	r2, .L24+8
	ldr	r1, .L24+12
	str	r3, [sp, #12]
	str	lr, [sp, #8]
	str	ip, [sp]
	str	r9, [sp, #4]
	add	r7, r6, #8
	mov	r0, r7
	ldr	r3, [r8]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	ecore_chain_alloc
	cmp	r0, #0
	beq	.L21
.L12:
	mov	r1, r4
	mov	r0, r6
	bl	qlnx_free_mem_rxq
	ldr	r3, .L24+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L21:
	ldr	r3, [r5]
	ldr	r2, .L24+20
	ldr	r1, .L24+24
	str	r3, [sp]
	str	r0, [sp, #12]
	str	r9, [sp, #4]
	add	ip, r4, #20
	ldr	r2, [r2]
	ldr	r1, [r1]
	mov	r0, r7
	ldr	r3, [r8]
	str	ip, [sp, #8]
	bl	ecore_chain_alloc
	subs	r5, r0, #0
	bne	.L12
	ldr	r7, .L24+28
	ldr	r3, [r7]
	cmp	r3, #0
	bgt	.L5
	b	.L3
.L22:
	ldr	r3, [r7]
	cmp	r3, r5
	ble	.L3
.L5:
	ldr	r2, [r4, #12]
	mov	r0, r6
	add	r2, r2, r5, lsl #2
	ldr	r1, [r4, #16]
	bl	qlnx_alloc_tpa_mbuf
	cmp	r0, #0
	add	r5, r5, #1
	beq	.L22
.L3:
	ldr	r3, [r4]
	cmp	r3, #0
	ble	.L6
	mov	r5, #0
	b	.L7
.L23:
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L1
.L7:
	mov	r1, r4
	mov	r0, r6
	bl	qlnx_alloc_rx_buffer
	cmp	r0, #0
	beq	.L23
	cmp	r5, #0
	beq	.L6
	ldr	r3, [r4]
	cmp	r3, r5
	ble	.L19
	mov	r2, r5
	mov	r0, r6
	ldr	r1, .L24+32
	bl	QL_DPRINT1
.L19:
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L6:
	mov	r0, r6
	ldr	r1, .L24+36
	bl	QL_DPRINT1
	b	.L12
.L25:
	.align	2
.L24:
	.word	RX_RING_SIZE
	.word	ECORE_CHAIN_CNT_TYPE_U16
	.word	ECORE_CHAIN_MODE_NEXT_PTR
	.word	ECORE_CHAIN_USE_TO_CONSUME_PRODUCE
	.word	ENOMEM
	.word	ECORE_CHAIN_MODE_PBL
	.word	ECORE_CHAIN_USE_TO_CONSUME
	.word	ETH_TPA_MAX_AGGS_NUM
	.word	.LC1
	.word	.LC0
	.size	qlnx_alloc_mem_rxq, .-qlnx_alloc_mem_rxq
	.comm	RX_RING_SIZE,4,4
	.comm	ETH_TPA_MAX_AGGS_NUM,4,4
	.comm	ENOMEM,4,4
	.comm	ECORE_CHAIN_USE_TO_CONSUME_PRODUCE,4,4
	.comm	ECORE_CHAIN_USE_TO_CONSUME,4,4
	.comm	ECORE_CHAIN_MODE_PBL,4,4
	.comm	ECORE_CHAIN_MODE_NEXT_PTR,4,4
	.comm	ECORE_CHAIN_CNT_TYPE_U16,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
