	.file	"extr_core.c_emac_resize_rx_ring.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	emac_resize_rx_ring, @function
emac_resize_rx_ring:
.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, esi
	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
	mov	rbp, rdi
	mov	edi, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	emac_rx_sync_size@PLT
	mov	edi, r14d
	mov	r13d, eax
	call	emac_rx_skb_size@PLT
	mov	r12d, eax
	lea	rax, 4[rbp]
	mov	rdi, rax
	mov	QWORD PTR 8[rsp], rax
	call	mutex_lock@PLT
	mov	rdi, rbp
	call	emac_netif_stop@PLT
	mov	rdi, rbp
	call	emac_rx_disable@PLT
	mov	edi, DWORD PTR 12[rbp]
	mov	esi, DWORD PTR 8[rbp]
	call	mal_disable_rx_channel@PLT
	mov	rdi, QWORD PTR 72[rbp]
	test	rdi, rdi
	je	.L2
	add	DWORD PTR 64[rbp], 1
	call	dev_kfree_skb@PLT
	mov	QWORD PTR 72[rbp], 0
.L2:
	mov	esi, DWORD PTR NUM_RX_BUFF[rip]
	test	esi, esi
	jle	.L13
	mov	edi, DWORD PTR MAL_RX_CTRL_EMPTY[rip]
	mov	rax, QWORD PTR 56[rbp]
	lea	r9d, -1[rsi]
	xor	edx, edx
	mov	r8d, DWORD PTR MAL_RX_CTRL_WRAP[rip]
	mov	r10d, DWORD PTR MAL_RX_CTRL_FIRST[rip]
	or	r8d, edi
	.p2align 4,,10
	.p2align 3
.L8:
	test	DWORD PTR [rax], r10d
	je	.L6
	add	DWORD PTR 64[rbp], 1
.L6:
	cmp	edx, r9d
	mov	ecx, edi
	mov	QWORD PTR 16[rax], 0
	cmove	ecx, r8d
	add	edx, 1
	add	rax, 24
	mov	DWORD PTR -24[rax], ecx
	cmp	edx, esi
	jne	.L8
	xor	ebx, ebx
	cmp	DWORD PTR 0[rbp], r12d
	jl	.L12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rax, QWORD PTR 40[rbp]
	xor	edi, edi
	cmp	QWORD PTR [rax+rbx*8], 0
	sete	dil
	call	BUG_ON@PLT
	mov	rax, QWORD PTR 40[rbp]
	mov	rdi, QWORD PTR [rax+rbx*8]
	call	dev_kfree_skb@PLT
	mov	rax, QWORD PTR EMAC_RX_SKB_HEADROOM[rip]
	mov	rdi, r15
	lea	rsi, 2[rax]
	call	skb_reserve@PLT
	mov	rax, QWORD PTR [r15]
	mov	rdi, QWORD PTR 48[rbp]
	mov	edx, r13d
	mov	ecx, DWORD PTR DMA_FROM_DEVICE[rip]
	lea	rsi, -2[rax]
	call	dma_map_single@PLT
	mov	rcx, QWORD PTR 56[rbp]
	lea	rdx, [rbx+rbx*2]
	add	rax, 2
	lea	rdx, [rcx+rdx*8]
	mov	QWORD PTR 8[rdx], rax
	mov	rax, QWORD PTR 40[rbp]
	mov	QWORD PTR [rax+rbx*8], r15
	add	rbx, 1
	cmp	DWORD PTR NUM_RX_BUFF[rip], ebx
	jle	.L13
.L12:
	mov	esi, DWORD PTR GFP_ATOMIC[rip]
	mov	edi, r12d
	call	alloc_skb@PLT
	mov	r15, rax
	test	rax, rax
	jne	.L10
	mov	r12d, DWORD PTR ENOMEM[rip]
	lea	r13, 24[rbp]
	neg	r12d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR ETH_DATA_LEN[rip]
	mov	rcx, QWORD PTR 32[rbp]
	lea	r13, 24[rbp]
	cmp	eax, r14d
	setl	dl
	cmp	eax, DWORD PTR [rcx]
	setl	al
	cmp	dl, al
	jne	.L27
.L5:
	mov	edi, r14d
	xor	r12d, r12d
	call	emac_rx_size@PLT
	mov	esi, DWORD PTR 8[rbp]
	mov	edi, DWORD PTR 12[rbp]
	mov	edx, eax
	call	mal_set_rcbs@PLT
.L11:
	mov	edi, DWORD PTR MAL_COMMAC_RX_STOPPED[rip]
	mov	rsi, r13
	call	clear_bit@PLT
	mov	QWORD PTR 16[rbp], 0
	mov	esi, DWORD PTR 8[rbp]
	mov	edi, DWORD PTR 12[rbp]
	call	mal_enable_rx_channel@PLT
	mov	rdi, rbp
	call	emac_rx_enable@PLT
	mov	rdi, rbp
	call	emac_netif_start@PLT
	mov	rdi, QWORD PTR 8[rsp]
	call	mutex_unlock@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L27:
	.cfi_restore_state
	mov	edi, DWORD PTR MAL_COMMAC_RX_STOPPED[rip]
	mov	rsi, r13
	call	set_bit@PLT
	mov	rax, QWORD PTR 32[rbp]
	mov	rdi, rbp
	mov	DWORD PTR [rax], r14d
	call	emac_full_tx_reset@PLT
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	emac_resize_rx_ring, .-emac_resize_rx_ring
	.comm	NUM_RX_BUFF,4,4
	.comm	MAL_RX_CTRL_WRAP,4,4
	.comm	MAL_RX_CTRL_FIRST,4,4
	.comm	MAL_RX_CTRL_EMPTY,4,4
	.comm	MAL_COMMAC_RX_STOPPED,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	ETH_DATA_LEN,4,4
	.comm	ENOMEM,4,4
	.comm	EMAC_RX_SKB_HEADROOM,8,8
	.comm	DMA_FROM_DEVICE,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_core.c_emac_resize_rx_ring.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	emac_resize_rx_ring, %function
emac_resize_rx_ring:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	sub	sp, sp, #12
	mov	r0, r1
	mov	r5, r1
	str	r1, [sp]
	bl	emac_rx_sync_size
	mov	r8, r0
	mov	r0, r5
	bl	emac_rx_skb_size
	add	r3, r4, #4
	mov	r7, r0
	mov	r0, r3
	str	r3, [sp, #4]
	bl	mutex_lock
	mov	r0, r4
	bl	emac_netif_stop
	mov	r0, r4
	bl	emac_rx_disable
	ldr	r1, [r4, #8]
	ldr	r0, [r4, #12]
	bl	mal_disable_rx_channel
	ldr	r0, [r4, #44]
	cmp	r0, #0
	beq	.L2
	ldr	r3, [r4, #40]
	add	r3, r3, #1
	str	r3, [r4, #40]
	bl	dev_kfree_skb
	mov	r3, #0
	str	r3, [r4, #44]
.L2:
	ldr	r10, .L27
	ldr	r0, [r10]
	cmp	r0, #0
	ble	.L13
	mov	r2, #0
	mov	r9, r2
	ldr	r3, .L27+4
	ldr	ip, .L27+8
	ldr	r1, .L27+12
	ldr	lr, [r3]
	ldr	ip, [ip]
	ldr	r3, [r4, #36]
	ldr	r6, [r1]
	orr	ip, lr, ip
	add	r3, r3, #8
	sub	r5, r0, #1
.L8:
	ldr	r1, [r3, #-8]
	add	r3, r3, #12
	tst	r6, r1
	ldrne	r1, [r4, #40]
	addne	r1, r1, #1
	strne	r1, [r4, #40]
	cmp	r2, r5
	movne	r1, lr
	moveq	r1, ip
	add	r2, r2, #1
	cmp	r2, r0
	str	r9, [r3, #-12]
	str	r1, [r3, #-20]
	bne	.L8
	ldr	r3, [r4]
	cmp	r3, r7
	bge	.L13
	mov	r5, #0
	ldr	r9, .L27+16
	ldr	fp, .L27+20
	b	.L12
.L10:
	ldr	r3, [r4, #28]
	ldr	r0, [r3, r5, lsl #2]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	BUG_ON
	ldr	r3, [r4, #28]
	ldr	r0, [r3, r5, lsl #2]
	bl	dev_kfree_skb
	ldr	r1, [fp]
	mov	r0, r6
	add	r1, r1, #2
	bl	skb_reserve
	ldr	r1, [r6]
	ldr	r3, .L27+24
	mov	r2, r8
	ldr	r3, [r3]
	sub	r1, r1, #2
	ldr	r0, [r4, #32]
	bl	dma_map_single
	ldr	r3, [r4, #36]
	add	r2, r5, r5, lsl #1
	ldr	r1, [r4, #28]
	add	r3, r3, r2, lsl #2
	add	r0, r0, #2
	ldr	r2, [r10]
	str	r0, [r3, #4]
	str	r6, [r1, r5, lsl #2]
	add	r5, r5, #1
	cmp	r2, r5
	ble	.L13
.L12:
	mov	r0, r7
	ldr	r1, [r9]
	bl	alloc_skb
	subs	r6, r0, #0
	bne	.L10
	ldr	r3, .L27+28
	ldr	r6, .L27+32
	ldr	r5, [r3]
	add	r7, r4, #20
	rsb	r5, r5, #0
	b	.L11
.L13:
	ldr	r2, [r4, #24]
	ldr	r3, .L27+36
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, [sp]
	ldr	r6, .L27+32
	cmp	r3, r2
	movge	r2, #0
	movlt	r2, #1
	cmp	r3, r1
	movge	r3, #0
	movlt	r3, #1
	cmp	r2, r3
	add	r7, r4, #20
	bne	.L4
.L5:
	ldr	r0, [sp]
	ldr	r5, [r4, #12]
	ldr	r8, [r4, #8]
	bl	emac_rx_size
	mov	r1, r8
	mov	r2, r0
	mov	r0, r5
	bl	mal_set_rcbs
	mov	r5, #0
.L11:
	mov	r1, r7
	ldr	r0, [r6]
	bl	clear_bit
	mov	r3, #0
	ldr	r1, [r4, #8]
	str	r3, [r4, #16]
	ldr	r0, [r4, #12]
	bl	mal_enable_rx_channel
	mov	r0, r4
	bl	emac_rx_enable
	mov	r0, r4
	bl	emac_netif_start
	ldr	r0, [sp, #4]
	bl	mutex_unlock
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	mov	r1, r7
	ldr	r0, [r6]
	bl	set_bit
	ldr	r3, [r4, #24]
	ldr	r2, [sp]
	mov	r0, r4
	str	r2, [r3]
	bl	emac_full_tx_reset
	b	.L5
.L28:
	.align	2
.L27:
	.word	NUM_RX_BUFF
	.word	MAL_RX_CTRL_EMPTY
	.word	MAL_RX_CTRL_WRAP
	.word	MAL_RX_CTRL_FIRST
	.word	GFP_ATOMIC
	.word	EMAC_RX_SKB_HEADROOM
	.word	DMA_FROM_DEVICE
	.word	ENOMEM
	.word	MAL_COMMAC_RX_STOPPED
	.word	ETH_DATA_LEN
	.size	emac_resize_rx_ring, .-emac_resize_rx_ring
	.comm	NUM_RX_BUFF,4,4
	.comm	MAL_RX_CTRL_WRAP,4,4
	.comm	MAL_RX_CTRL_FIRST,4,4
	.comm	MAL_RX_CTRL_EMPTY,4,4
	.comm	MAL_COMMAC_RX_STOPPED,4,4
	.comm	GFP_ATOMIC,4,4
	.comm	ETH_DATA_LEN,4,4
	.comm	ENOMEM,4,4
	.comm	EMAC_RX_SKB_HEADROOM,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
