	.file	"extr_bnad.c_bnad_rxq_refill_page.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bnad_rxq_refill_page, @function
bnad_rxq_refill_page:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rax, rsi
	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
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	r13, QWORD PTR 40[rsi]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR 8[rsp], rsi
	mov	rsi, QWORD PTR [rsi]
	mov	QWORD PTR 32[rsp], rax
	mov	rcx, QWORD PTR 0[r13]
	mov	rax, QWORD PTR PAGE_SIZE[rip]
	mov	QWORD PTR [rsp], rdi
	mov	QWORD PTR 48[rsp], rdx
	sal	rax, cl
	mov	QWORD PTR 24[rsp], rsi
	mov	QWORD PTR 40[rsp], rax
	test	rdx, rdx
	je	.L10
	lea	rax, [rsi+rsi*2]
	xor	r12d, r12d
	sal	rax, 3
	mov	QWORD PTR 16[rsp], rax
	lea	rax, 0[0+rsi*4]
	mov	QWORD PTR 56[rsp], rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR [rsp]
	mov	rcx, QWORD PTR 16[r13]
	mov	rsi, r14
	mov	rdx, rbx
	mov	r8d, DWORD PTR DMA_FROM_DEVICE[rip]
	mov	rdi, QWORD PTR [rax]
	call	dma_map_page@PLT
	mov	r15d, eax
	mov	esi, eax
	mov	rax, QWORD PTR [rsp]
	mov	rdi, QWORD PTR [rax]
	call	dma_mapping_error@PLT
	test	rax, rax
	jne	.L18
	mov	QWORD PTR 0[rbp], rbx
	mov	edx, r15d
	lea	rdi, 8[rbp]
	mov	esi, r15d
	mov	QWORD PTR 16[rbp], r14
	call	dma_unmap_addr_set@PLT
	mov	rax, QWORD PTR 16[r13]
	mov	rsi, QWORD PTR 56[rsp]
	mov	edi, r15d
	add	rbx, rax
	cmp	QWORD PTR 40[rsp], rbx
	mov	rbx, QWORD PTR 24[rsp]
	mov	QWORD PTR 8[rbp], rax
	mov	rax, -1
	cmova	rax, rbx
	add	r12, 1
	mov	QWORD PTR 8[r13], rax
	mov	rax, QWORD PTR 8[rsp]
	add	rsi, QWORD PTR 24[rax]
	call	BNA_SET_DMA_ADDR@PLT
	mov	rsi, QWORD PTR 32[rsp]
	mov	rdi, rbx
	call	BNA_QE_INDX_INC@PLT
	cmp	QWORD PTR 48[rsp], r12
	je	.L2
.L6:
	mov	rdx, QWORD PTR 8[r13]
	mov	rax, QWORD PTR 24[r13]
	mov	rcx, QWORD PTR 16[rsp]
	mov	rbx, QWORD PTR 16[r13]
	lea	rdx, [rdx+rdx*2]
	lea	rbp, [rax+rcx]
	lea	rax, [rax+rdx*8]
	mov	r14, QWORD PTR 16[rax]
	add	rbx, QWORD PTR [rax]
	mov	rdi, r14
	call	get_page@PLT
	xor	edi, edi
	test	r14, r14
	sete	dil
	call	unlikely@PLT
	test	rax, rax
	je	.L3
	mov	esi, DWORD PTR rxbuf_alloc_failed[rip]
	mov	rdi, QWORD PTR [rsp]
	call	BNAD_UPDATE_CTR@PLT
	mov	rax, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR 32[rax]
	add	DWORD PTR 4[rax], 1
.L2:
	mov	rdi, r12
	call	likely@PLT
	test	rax, rax
	jne	.L19
.L1:
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	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
.L19:
	.cfi_restore_state
	mov	rbx, QWORD PTR 8[rsp]
	mov	rcx, QWORD PTR 24[rsp]
	xor	eax, eax
	mov	QWORD PTR [rbx], rcx
	call	smp_mb@PLT
	mov	edi, DWORD PTR BNAD_RXQ_POST_OK[rip]
	lea	rsi, 16[rbx]
	call	test_bit@PLT
	mov	rdi, rax
	call	likely@PLT
	test	rax, rax
	je	.L1
	mov	rdi, QWORD PTR 8[rsp]
	call	bna_rxq_prod_indx_doorbell@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, r14
	call	put_page@PLT
	mov	esi, DWORD PTR rxbuf_map_failed[rip]
	mov	rdi, QWORD PTR [rsp]
	call	BNAD_UPDATE_CTR@PLT
	mov	rax, QWORD PTR 8[rsp]
	mov	rax, QWORD PTR 32[rax]
	add	DWORD PTR [rax], 1
	jmp	.L2
.L10:
	xor	r12d, r12d
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	bnad_rxq_refill_page, .-bnad_rxq_refill_page
	.comm	rxbuf_map_failed,4,4
	.comm	rxbuf_alloc_failed,4,4
	.comm	__GFP_COMP,4,4
	.comm	PAGE_SIZE,8,8
	.comm	GFP_ATOMIC,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.comm	BNAD_RXQ_POST_OK,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_bnad.c_bnad_rxq_refill_page.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bnad_rxq_refill_page, %function
bnad_rxq_refill_page:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	ip, r1
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #44
	ldr	r5, [r1, #20]
	str	r1, [sp, #20]
	ldr	r1, .L20
	ldr	r3, [r5]
	ldr	r1, [r1]
	cmp	r2, #0
	lsl	r3, r1, r3
	str	r3, [sp, #32]
	ldr	r3, [ip, #4]
	ldr	fp, [ip]
	str	r2, [sp, #24]
	str	r0, [sp, #12]
	str	r3, [sp, #28]
	beq	.L10
	add	r3, fp, fp, lsl #1
	lsl	r3, r3, #2
	str	r3, [sp, #16]
	lsl	r3, fp, #2
	mov	r9, #0
	str	r3, [sp, #36]
	b	.L6
.L3:
	ldr	r2, .L20+4
	ldr	r0, [sp, #12]
	ldr	r2, [r2]
	ldr	r3, [r5, #8]
	str	r2, [sp]
	mov	r1, r7
	mov	r2, r4
	ldr	r0, [r0]
	bl	dma_map_page
	mov	r10, r0
	ldr	r0, [sp, #12]
	mov	r1, r10
	ldr	r0, [r0]
	bl	dma_mapping_error
	mov	r3, r0
	cmp	r3, #0
	add	r0, r8, #4
	bne	.L18
	ldr	r3, [sp, #16]
	mov	r2, r10
	mov	r1, r10
	str	r7, [r8, #8]
	str	r4, [r6, r3]
	bl	dma_unmap_addr_set
	ldr	r2, [sp, #20]
	ldr	r3, [r5, #8]
	ldr	ip, [r2, #12]
	ldr	r2, [sp, #32]
	add	r4, r3, r4
	cmp	r2, r4
	movhi	r2, fp
	mvnls	r2, #0
	str	r3, [r8, #4]
	ldr	r3, [sp, #36]
	str	r2, [r5, #4]
	add	r1, r3, ip
	mov	r0, r10
	bl	BNA_SET_DMA_ADDR
	mov	r0, fp
	ldr	r1, [sp, #28]
	bl	BNA_QE_INDX_INC
	ldr	r3, [sp, #24]
	add	r9, r9, #1
	cmp	r3, r9
	beq	.L2
.L6:
	ldr	r3, [r5, #4]
	ldr	r6, [r5, #12]
	add	r3, r3, r3, lsl #1
	add	r2, r6, r3, lsl #2
	ldr	r7, [r2, #8]
	ldr	r4, [r6, r3, lsl #2]
	ldr	r3, [r5, #8]
	mov	r0, r7
	add	r4, r4, r3
	bl	get_page
	clz	r0, r7
	lsr	r0, r0, #5
	bl	unlikely
	ldr	r3, [sp, #16]
	cmp	r0, #0
	add	r8, r6, r3
	beq	.L3
	ldr	r3, .L20+8
	ldr	r0, [sp, #12]
	ldr	r1, [r3]
	bl	BNAD_UPDATE_CTR
	ldr	r3, [sp, #20]
	ldr	r2, [r3, #16]
	ldr	r3, [r2, #4]
	add	r3, r3, #1
	str	r3, [r2, #4]
.L2:
	mov	r0, r9
	bl	likely
	cmp	r0, #0
	bne	.L19
.L1:
	mov	r0, r9
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L19:
	ldr	r4, [sp, #20]
	str	fp, [r4], #8
	bl	smp_mb
	ldr	r3, .L20+12
	mov	r1, r4
	ldr	r0, [r3]
	bl	test_bit
	bl	likely
	cmp	r0, #0
	beq	.L1
	ldr	r0, [sp, #20]
	bl	bna_rxq_prod_indx_doorbell
	mov	r0, r9
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	mov	r0, r7
	bl	put_page
	ldr	r3, .L20+16
	ldr	r0, [sp, #12]
	ldr	r1, [r3]
	bl	BNAD_UPDATE_CTR
	ldr	r3, [sp, #20]
	ldr	r2, [r3, #16]
	ldr	r3, [r2]
	add	r3, r3, #1
	str	r3, [r2]
	b	.L2
.L10:
	ldr	r9, [sp, #24]
	b	.L2
.L21:
	.align	2
.L20:
	.word	PAGE_SIZE
	.word	DMA_FROM_DEVICE
	.word	rxbuf_alloc_failed
	.word	BNAD_RXQ_POST_OK
	.word	rxbuf_map_failed
	.size	bnad_rxq_refill_page, .-bnad_rxq_refill_page
	.comm	rxbuf_map_failed,4,4
	.comm	rxbuf_alloc_failed,4,4
	.comm	__GFP_COMP,4,4
	.comm	PAGE_SIZE,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.comm	BNAD_RXQ_POST_OK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
