	.file	"extr_dma.c_mt76_dma_tx_cleanup.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mt76_dma_tx_cleanup, @function
mt76_dma_tx_cleanup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	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, 88
	.cfi_def_cfa_offset 144
	mov	DWORD PTR 12[rsp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 72[rsp], rax
	xor	eax, eax
	mov	eax, esi
	sal	rax, 4
	add	rax, QWORD PTR 8[rdi]
	mov	r14, QWORD PTR 8[rax]
	movaps	XMMWORD PTR 48[rsp], xmm0
	test	r14, r14
	je	.L1
	mov	r15, rdi
	mov	ebp, edx
	mov	r12d, -1
	test	edx, edx
	je	.L40
.L3:
	mov	ebx, DWORD PTR [r14]
	mov	DWORD PTR 8[rsp], 0
	test	ebx, ebx
	je	.L5
	xor	ebx, ebx
	lea	r13, 16[rsp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L9:
	xor	eax, eax
	test	ebp, ebp
	sete	al
	mov	DWORD PTR 8[rsp], eax
.L8:
	test	ebp, ebp
	jne	.L10
	cmp	DWORD PTR 4[r14], r12d
	je	.L41
.L10:
	cmp	DWORD PTR [r14], ebx
	jbe	.L5
.L4:
	mov	edx, DWORD PTR 4[r14]
	cmp	edx, r12d
	je	.L5
	mov	rcx, r13
	mov	rsi, r14
	mov	rdi, r15
	call	mt76_dma_tx_cleanup_idx@PLT
	cmp	QWORD PTR 40[rsp], 0
	je	.L6
	mov	rax, QWORD PTR 16[rsp]
	add	DWORD PTR 48[rsp+rax*4], 1
.L6:
	mov	eax, DWORD PTR 4[r14]
	add	ebx, 1
	add	eax, 1
	cdq
	idiv	DWORD PTR 8[r14]
	cmp	QWORD PTR 32[rsp], 0
	mov	DWORD PTR 4[r14], edx
	je	.L7
	mov	rax, QWORD PTR 16[r15]
	mov	esi, DWORD PTR 12[rsp]
	mov	rdx, r13
	mov	rdi, r15
	call	[QWORD PTR 8[rax]]
.L7:
	mov	rsi, QWORD PTR 24[rsp]
	test	rsi, rsi
	je	.L8
	mov	rax, QWORD PTR 16[r15]
	mov	eax, DWORD PTR [rax]
	test	DWORD PTR MT_TXWI_NO_FREE[rip], eax
	jne	.L9
	mov	rdi, r15
	call	mt76_put_txwi@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	lea	r12, 16[r14]
	lea	r13, 48[rsp]
	mov	rdi, r12
	call	spin_lock_bh@PLT
	sub	DWORD PTR [r14], ebx
	mov	rdi, r13
	xor	ebx, ebx
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	jle	.L42
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edx, DWORD PTR 0[r13+rbx*4]
	test	edx, edx
	je	.L13
	mov	rax, rbx
	sal	rax, 4
	add	rax, QWORD PTR 8[r15]
	sub	DWORD PTR [rax], edx
.L13:
	mov	rdi, r13
	add	rbx, 1
	call	ARRAY_SIZE@PLT
	cmp	eax, ebx
	jg	.L14
.L42:
	test	ebp, ebp
	jne	.L43
.L15:
	mov	ecx, DWORD PTR 8[rsp]
	mov	eax, DWORD PTR [r14]
	test	ecx, ecx
	je	.L16
	mov	edx, DWORD PTR 12[r14]
	test	edx, edx
	je	.L16
	mov	ecx, DWORD PTR 12[rsp]
	cmp	DWORD PTR IEEE80211_NUM_ACS[rip], ecx
	ja	.L44
	.p2align 4,,10
	.p2align 3
.L16:
	test	eax, eax
	je	.L45
.L38:
	mov	rdi, r12
	call	spin_unlock_bh@PLT
.L1:
	mov	rax, QWORD PTR 72[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L46
	add	rsp, 88
	.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
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[r14]
	call	readl@PLT
	mov	r12d, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rsi, r14
	mov	rdi, r15
	call	mt76_dma_sync_idx@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rdi, QWORD PTR 24[r14]
	call	readl@PLT
	mov	r12d, eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L45:
	lea	rdi, 4[r15]
	call	wake_up@PLT
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L44:
	mov	ecx, DWORD PTR 8[r14]
	lea	edx, -8[rcx]
	cmp	edx, eax
	jbe	.L16
	mov	DWORD PTR 12[r14], 0
	test	eax, eax
	je	.L47
.L37:
	mov	rdi, r12
	call	spin_unlock_bh@PLT
	mov	esi, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR [r15]
	call	ieee80211_wake_queue@PLT
	jmp	.L1
.L47:
	lea	rdi, 4[r15]
	call	wake_up@PLT
	jmp	.L37
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mt76_dma_tx_cleanup, .-mt76_dma_tx_cleanup
	.comm	MT_TXWI_NO_FREE,4,4
	.comm	IEEE80211_NUM_ACS,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_dma.c_mt76_dma_tx_cleanup.c"
	.text
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mt76_dma_tx_cleanup, %function
mt76_dma_tx_cleanup:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r1
	mov	r3, #0
	ldr	r1, [r0, #8]
	mov	r7, r2
	add	r1, r1, r10, lsl #3
	ldr	r4, [r1, #4]
	ldr	r2, .L57
	sub	sp, sp, #44
	cmp	r4, r3
	ldr	r2, [r2]
	str	r2, [sp, #36]
	mov	r2,#0
	str	r3, [sp, #20]
	str	r3, [sp, #24]
	str	r3, [sp, #28]
	str	r3, [sp, #32]
	beq	.L1
	cmp	r7, r3
	mov	r5, r0
	mvnne	r8, #0
	beq	.L49
.L3:
	ldr	r6, [r4]
	cmp	r6, #0
	moveq	r9, r6
	beq	.L5
	mov	r9, #0
	ldr	fp, .L57+4
	mov	r6, r9
	b	.L4
.L9:
	clz	r9, r7
	lsr	r9, r9, #5
.L8:
	cmp	r7, #0
	bne	.L10
	ldr	r3, [r4, #4]
	cmp	r3, r8
	beq	.L50
.L10:
	ldr	r3, [r4]
	cmp	r3, r6
	bls	.L5
.L4:
	ldr	r2, [r4, #4]
	cmp	r2, r8
	beq	.L5
	add	r3, sp, #4
	mov	r1, r4
	mov	r0, r5
	bl	mt76_dma_tx_cleanup_idx
	ldr	r3, [sp, #16]
	cmp	r3, #0
	beq	.L6
	ldr	r3, [sp, #4]
	add	r2, sp, #40
	add	r3, r2, r3, lsl #2
	ldr	r2, [r3, #-20]
	add	r2, r2, #1
	str	r2, [r3, #-20]
.L6:
	ldmib	r4, {r0, r1}
	add	r0, r0, #1
	bl	__aeabi_idivmod
	ldr	r3, [sp, #12]
	add	r6, r6, #1
	cmp	r3, #0
	str	r1, [r4, #4]
	beq	.L7
	ldr	r3, [r5, #12]
	mov	r1, r10
	mov	r0, r5
	ldr	r3, [r3, #4]
	add	r2, sp, #4
	blx	r3
.L7:
	ldr	r1, [sp, #8]
	cmp	r1, #0
	beq	.L8
	ldr	r2, [r5, #12]
	ldr	r3, [fp]
	ldr	r2, [r2]
	tst	r2, r3
	bne	.L9
	mov	r0, r5
	bl	mt76_put_txwi
	b	.L9
.L5:
	add	fp, r4, #16
	mov	r0, fp
	bl	spin_lock_bh
	ldr	r3, [r4]
	add	r0, sp, #20
	sub	r6, r3, r6
	str	r6, [r4]
	bl	ARRAY_SIZE
	mov	r6, #0
	cmp	r0, r6
	add	r8, sp, #20
	ble	.L51
.L14:
	ldr	r2, [r8], #4
	add	r0, sp, #20
	cmp	r2, #0
	ldrne	r1, [r5, #8]
	ldrne	r3, [r1, r6, lsl #3]
	subne	r3, r3, r2
	strne	r3, [r1, r6, lsl #3]
	bl	ARRAY_SIZE
	add	r6, r6, #1
	cmp	r0, r6
	bgt	.L14
.L51:
	cmp	r7, #0
	bne	.L52
.L15:
	cmp	r9, #0
	ldr	r3, [r4]
	beq	.L16
	ldr	r2, [r4, #12]
	cmp	r2, #0
	beq	.L16
	ldr	r2, .L57+8
	ldr	r2, [r2]
	cmp	r2, r10
	bhi	.L53
.L16:
	cmp	r3, #0
	beq	.L54
.L47:
	mov	r0, fp
	bl	spin_unlock_bh
.L1:
	ldr	r3, .L57
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L55
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L50:
	ldr	r0, [r4, #20]
	bl	readl
	mov	r8, r0
	b	.L10
.L52:
	mov	r1, r4
	mov	r0, r5
	bl	mt76_dma_sync_idx
	b	.L15
.L49:
	ldr	r0, [r4, #20]
	bl	readl
	mov	r8, r0
	b	.L3
.L54:
	add	r0, r5, #4
	bl	wake_up
	b	.L47
.L53:
	ldr	r2, [r4, #8]
	sub	r2, r2, #8
	cmp	r2, r3
	bls	.L16
	mov	r2, #0
	cmp	r3, r2
	str	r2, [r4, #12]
	beq	.L56
.L46:
	mov	r0, fp
	bl	spin_unlock_bh
	mov	r1, r10
	ldr	r0, [r5]
	bl	ieee80211_wake_queue
	b	.L1
.L56:
	add	r0, r5, #4
	bl	wake_up
	b	.L46
.L55:
	bl	__stack_chk_fail
.L58:
	.align	2
.L57:
	.word	.LC0
	.word	MT_TXWI_NO_FREE
	.word	IEEE80211_NUM_ACS
	.size	mt76_dma_tx_cleanup, .-mt76_dma_tx_cleanup
	.comm	MT_TXWI_NO_FREE,4,4
	.comm	IEEE80211_NUM_ACS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
