	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76_dma_tx_cleanup_idx
_mt76_dma_tx_cleanup_idx:               ## @mt76_dma_tx_cleanup_idx
	.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, %r14
	movq	%rsi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movq	8(%rsi), %r13
	movslq	%edx, %rcx
	leaq	(%rcx,%rcx,2), %r15
	movl	8(%rax,%r15,4), %edi
	callq	_READ_ONCE
	movl	%eax, %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	cmpl	$0, 16(%r13,%r15,8)
	jne	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movl	4(%rax,%r15,4), %edi
	callq	_READ_ONCE
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_MT_DMA_CTL_SD_LEN0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_GET
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r14d
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_le32_to_cpu
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r14d, %edi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %esi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_dma_unmap_single
LBB0_2:
	movq	_MT_DMA_CTL_LAST_SEC0@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	jne	LBB0_4
## %bb.3:
	movq	(%rbx), %rax
	movl	(%rax,%r15,4), %edi
	callq	_READ_ONCE
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %r14d
	movq	_MT_DMA_CTL_SD_LEN1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_GET
	movl	%eax, %r12d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ebx
	movl	%r14d, %edi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	callq	_le32_to_cpu
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_dma_unmap_single
LBB0_4:
	leaq	(,%r15,8), %rdi
	addq	%r13, %rdi
	movq	_DMA_DUMMY_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, 8(%r13,%r15,8)
	je	LBB0_5
## %bb.6:
	cmpq	%rcx, (%rdi)
	je	LBB0_7
LBB0_8:
	movq	16(%rdi), %rax
	movq	%rax, 16(%r14)
	movups	(%rdi), %xmm0
	movups	%xmm0, (%r14)
	xorl	%esi, %esi
	movl	$24, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memset                         ## TAILCALL
LBB0_5:
	leaq	8(,%r15,8), %rcx
	addq	%r13, %rcx
	movq	$0, (%rcx)
	movq	(%rax), %rcx
	cmpq	%rcx, (%rdi)
	jne	LBB0_8
LBB0_7:
	movq	$0, (%rdi)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MT_DMA_CTL_SD_LEN0,4,2         ## @MT_DMA_CTL_SD_LEN0
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_MT_DMA_CTL_LAST_SEC0,4,2       ## @MT_DMA_CTL_LAST_SEC0
	.comm	_MT_DMA_CTL_SD_LEN1,4,2         ## @MT_DMA_CTL_SD_LEN1
	.comm	_DMA_DUMMY_DATA,8,3             ## @DMA_DUMMY_DATA
	.no_dead_strip	_mt76_dma_tx_cleanup_idx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76_dma_tx_cleanup_idx
_mt76_dma_tx_cleanup_idx:               ; @mt76_dma_tx_cleanup_idx
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
                                        ; kill: def $w2 killed $w2 def $x2
	mov	x22, x1
	mov	x21, x0
	sxtw	x27, w2
	mov	w8, #24
	ldp	x9, x28, [x1]
	smaddl	x20, w2, w8, x28
	mov	w8, #12
	smaddl	x8, w2, w8, x9
	ldr	w0, [x8, #8]
	bl	_READ_ONCE
	bl	_le32_to_cpu
	mov	x23, x0
	ldr	w8, [x20, #16]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	x8, [x22]
	mov	w9, #12
	madd	x8, x27, x9, x8
	ldr	w0, [x8, #4]
	bl	_READ_ONCE
	mov	x24, x0
Lloh0:
	adrp	x8, _MT_DMA_CTL_SD_LEN0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT_DMA_CTL_SD_LEN0@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_FIELD_GET
	mov	x25, x0
	ldr	w26, [x21]
	mov	x0, x24
	bl	_le32_to_cpu
	mov	x1, x0
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x26
	mov	x2, x25
	bl	_dma_unmap_single
LBB0_2:
Lloh6:
	adrp	x8, _MT_DMA_CTL_LAST_SEC0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MT_DMA_CTL_LAST_SEC0@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w23
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x22]
	mov	w9, #12
	mul	x9, x27, x9
	ldr	w0, [x8, x9]
	bl	_READ_ONCE
	mov	x22, x0
Lloh9:
	adrp	x8, _MT_DMA_CTL_SD_LEN1@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MT_DMA_CTL_SD_LEN1@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_FIELD_GET
	mov	x23, x0
	ldr	w21, [x21]
	mov	x0, x22
	bl	_le32_to_cpu
	mov	x1, x0
Lloh12:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x2, x23
	bl	_dma_unmap_single
LBB0_4:
	mov	w8, #24
	madd	x8, x27, x8, x28
	ldr	x11, [x8, #8]!
Lloh15:
	adrp	x10, _DMA_DUMMY_DATA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _DMA_DUMMY_DATA@GOTPAGEOFF]
	ldr	x9, [x10]
	cmp	x11, x9
	b.ne	LBB0_6
; %bb.5:
	str	xzr, [x8]
	ldr	x9, [x10]
LBB0_6:
	ldr	x8, [x20]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	str	xzr, [x20]
LBB0_8:
	ldr	q0, [x20]
	ldr	x8, [x20, #16]
	str	x8, [x19, #16]
	str	q0, [x19]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_memset
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MT_DMA_CTL_SD_LEN0,4,2         ; @MT_DMA_CTL_SD_LEN0
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_MT_DMA_CTL_LAST_SEC0,4,2       ; @MT_DMA_CTL_LAST_SEC0
	.comm	_MT_DMA_CTL_SD_LEN1,4,2         ; @MT_DMA_CTL_SD_LEN1
	.comm	_DMA_DUMMY_DATA,8,3             ; @DMA_DUMMY_DATA
	.no_dead_strip	_mt76_dma_tx_cleanup_idx
.subsections_via_symbols
