	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vsc85xx_downshift_set
_vsc85xx_downshift_set:                 ## @vsc85xx_downshift_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_DOWNSHIFT_DEV_DEFAULT_COUNT@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_DOWNSHIFT_CNTL_POS@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movq	_DOWNSHIFT_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	btsl	%eax, %r8d
	jmp	LBB0_7
LBB0_2:
	movl	%esi, %r8d
	cmpl	$1, %esi
	je	LBB0_8
## %bb.3:
	movq	_DOWNSHIFT_COUNT_MAX@GOTPCREL(%rip), %rax
	cmpl	%r8d, (%rax)
	jl	LBB0_8
## %bb.4:
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.6:
	addl	$-2, %r8d
	movq	_DOWNSHIFT_CNTL_POS@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r8d
	movq	_DOWNSHIFT_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	jmp	LBB0_7
LBB0_8:
	leaq	L_.str(%rip), %rsi
	callq	_phydev_err
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_5:
	xorl	%r8d, %r8d
LBB0_7:
	movq	_MSCC_PHY_PAGE_EXTENDED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSCC_PHY_ACTIPHY_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DOWNSHIFT_CNTL_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	popq	%rbp
	jmp	_phy_modify_paged               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DOWNSHIFT_DEV_DEFAULT_COUNT,4,2 ## @DOWNSHIFT_DEV_DEFAULT_COUNT
	.comm	_DOWNSHIFT_CNTL_POS,4,2         ## @DOWNSHIFT_CNTL_POS
	.comm	_DOWNSHIFT_EN,4,2               ## @DOWNSHIFT_EN
	.comm	_DOWNSHIFT_COUNT_MAX,4,2        ## @DOWNSHIFT_COUNT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Downshift count should be 2,3,4 or 5\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_MSCC_PHY_PAGE_EXTENDED,4,2     ## @MSCC_PHY_PAGE_EXTENDED
	.comm	_MSCC_PHY_ACTIPHY_CNTL,4,2      ## @MSCC_PHY_ACTIPHY_CNTL
	.comm	_DOWNSHIFT_CNTL_MASK,4,2        ## @DOWNSHIFT_CNTL_MASK
	.no_dead_strip	_vsc85xx_downshift_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vsc85xx_downshift_set
_vsc85xx_downshift_set:                 ; @vsc85xx_downshift_set
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _DOWNSHIFT_DEV_DEFAULT_COUNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DOWNSHIFT_DEV_DEFAULT_COUNT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _DOWNSHIFT_CNTL_POS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DOWNSHIFT_CNTL_POS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	b	LBB0_6
LBB0_2:
	cmp	w1, #1
	b.eq	LBB0_8
; %bb.3:
Lloh6:
	adrp	x8, _DOWNSHIFT_COUNT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DOWNSHIFT_COUNT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w1
	b.lt	LBB0_8
; %bb.4:
	cbz	w1, LBB0_9
; %bb.5:
	sub	w8, w1, #2
Lloh9:
	adrp	x9, _DOWNSHIFT_CNTL_POS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DOWNSHIFT_CNTL_POS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w8, w8, w9
LBB0_6:
Lloh12:
	adrp	x9, _DOWNSHIFT_EN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DOWNSHIFT_EN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w4, w8, w9
LBB0_7:
Lloh15:
	adrp	x8, _MSCC_PHY_PAGE_EXTENDED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MSCC_PHY_PAGE_EXTENDED@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _MSCC_PHY_ACTIPHY_CNTL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MSCC_PHY_ACTIPHY_CNTL@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
Lloh21:
	adrp	x8, _DOWNSHIFT_CNTL_MASK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DOWNSHIFT_CNTL_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_phy_modify_paged
LBB0_8:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_phydev_err
Lloh26:
	adrp	x8, _ERANGE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	w4, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DOWNSHIFT_DEV_DEFAULT_COUNT,4,2 ; @DOWNSHIFT_DEV_DEFAULT_COUNT
	.comm	_DOWNSHIFT_CNTL_POS,4,2         ; @DOWNSHIFT_CNTL_POS
	.comm	_DOWNSHIFT_EN,4,2               ; @DOWNSHIFT_EN
	.comm	_DOWNSHIFT_COUNT_MAX,4,2        ; @DOWNSHIFT_COUNT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Downshift count should be 2,3,4 or 5\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_MSCC_PHY_PAGE_EXTENDED,4,2     ; @MSCC_PHY_PAGE_EXTENDED
	.comm	_MSCC_PHY_ACTIPHY_CNTL,4,2      ; @MSCC_PHY_ACTIPHY_CNTL
	.comm	_DOWNSHIFT_CNTL_MASK,4,2        ; @DOWNSHIFT_CNTL_MASK
	.no_dead_strip	_vsc85xx_downshift_set
.subsections_via_symbols
