	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_dma_reset
_ag71xx_dma_reset:                      ## @ag71xx_dma_reset
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_AG71XX_REG_RX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_ag71xx_wr
	movq	%r13, %rdi
	callq	_ag71xx_dma_wait_stop
	movq	_AG71XX_REG_TX_DESC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_RX_DESC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	movl	$256, %ebx                      ## imm = 0x100
	movq	_AG71XX_REG_RX_STATUS@GOTPCREL(%rip), %r12
	movq	_RX_STATUS_PR@GOTPCREL(%rip), %r14
	movq	_TX_STATUS_PS@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movl	(%r14), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	decl	%ebx
	jne	LBB0_1
## %bb.2:
	movl	(%r12), %esi
	movq	_RX_STATUS_BE@GOTPCREL(%rip), %rax
	movq	_RX_STATUS_OF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_STATUS@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_TX_STATUS_BE@GOTPCREL(%rip), %rax
	movq	_TX_STATUS_UR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_ag71xx_wr
	movl	(%r12), %esi
	movq	%r13, %rdi
	callq	_ag71xx_rr
	testl	%eax, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_4
## %bb.3:
	movq	_hw@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rcx
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movl	%eax, %r8d
	callq	_netif_err
LBB0_4:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_ag71xx_rr
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	je	LBB0_5
## %bb.6:
	movq	_hw@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rcx
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movl	%eax, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_netif_err                      ## TAILCALL
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_REG_RX_CTRL,4,2         ## @AG71XX_REG_RX_CTRL
	.comm	_AG71XX_REG_TX_CTRL,4,2         ## @AG71XX_REG_TX_CTRL
	.comm	_AG71XX_REG_TX_DESC,4,2         ## @AG71XX_REG_TX_DESC
	.comm	_AG71XX_REG_RX_DESC,4,2         ## @AG71XX_REG_RX_DESC
	.comm	_AG71XX_REG_RX_STATUS,4,2       ## @AG71XX_REG_RX_STATUS
	.comm	_RX_STATUS_PR,4,2               ## @RX_STATUS_PR
	.comm	_AG71XX_REG_TX_STATUS,4,2       ## @AG71XX_REG_TX_STATUS
	.comm	_TX_STATUS_PS,4,2               ## @TX_STATUS_PS
	.comm	_RX_STATUS_BE,4,2               ## @RX_STATUS_BE
	.comm	_RX_STATUS_OF,4,2               ## @RX_STATUS_OF
	.comm	_TX_STATUS_BE,4,2               ## @TX_STATUS_BE
	.comm	_TX_STATUS_UR,4,2               ## @TX_STATUS_UR
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to clear DMA Rx status: %08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"unable to clear DMA Tx status: %08x\n"

	.no_dead_strip	_ag71xx_dma_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_dma_reset
_ag71xx_dma_reset:                      ; @ag71xx_dma_reset
	.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	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _AG71XX_REG_RX_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AG71XX_REG_RX_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_ag71xx_wr
Lloh3:
	adrp	x8, _AG71XX_REG_TX_CTRL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AG71XX_REG_TX_CTRL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_ag71xx_wr
	mov	x0, x20
	bl	_ag71xx_dma_wait_stop
Lloh6:
	adrp	x8, _AG71XX_REG_TX_DESC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AG71XX_REG_TX_DESC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x20
	bl	_ag71xx_wr
Lloh9:
	adrp	x8, _AG71XX_REG_RX_DESC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AG71XX_REG_RX_DESC@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x20
	bl	_ag71xx_wr
	mov	w23, #256
Lloh12:
	adrp	x22, _AG71XX_REG_RX_STATUS@GOTPAGE
Lloh13:
	ldr	x22, [x22, _AG71XX_REG_RX_STATUS@GOTPAGEOFF]
Lloh14:
	adrp	x24, _RX_STATUS_PR@GOTPAGE
Lloh15:
	ldr	x24, [x24, _RX_STATUS_PR@GOTPAGEOFF]
Lloh16:
	adrp	x21, _AG71XX_REG_TX_STATUS@GOTPAGE
Lloh17:
	ldr	x21, [x21, _AG71XX_REG_TX_STATUS@GOTPAGEOFF]
Lloh18:
	adrp	x25, _TX_STATUS_PS@GOTPAGE
Lloh19:
	ldr	x25, [x25, _TX_STATUS_PS@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_ag71xx_wr
	ldr	w1, [x21]
	ldr	w2, [x25]
	mov	x0, x20
	bl	_ag71xx_wr
	subs	w23, w23, #1
	b.ne	LBB0_1
; %bb.2:
Lloh20:
	adrp	x8, _RX_STATUS_BE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RX_STATUS_BE@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _RX_STATUS_OF@GOTPAGE
Lloh24:
	ldr	x9, [x9, _RX_STATUS_OF@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_ag71xx_wr
Lloh26:
	adrp	x8, _TX_STATUS_BE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TX_STATUS_BE@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh28:
	ldr	w8, [x8]
Lloh29:
	adrp	x9, _TX_STATUS_UR@GOTPAGE
Lloh30:
	ldr	x9, [x9, _TX_STATUS_UR@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_ag71xx_wr
	ldr	w1, [x22]
	mov	x0, x20
	bl	_ag71xx_rr
Lloh32:
	adrp	x22, _hw@GOTPAGE
Lloh33:
	ldr	x22, [x22, _hw@GOTPAGEOFF]
	cbz	w0, LBB0_4
; %bb.3:
	mov	x4, x0
	ldr	w1, [x22]
Lloh34:
	adrp	x3, l_.str@PAGE
Lloh35:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_netif_err
LBB0_4:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_ag71xx_rr
	ands	w4, w0, #0xffffff
	b.eq	LBB0_6
; %bb.5:
Lloh36:
	adrp	x3, l_.str.1@PAGE
Lloh37:
	add	x3, x3, l_.str.1@PAGEOFF
	ldr	w1, [x22]
	mov	x0, x20
	mov	x2, 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
	b	_netif_err
LBB0_6:
	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
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_REG_RX_CTRL,4,2         ; @AG71XX_REG_RX_CTRL
	.comm	_AG71XX_REG_TX_CTRL,4,2         ; @AG71XX_REG_TX_CTRL
	.comm	_AG71XX_REG_TX_DESC,4,2         ; @AG71XX_REG_TX_DESC
	.comm	_AG71XX_REG_RX_DESC,4,2         ; @AG71XX_REG_RX_DESC
	.comm	_AG71XX_REG_RX_STATUS,4,2       ; @AG71XX_REG_RX_STATUS
	.comm	_RX_STATUS_PR,4,2               ; @RX_STATUS_PR
	.comm	_AG71XX_REG_TX_STATUS,4,2       ; @AG71XX_REG_TX_STATUS
	.comm	_TX_STATUS_PS,4,2               ; @TX_STATUS_PS
	.comm	_RX_STATUS_BE,4,2               ; @RX_STATUS_BE
	.comm	_RX_STATUS_OF,4,2               ; @RX_STATUS_OF
	.comm	_TX_STATUS_BE,4,2               ; @TX_STATUS_BE
	.comm	_TX_STATUS_UR,4,2               ; @TX_STATUS_UR
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to clear DMA Rx status: %08x\n"

l_.str.1:                               ; @.str.1
	.asciz	"unable to clear DMA Tx status: %08x\n"

	.no_dead_strip	_ag71xx_dma_reset
.subsections_via_symbols
