	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_hw_start
_ag71xx_hw_start:                       ## @ag71xx_hw_start
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_ag71xx_dma_reset
	movq	%rbx, %rdi
	callq	_ag71xx_ring_rx_clean
	movq	%rbx, %rdi
	callq	_ag71xx_ring_tx_init
	movq	_AG71XX_REG_TX_DESC@GOTPCREL(%rip), %r15
	movl	(%r15), %r14d
	movl	36(%rbx), %edi
	callq	_virt_to_phys
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_ag71xx_wr
	movq	_AG71XX_REG_RX_DESC@GOTPCREL(%rip), %r12
	movl	(%r12), %r14d
	movl	32(%rbx), %edi
	callq	_virt_to_phys
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_ag71xx_wr
	movq	8(%rbx), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_hw_set_macaddr
	cmpq	$0, 24(%rbx)
	je	LBB0_1
## %bb.2:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%rbx)
	movq	_SPEED_1000@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_ag71xx_link_adjust
	movq	8(%rbx), %rax
	movl	(%rax), %r14d
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_rr
	movl	%eax, %r15d
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_ag71xx_rr
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_DBG
	movq	_AG71XX_REG_RX_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RX_CTRL_RXE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_ag71xx_wr
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	movl	$-1, %eax
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AG71XX_REG_TX_DESC,4,2         ## @AG71XX_REG_TX_DESC
	.comm	_AG71XX_REG_RX_DESC,4,2         ## @AG71XX_REG_RX_DESC
	.comm	_SPEED_1000,4,2                 ## @SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: txdesc reg: %#08x rxdesc reg: %#08x\n"

	.comm	_AG71XX_REG_RX_CTRL,4,2         ## @AG71XX_REG_RX_CTRL
	.comm	_RX_CTRL_RXE,4,2                ## @RX_CTRL_RXE
	.no_dead_strip	_ag71xx_hw_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_hw_start
_ag71xx_hw_start:                       ; @ag71xx_hw_start
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x19, [x0]
	mov	x0, x19
	bl	_ag71xx_dma_reset
	mov	x0, x19
	bl	_ag71xx_ring_rx_clean
	mov	x0, x19
	bl	_ag71xx_ring_tx_init
Lloh0:
	adrp	x21, _AG71XX_REG_TX_DESC@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AG71XX_REG_TX_DESC@GOTPAGEOFF]
	ldr	w20, [x21]
	ldr	w0, [x19, #36]
	bl	_virt_to_phys
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_ag71xx_wr
Lloh2:
	adrp	x22, _AG71XX_REG_RX_DESC@GOTPAGE
Lloh3:
	ldr	x22, [x22, _AG71XX_REG_RX_DESC@GOTPAGEOFF]
	ldr	w20, [x22]
	ldr	w0, [x19, #32]
	bl	_virt_to_phys
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_ag71xx_wr
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_ag71xx_hw_set_macaddr
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
; %bb.1:
	movi.2s	v0, #1
	str	d0, [x19]
Lloh4:
	adrp	x8, _SPEED_1000@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SPEED_1000@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_ag71xx_link_adjust
	ldr	x8, [x19, #8]
	ldr	w20, [x8]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ag71xx_rr
	mov	x21, x0
	ldr	w1, [x22]
	mov	x0, x19
	bl	_ag71xx_rr
	mov	x3, x0
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_DBG
Lloh9:
	adrp	x8, _AG71XX_REG_RX_CTRL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AG71XX_REG_RX_CTRL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _RX_CTRL_RXE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RX_CTRL_RXE@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ag71xx_wr
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	mov	w0, #-1
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AG71XX_REG_TX_DESC,4,2         ; @AG71XX_REG_TX_DESC
	.comm	_AG71XX_REG_RX_DESC,4,2         ; @AG71XX_REG_RX_DESC
	.comm	_SPEED_1000,4,2                 ; @SPEED_1000
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: txdesc reg: %#08x rxdesc reg: %#08x\n"

	.comm	_AG71XX_REG_RX_CTRL,4,2         ; @AG71XX_REG_RX_CTRL
	.comm	_RX_CTRL_RXE,4,2                ; @RX_CTRL_RXE
	.no_dead_strip	_ag71xx_hw_start
.subsections_via_symbols
