	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ag71xx_hw_init
_ag71xx_hw_init:                        ## @ag71xx_hw_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_ag71xx_get_pdata
	movq	%rax, %rbx
	movl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_ag71xx_hw_stop
	cmpq	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movq	_AR71XX_RESET_GE0_PHY@GOTPCREL(%rip), %rax
	movq	_AR71XX_RESET_GE1_PHY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, %ebx
	andl	%r14d, %ebx
	notl	%ecx
	andl	%ecx, %r14d
	movl	%ebx, %edi
	callq	_ath79_device_reset_set
	movl	$50, %edi
	callq	_msleep
	movl	%ebx, %edi
	callq	_ath79_device_reset_clear
	movl	$200, %edi
	callq	_msleep
LBB0_2:
	movq	_AG71XX_REG_MAC_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MAC_CFG1_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_ag71xx_sb
	movl	$20, %edi
	callq	_udelay
	movl	%r14d, %edi
	callq	_ath79_device_reset_set
	movl	$100, %edi
	callq	_msleep
	movl	%r14d, %edi
	callq	_ath79_device_reset_clear
	movl	$200, %edi
	callq	_msleep
	movq	%r15, %rdi
	callq	_ag71xx_hw_setup
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ag71xx_dma_reset               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AR71XX_RESET_GE0_PHY,4,2       ## @AR71XX_RESET_GE0_PHY
	.comm	_AR71XX_RESET_GE1_PHY,4,2       ## @AR71XX_RESET_GE1_PHY
	.comm	_AG71XX_REG_MAC_CFG1,4,2        ## @AG71XX_REG_MAC_CFG1
	.comm	_MAC_CFG1_SR,4,2                ## @MAC_CFG1_SR
	.no_dead_strip	_ag71xx_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ag71xx_hw_init
_ag71xx_hw_init:                        ; @ag71xx_hw_init
	.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
	mov	x19, x0
	bl	_ag71xx_get_pdata
	mov	x21, x0
	ldr	w20, [x0]
	mov	x0, x19
	bl	_ag71xx_hw_stop
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AR71XX_RESET_GE0_PHY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR71XX_RESET_GE0_PHY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _AR71XX_RESET_GE1_PHY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AR71XX_RESET_GE1_PHY@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	and	w21, w8, w20
	bic	w20, w20, w8
	mov	x0, x21
	bl	_ath79_device_reset_set
	mov	w0, #50
	bl	_msleep
	mov	x0, x21
	bl	_ath79_device_reset_clear
	mov	w0, #200
	bl	_msleep
LBB0_2:
Lloh6:
	adrp	x8, _AG71XX_REG_MAC_CFG1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AG71XX_REG_MAC_CFG1@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _MAC_CFG1_SR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAC_CFG1_SR@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ag71xx_sb
	mov	w0, #20
	bl	_udelay
	mov	x0, x20
	bl	_ath79_device_reset_set
	mov	w0, #100
	bl	_msleep
	mov	x0, x20
	bl	_ath79_device_reset_clear
	mov	w0, #200
	bl	_msleep
	mov	x0, x19
	bl	_ag71xx_hw_setup
	mov	x0, x19
	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
	b	_ag71xx_dma_reset
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AR71XX_RESET_GE0_PHY,4,2       ; @AR71XX_RESET_GE0_PHY
	.comm	_AR71XX_RESET_GE1_PHY,4,2       ; @AR71XX_RESET_GE1_PHY
	.comm	_AG71XX_REG_MAC_CFG1,4,2        ; @AG71XX_REG_MAC_CFG1
	.comm	_MAC_CFG1_SR,4,2                ; @MAC_CFG1_SR
	.no_dead_strip	_ag71xx_hw_init
.subsections_via_symbols
