	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_sgmii_setup_mode_force     ## -- Begin function mtk_sgmii_setup_mode_force
	.p2align	4, 0x90
_mtk_sgmii_setup_mode_force:            ## @mtk_sgmii_setup_mode_force
	.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, %rbx
	movq	(%rdi), %rax
	movslq	%esi, %r12
	movl	(%rax,%r12,4), %edi
	testl	%edi, %edi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movl	8(%rbx), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movq	_RG_PHY_SPEED_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movq	(%r14), %rax
	movq	_PHY_INTERFACE_MODE_2500BASEX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_RG_PHY_SPEED_3_125G@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
LBB0_4:
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movl	8(%rbx), %esi
	callq	_regmap_write
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movq	_SGMSYS_PCS_CONTROL_1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-44(%rbp), %r15
	movq	%r15, %rdx
	callq	_regmap_read
	movq	_SGMII_AN_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movl	(%r13), %esi
	callq	_regmap_write
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movq	_SGMSYS_SGMII_MODE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdx
	callq	_regmap_read
	movq	_SGMII_IF_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movl	8(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_9
## %bb.5:
	cmpl	$130, %eax
	je	LBB0_8
## %bb.6:
	cmpl	$131, %eax
	jne	LBB0_11
## %bb.7:
	movq	_SGMII_SPEED_10@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_9:
	movq	_SGMII_SPEED_1000@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_SGMII_SPEED_100@GOTPCREL(%rip), %rax
LBB0_10:
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
LBB0_11:
	movq	16(%r14), %rax
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movq	_SGMII_DUPLEX_FULL@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
LBB0_13:
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movl	(%r13), %esi
	callq	_regmap_write
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movq	_SGMSYS_QPHY_PWR_STATE_CTRL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	movq	_SGMII_PHYA_PWD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movq	(%rbx), %rax
	movl	(%rax,%r12,4), %edi
	movl	(%r14), %esi
	callq	_regmap_write
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RG_PHY_SPEED_MASK,4,2          ## @RG_PHY_SPEED_MASK
	.comm	_PHY_INTERFACE_MODE_2500BASEX,8,3 ## @PHY_INTERFACE_MODE_2500BASEX
	.comm	_RG_PHY_SPEED_3_125G,4,2        ## @RG_PHY_SPEED_3_125G
	.comm	_SGMSYS_PCS_CONTROL_1,4,2       ## @SGMSYS_PCS_CONTROL_1
	.comm	_SGMII_AN_ENABLE,4,2            ## @SGMII_AN_ENABLE
	.comm	_SGMSYS_SGMII_MODE,4,2          ## @SGMSYS_SGMII_MODE
	.comm	_SGMII_IF_MODE_MASK,4,2         ## @SGMII_IF_MODE_MASK
	.comm	_SGMII_SPEED_10,4,2             ## @SGMII_SPEED_10
	.comm	_SGMII_SPEED_100,4,2            ## @SGMII_SPEED_100
	.comm	_SGMII_SPEED_1000,4,2           ## @SGMII_SPEED_1000
	.comm	_DUPLEX_FULL,8,3                ## @DUPLEX_FULL
	.comm	_SGMII_DUPLEX_FULL,4,2          ## @SGMII_DUPLEX_FULL
	.comm	_SGMSYS_QPHY_PWR_STATE_CTRL,4,2 ## @SGMSYS_QPHY_PWR_STATE_CTRL
	.comm	_SGMII_PHYA_PWD,4,2             ## @SGMII_PHYA_PWD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_sgmii_setup_mode_force     ; -- Begin function mtk_sgmii_setup_mode_force
	.p2align	2
_mtk_sgmii_setup_mode_force:            ; @mtk_sgmii_setup_mode_force
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	w0, [x8, w1, sxtw #2]
	cbz	w0, LBB0_7
; %bb.1:
	mov	x20, x2
	sxtw	x21, w1
	ldr	w1, [x19, #8]
	add	x2, sp, #12
	bl	_regmap_read
Lloh0:
	adrp	x8, _RG_PHY_SPEED_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RG_PHY_SPEED_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _PHY_INTERFACE_MODE_2500BASEX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_2500BASEX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
Lloh6:
	adrp	x8, _RG_PHY_SPEED_3_125G@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RG_PHY_SPEED_3_125G@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w2, w8, w2
	str	w2, [sp, #12]
LBB0_3:
	ldr	x8, [x19]
	lsl	x21, x21, #2
	ldr	w0, [x8, x21]
	ldr	w1, [x19, #8]
	bl	_regmap_write
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
Lloh9:
	adrp	x22, _SGMSYS_PCS_CONTROL_1@GOTPAGE
Lloh10:
	ldr	x22, [x22, _SGMSYS_PCS_CONTROL_1@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
Lloh11:
	adrp	x8, _SGMII_AN_ENABLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SGMII_AN_ENABLE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
	ldr	w1, [x22]
	bl	_regmap_write
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
Lloh14:
	adrp	x22, _SGMSYS_SGMII_MODE@GOTPAGE
Lloh15:
	ldr	x22, [x22, _SGMSYS_SGMII_MODE@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	bl	_regmap_read
Lloh16:
	adrp	x8, _SGMII_IF_MODE_MASK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SGMII_IF_MODE_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w8, [x20, #8]
	sub	w9, w8, #128
	cmp	w9, #2
	b.lo	LBB0_8
; %bb.4:
	cmp	w8, #130
	b.eq	LBB0_9
; %bb.5:
	cmp	w8, #131
	b.ne	LBB0_11
; %bb.6:
Lloh19:
	adrp	x8, _SGMII_SPEED_10@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SGMII_SPEED_10@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_8:
Lloh24:
	adrp	x8, _SGMII_SPEED_1000@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SGMII_SPEED_1000@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh26:
	adrp	x8, _SGMII_SPEED_100@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SGMII_SPEED_100@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	orr	w2, w8, w2
	str	w2, [sp, #12]
LBB0_11:
	ldr	x8, [x20, #16]
Lloh28:
	adrp	x9, _DUPLEX_FULL@GOTPAGE
Lloh29:
	ldr	x9, [x9, _DUPLEX_FULL@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:
Lloh31:
	adrp	x8, _SGMII_DUPLEX_FULL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SGMII_DUPLEX_FULL@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	orr	w2, w2, w8
	str	w2, [sp, #12]
LBB0_13:
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
	ldr	w1, [x22]
	bl	_regmap_write
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
Lloh34:
	adrp	x20, _SGMSYS_QPHY_PWR_STATE_CTRL@GOTPAGE
Lloh35:
	ldr	x20, [x20, _SGMSYS_QPHY_PWR_STATE_CTRL@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_regmap_read
Lloh36:
	adrp	x8, _SGMII_PHYA_PWD@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SGMII_PHYA_PWD@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x19]
	ldr	w0, [x8, x21]
	ldr	w1, [x20]
	bl	_regmap_write
	mov	w0, #0
LBB0_14:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RG_PHY_SPEED_MASK,4,2          ; @RG_PHY_SPEED_MASK
	.comm	_PHY_INTERFACE_MODE_2500BASEX,8,3 ; @PHY_INTERFACE_MODE_2500BASEX
	.comm	_RG_PHY_SPEED_3_125G,4,2        ; @RG_PHY_SPEED_3_125G
	.comm	_SGMSYS_PCS_CONTROL_1,4,2       ; @SGMSYS_PCS_CONTROL_1
	.comm	_SGMII_AN_ENABLE,4,2            ; @SGMII_AN_ENABLE
	.comm	_SGMSYS_SGMII_MODE,4,2          ; @SGMSYS_SGMII_MODE
	.comm	_SGMII_IF_MODE_MASK,4,2         ; @SGMII_IF_MODE_MASK
	.comm	_SGMII_SPEED_10,4,2             ; @SGMII_SPEED_10
	.comm	_SGMII_SPEED_100,4,2            ; @SGMII_SPEED_100
	.comm	_SGMII_SPEED_1000,4,2           ; @SGMII_SPEED_1000
	.comm	_DUPLEX_FULL,8,3                ; @DUPLEX_FULL
	.comm	_SGMII_DUPLEX_FULL,4,2          ; @SGMII_DUPLEX_FULL
	.comm	_SGMSYS_QPHY_PWR_STATE_CTRL,4,2 ; @SGMSYS_QPHY_PWR_STATE_CTRL
	.comm	_SGMII_PHYA_PWD,4,2             ; @SGMII_PHYA_PWD
.subsections_via_symbols
