	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76_dma_add_buf
_mt76_dma_add_buf:                      ## @mt76_dma_add_buf
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	16(%rbp), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	_DMA_DUMMY_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rdi
	movq	16(%r14), %rdx
	leaq	(%rdi,%rdi,2), %rdi
	movq	%rax, 16(%rdx,%rdi,8)
	movl	$1, (%rdx,%rdi,8)
LBB0_2:
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.4:
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	leal	-1(%rcx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %eax
	negl	%eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%edx, %edx
	divq	%rcx
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%r13d, %edi
	movq	%rdx, (%r14)
	movq	32(%r14), %r15
	movslq	%esi, %r14
	shlq	$4, %r14
	movl	12(%r15,%r14), %r13d
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	callq	_cpu_to_le32
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	8(%r15,%r14), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	4(%r15,%r14), %ebx
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	movl	(%r15,%r14), %ebx
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_le32
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_WRITE_ONCE
	incl	24(%r14)
	addq	$2, %r12
	cmpl	-96(%rbp), %r12d                ## 4-byte Folded Reload
	jge	LBB0_16
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %r15
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r12,8), %esi
	movl	4(%rax,%r12,8), %r13d
	movq	_MT_DMA_CTL_SD_LEN0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	cmpl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	jge	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax,%r12,8), %esi
	movl	12(%rax,%r12,8), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MT_DMA_CTL_SD_LEN1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	orl	%eax, %ebx
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$-1, %r15d
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$-2, %r15d
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_MT_DMA_CTL_LAST_SEC1@GOTPCREL(%rip), %rax
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_MT_DMA_CTL_LAST_SEC0@GOTPCREL(%rip), %rax
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	orl	(%rax), %ebx
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rsi
	leaq	1(%rsi), %rax
	movslq	8(%r14), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	jmp	LBB0_15
LBB0_16:
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	movq	16(%rbp), %rsi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_3:
	movl	$-1, %eax
LBB0_17:
	movq	16(%r14), %rcx
	cltq
	leaq	(%rax,%rax,2), %rdx
	movq	%rsi, 16(%rcx,%rdx,8)
	movq	%r9, 8(%rcx,%rdx,8)
                                        ## kill: def $eax killed $eax killed $rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_DUMMY_DATA,8,3             ## @DMA_DUMMY_DATA
	.comm	_MT_DMA_CTL_SD_LEN0,4,2         ## @MT_DMA_CTL_SD_LEN0
	.comm	_MT_DMA_CTL_SD_LEN1,4,2         ## @MT_DMA_CTL_SD_LEN1
	.comm	_MT_DMA_CTL_LAST_SEC0,4,2       ## @MT_DMA_CTL_LAST_SEC0
	.comm	_MT_DMA_CTL_LAST_SEC1,4,2       ## @MT_DMA_CTL_LAST_SEC1
	.no_dead_strip	_mt76_dma_add_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76_dma_add_buf
_mt76_dma_add_buf:                      ; @mt76_dma_add_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	str	w4, [sp, #28]                   ; 4-byte Folded Spill
	mov	x21, x1
	cbz	x6, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _DMA_DUMMY_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_DUMMY_DATA@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x21, #16]
	ldr	x10, [x21]
	mov	w11, #24
	madd	x9, x10, x11, x9
	str	x8, [x9, #16]
	mov	w8, #1
	str	w8, [x9]
LBB0_2:
	subs	w8, w3, #1
	str	w8, [sp, #24]                   ; 4-byte Folded Spill
	b.lt	LBB0_14
; %bb.3:
	stp	x6, x5, [sp]                    ; 16-byte Folded Spill
	mov	w20, #0
	neg	w8, w3
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	add	x23, x2, #8
	mov	x22, x3
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
Lloh3:
	adrp	x8, _MT_DMA_CTL_LAST_SEC0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT_DMA_CTL_LAST_SEC0@GOTPAGEOFF]
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x8]
	orr	w24, w8, w24
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x25, [x21]
	add	x8, x25, #1
	ldrsw	x9, [x21, #8]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	str	x8, [x21]
	ldr	x8, [x21, #32]
	lsl	x9, x25, #32
	add	x19, x8, x9, asr #28
	ldr	w28, [x19, #12]
	mov	x0, x26
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x28
	bl	_WRITE_ONCE
	ldr	w26, [x19, #8]
	mov	x0, x27
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x26
	bl	_WRITE_ONCE
	ldr	w26, [x19, #4]
	ldr	w0, [sp, #28]                   ; 4-byte Folded Reload
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x26
	bl	_WRITE_ONCE
	ldr	w26, [x19]
	mov	x0, x24
	bl	_cpu_to_le32
	mov	x1, x0
	mov	x0, x26
	bl	_WRITE_ONCE
	ldr	w8, [x21, #24]
	add	w8, w8, #1
	str	w8, [x21, #24]
	add	w20, w20, #2
	add	x23, x23, #16
	mov	x8, x22
	cmp	w20, w22
	b.ge	LBB0_13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
Lloh5:
	adrp	x8, _MT_DMA_CTL_SD_LEN0@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MT_DMA_CTL_SD_LEN0@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldp	w1, w26, [x23, #-8]
	bl	_FIELD_PREP
	mov	x24, x0
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	cmp	w20, w8
	b.ge	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh8:
	adrp	x8, _MT_DMA_CTL_SD_LEN1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MT_DMA_CTL_SD_LEN1@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldp	w1, w27, [x23]
	bl	_FIELD_PREP
	orr	w24, w0, w24
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	w27, #0
LBB0_10:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	add	w8, w8, w20
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	cmn	w8, #2
	b.ne	LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh11:
	adrp	x8, _MT_DMA_CTL_LAST_SEC1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MT_DMA_CTL_LAST_SEC1@GOTPAGEOFF]
	b	LBB0_5
LBB0_13:
	ldp	x6, x5, [sp]                    ; 16-byte Folded Reload
	b	LBB0_15
LBB0_14:
	mov	w25, #-1
LBB0_15:
	ldr	x8, [x21, #16]
	mov	w9, #24
	smaddl	x8, w25, w9, x8
	stp	x5, x6, [x8, #8]
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_DUMMY_DATA,8,3             ; @DMA_DUMMY_DATA
	.comm	_MT_DMA_CTL_SD_LEN0,4,2         ; @MT_DMA_CTL_SD_LEN0
	.comm	_MT_DMA_CTL_SD_LEN1,4,2         ; @MT_DMA_CTL_SD_LEN1
	.comm	_MT_DMA_CTL_LAST_SEC0,4,2       ; @MT_DMA_CTL_LAST_SEC0
	.comm	_MT_DMA_CTL_LAST_SEC1,4,2       ; @MT_DMA_CTL_LAST_SEC1
	.no_dead_strip	_mt76_dma_add_buf
.subsections_via_symbols
