	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_poll_tx_pdma
_mtk_poll_tx_pdma:                      ## @mtk_poll_tx_pdma
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	_MT7628_TX_DTX_IDX0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mtk_r32
	cmpq	%rax, %rbx
	je	LBB0_8
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.2:
	movq	%rax, %r12
	leaq	12(%r15), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rax
	movq	(%rax,%rbx,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MTK_DMA_DUMMY_DESC@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rcx), %ecx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	addl	%ecx, (%rdx)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	incl	(%rcx)
	decl	%r14d
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%rax,%rbx,8), %rsi
	movq	%r15, %rdi
	callq	_mtk_tx_unmap
	leaq	(,%rbx,4), %rax
	addq	24(%r15), %rax
	movq	%rax, 16(%r15)
	movq	%r13, %rdi
	callq	_atomic_inc
	movl	8(%r15), %esi
	movq	%rbx, %rdi
	callq	_NEXT_DESP_IDX
	movq	%rax, %rbx
	cmpq	%r12, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%r14d, %r14d
	jne	LBB0_3
LBB0_8:
	movq	%rbx, (%r15)
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7628_TX_DTX_IDX0,4,2         ## @MT7628_TX_DTX_IDX0
	.comm	_MTK_DMA_DUMMY_DESC,8,3         ## @MTK_DMA_DUMMY_DESC
	.no_dead_strip	_mtk_poll_tx_pdma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_poll_tx_pdma
_mtk_poll_tx_pdma:                      ; @mtk_poll_tx_pdma
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _MT7628_TX_DTX_IDX0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT7628_TX_DTX_IDX0@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_mtk_r32
	cmp	x21, x0
	ccmp	w19, #0, #4, ne
	b.ne	LBB0_2
LBB0_1:
	str	x21, [x20]
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x24, x0
	add	x25, x20, #12
Lloh3:
	adrp	x26, _MTK_DMA_DUMMY_DESC@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MTK_DMA_DUMMY_DESC@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_mtk_tx_unmap
	ldr	x8, [x20, #24]
	add	x8, x8, x21, lsl #2
	str	x8, [x20, #16]
	mov	x0, x25
	bl	_atomic_inc
	ldr	w1, [x20, #8]
	mov	x0, x21
	bl	_NEXT_DESP_IDX
	mov	x21, x0
	cmp	x0, x24
	ccmp	w19, #0, #4, ne
	b.eq	LBB0_1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #32]
	add	x1, x8, x21, lsl #3
	ldr	x8, [x1]
	cbz	x8, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	ldr	w9, [x22]
	add	w8, w9, w8
	str	w8, [x22]
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
	sub	w19, w19, #1
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7628_TX_DTX_IDX0,4,2         ; @MT7628_TX_DTX_IDX0
	.comm	_MTK_DMA_DUMMY_DESC,8,3         ; @MTK_DMA_DUMMY_DESC
	.no_dead_strip	_mtk_poll_tx_pdma
.subsections_via_symbols
