	.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, %r12
	callq	_ag71xx_dump_dma_regs
	movq	_AG71XX_REG_RX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ag71xx_wr
	movl	$1, %edi
	callq	_mdelay
	movq	_AG71XX_REG_TX_DESC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_RX_DESC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movl	$256, %ebx                      ## imm = 0x100
	movq	_AG71XX_REG_RX_STATUS@GOTPCREL(%rip), %r15
	movq	_RX_STATUS_PR@GOTPCREL(%rip), %r13
	movq	_TX_STATUS_PS@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movl	(%r13), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	decl	%ebx
	jne	LBB0_1
## %bb.2:
	movl	(%r15), %esi
	movq	_RX_STATUS_BE@GOTPCREL(%rip), %rax
	movq	_RX_STATUS_OF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movq	_AG71XX_REG_TX_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_TX_STATUS_BE@GOTPCREL(%rip), %rax
	movq	_TX_STATUS_UR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ag71xx_wr
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_ag71xx_rr
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	callq	_pr_alert
LBB0_4:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_ag71xx_rr
	andl	$16777215, %eax                 ## imm = 0xFFFFFF
	je	LBB0_6
## %bb.5:
	movq	8(%r12), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %edx
	callq	_pr_alert
LBB0_6:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ag71xx_dump_dma_regs           ## TAILCALL
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: unable to clear DMA Rx status: %08x\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: 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	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_ag71xx_dump_dma_regs
Lloh0:
	adrp	x8, _AG71XX_REG_RX_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AG71XX_REG_RX_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	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, x19
	mov	w2, #0
	bl	_ag71xx_wr
	mov	w0, #1
	bl	_mdelay
Lloh6:
	adrp	x8, _AG71XX_REG_TX_DESC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AG71XX_REG_TX_DESC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	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, [x19]
	mov	x0, x19
	bl	_ag71xx_wr
	mov	w22, #256
Lloh12:
	adrp	x21, _AG71XX_REG_RX_STATUS@GOTPAGE
Lloh13:
	ldr	x21, [x21, _AG71XX_REG_RX_STATUS@GOTPAGEOFF]
Lloh14:
	adrp	x23, _RX_STATUS_PR@GOTPAGE
Lloh15:
	ldr	x23, [x23, _RX_STATUS_PR@GOTPAGEOFF]
Lloh16:
	adrp	x20, _AG71XX_REG_TX_STATUS@GOTPAGE
Lloh17:
	ldr	x20, [x20, _AG71XX_REG_TX_STATUS@GOTPAGEOFF]
Lloh18:
	adrp	x24, _TX_STATUS_PS@GOTPAGE
Lloh19:
	ldr	x24, [x24, _TX_STATUS_PS@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_ag71xx_wr
	ldr	w1, [x20]
	ldr	w2, [x24]
	mov	x0, x19
	bl	_ag71xx_wr
	subs	w22, w22, #1
	b.ne	LBB0_1
; %bb.2:
Lloh20:
	adrp	x8, _RX_STATUS_BE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _RX_STATUS_BE@GOTPAGEOFF]
	ldr	w1, [x21]
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, x19
	bl	_ag71xx_wr
Lloh26:
	adrp	x8, _TX_STATUS_BE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TX_STATUS_BE@GOTPAGEOFF]
	ldr	w1, [x20]
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, x19
	bl	_ag71xx_wr
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ag71xx_rr
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
Lloh32:
	adrp	x0, l_.str@PAGE
Lloh33:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_alert
LBB0_4:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_ag71xx_rr
	ands	w2, w0, #0xffffff
	b.eq	LBB0_6
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
Lloh34:
	adrp	x0, l_.str.1@PAGE
Lloh35:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_alert
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ag71xx_dump_dma_regs
	.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 AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: unable to clear DMA Rx status: %08x\n"

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

	.no_dead_strip	_ag71xx_dma_reset
.subsections_via_symbols
