	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_sgmii_restart_an           ## -- Begin function mtk_sgmii_restart_an
	.p2align	4, 0x90
_mtk_sgmii_restart_an:                  ## @mtk_sgmii_restart_an
	.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
	movl	%esi, %r15d
	movq	8(%rdi), %r14
	movq	(%rdi), %rax
	movl	(%rax), %edi
	movq	_MTK_SHARED_SGMII@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MTK_HAS_CAPS
	xorl	%ebx, %ebx
	testq	%rax, %rax
	movq	(%r14), %rax
	movl	%r15d, %ecx
	cmoveq	%rcx, %rbx
	movl	(%rax,%rbx,4), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.1:
	movq	_SGMSYS_PCS_CONTROL_1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	movq	_SGMII_AN_RESTART@GOTPCREL(%rip), %rax
	movl	-28(%rbp), %edx
	orl	(%rax), %edx
	movl	%edx, -28(%rbp)
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r15), %esi
	callq	_regmap_write
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_SHARED_SGMII,4,2           ## @MTK_SHARED_SGMII
	.comm	_SGMSYS_PCS_CONTROL_1,4,2       ## @SGMSYS_PCS_CONTROL_1
	.comm	_SGMII_AN_RESTART,4,2           ## @SGMII_AN_RESTART
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_sgmii_restart_an           ; -- Begin function mtk_sgmii_restart_an
	.p2align	2
_mtk_sgmii_restart_an:                  ; @mtk_sgmii_restart_an
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	ldp	x8, x20, [x0]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _MTK_SHARED_SGMII@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_SHARED_SGMII@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_MTK_HAS_CAPS
	ldr	x8, [x20]
	mov	w9, w19
	cmp	x0, #0
	csel	x19, x9, xzr, eq
	ldr	w0, [x8, x19, lsl #2]
	cbz	w0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x21, _SGMSYS_PCS_CONTROL_1@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SGMSYS_PCS_CONTROL_1@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	bl	_regmap_read
Lloh5:
	adrp	x8, _SGMII_AN_RESTART@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SGMII_AN_RESTART@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x20]
	ldr	w0, [x8, x19, lsl #2]
	ldr	w1, [x21]
	bl	_regmap_write
LBB0_2:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_SHARED_SGMII,4,2           ; @MTK_SHARED_SGMII
	.comm	_SGMSYS_PCS_CONTROL_1,4,2       ; @SGMSYS_PCS_CONTROL_1
	.comm	_SGMII_AN_RESTART,4,2           ; @SGMII_AN_RESTART
.subsections_via_symbols
