	.file	"extr_ixp4xx_eth.c_destroy_queues.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	destroy_queues, @function
destroy_queues:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	cmp	QWORD PTR [rdi], 0
	je	.L2
	mov	ecx, DWORD PTR RX_DESCS[rip]
	mov	rbx, rdi
	test	ecx, ecx
	jle	.L3
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, ebp
	mov	rdi, rbx
	call	rx_desc_ptr@PLT
	mov	rdx, QWORD PTR 32[rbx]
	mov	r12, QWORD PTR [rdx+rbp*8]
	test	r12, r12
	je	.L4
	mov	rdi, QWORD PTR 24[rbx]
	mov	ecx, DWORD PTR DMA_FROM_DEVICE[rip]
	mov	edx, DWORD PTR RX_BUFF_SIZE[rip]
	mov	rsi, QWORD PTR [rax]
	sub	rsi, QWORD PTR NET_IP_ALIGN[rip]
	call	dma_unmap_single@PLT
	mov	rdi, r12
	call	free_buffer@PLT
.L4:
	add	rbp, 1
	cmp	DWORD PTR RX_DESCS[rip], ebp
	jg	.L5
.L3:
	mov	edx, DWORD PTR TX_DESCS[rip]
	test	edx, edx
	jle	.L6
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L8:
	mov	esi, ebp
	mov	rdi, rbx
	call	tx_desc_ptr@PLT
	mov	rsi, rax
	mov	rax, QWORD PTR 16[rbx]
	mov	r12, QWORD PTR [rax+rbp*8]
	test	r12, r12
	je	.L7
	mov	rdi, rbx
	call	dma_unmap_tx@PLT
	mov	rdi, r12
	call	free_buffer@PLT
.L7:
	add	rbp, 1
	cmp	DWORD PTR TX_DESCS[rip], ebp
	jg	.L8
.L6:
	mov	edx, DWORD PTR 8[rbx]
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, QWORD PTR dma_pool[rip]
	call	dma_pool_free@PLT
	mov	QWORD PTR [rbx], 0
.L2:
	mov	eax, DWORD PTR ports_open[rip]
	test	eax, eax
	jne	.L1
	mov	rdi, QWORD PTR dma_pool[rip]
	test	rdi, rdi
	je	.L1
	call	dma_pool_destroy@PLT
	mov	QWORD PTR dma_pool[rip], 0
.L1:
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	destroy_queues, .-destroy_queues
	.comm	ports_open,4,4
	.comm	dma_pool,8,8
	.comm	TX_DESCS,4,4
	.comm	RX_DESCS,4,4
	.comm	RX_BUFF_SIZE,4,4
	.comm	NET_IP_ALIGN,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_ixp4xx_eth.c_destroy_queues.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	destroy_queues, %function
destroy_queues:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r3, #0
	beq	.L2
	ldr	r6, .L26
	mov	r4, r0
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L3
	mov	r5, #0
	ldr	r9, .L26+4
	ldr	r8, .L26+8
	ldr	r7, .L26+12
.L5:
	mov	r1, r5
	mov	r0, r4
	bl	rx_desc_ptr
	ldr	r3, [r4, #16]
	ldr	r10, [r3, r5, lsl #2]
	add	r5, r5, #1
	cmp	r10, #0
	beq	.L4
	ldr	r1, [r0]
	ldr	r2, [r7]
	ldr	r3, [r9]
	sub	r1, r1, r2
	ldr	r0, [r4, #12]
	ldr	r2, [r8]
	bl	dma_unmap_single
	mov	r0, r10
	bl	free_buffer
.L4:
	ldr	r3, [r6]
	cmp	r3, r5
	bgt	.L5
.L3:
	ldr	r7, .L26+16
	ldr	r3, [r7]
	cmp	r3, #0
	ble	.L6
	mov	r5, #0
.L8:
	mov	r1, r5
	mov	r0, r4
	bl	tx_desc_ptr
	ldr	r3, [r4, #8]
	mov	r1, r0
	ldr	r6, [r3, r5, lsl #2]
	add	r5, r5, #1
	cmp	r6, #0
	beq	.L7
	mov	r0, r4
	bl	dma_unmap_tx
	mov	r0, r6
	bl	free_buffer
.L7:
	ldr	r3, [r7]
	cmp	r3, r5
	bgt	.L8
.L6:
	ldr	r3, .L26+20
	ldr	r2, [r4, #4]
	ldr	r0, [r3]
	ldr	r1, [r4]
	bl	dma_pool_free
	mov	r3, #0
	str	r3, [r4]
.L2:
	ldr	r3, .L26+24
	ldr	r4, [r3]
	cmp	r4, #0
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r5, .L26+20
	ldr	r0, [r5]
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	bl	dma_pool_destroy
	str	r4, [r5]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L27:
	.align	2
.L26:
	.word	RX_DESCS
	.word	DMA_FROM_DEVICE
	.word	RX_BUFF_SIZE
	.word	NET_IP_ALIGN
	.word	TX_DESCS
	.word	dma_pool
	.word	ports_open
	.size	destroy_queues, .-destroy_queues
	.comm	ports_open,4,4
	.comm	dma_pool,4,4
	.comm	TX_DESCS,4,4
	.comm	RX_DESCS,4,4
	.comm	RX_BUFF_SIZE,4,4
	.comm	NET_IP_ALIGN,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
