	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_phy_downshift_set          ## -- Begin function bcm_phy_downshift_set
	.p2align	4, 0x90
_bcm_phy_downshift_set:                 ## @bcm_phy_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
	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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET@GOTPCREL(%rip), %r15
	movq	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK@GOTPCREL(%rip), %r12
	cmpl	$128, %esi
	je	LBB0_4
## %bb.1:
	movl	%ebx, %eax
	subl	(%r15), %eax
	cmpl	(%r12), %eax
	jle	LBB0_4
## %bb.2:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_4:
	movq	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_bcm54xx_auxctl_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movq	_MII_BCM54XX_AUXCTL_MISC_WREN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%eax, %edx
	movq	_DOWNSHIFT_DEV_DISABLE@GOTPCREL(%rip), %rcx
	movq	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, (%rcx)
	jne	LBB0_6
## %bb.12:
	notl	%eax
	andl	%eax, %edx
	movl	(%r13), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bcm54xx_auxctl_write           ## TAILCALL
LBB0_6:
	orl	%edx, %eax
	movl	(%r13), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_bcm54xx_auxctl_write
	testl	%eax, %eax
	js	LBB0_3
## %bb.7:
	movq	_BCM54XX_SHD_SCR2@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_bcm_phy_read_shadow
	movl	(%r12), %esi
	movq	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	%cl, %esi
	movq	_BCM54XX_SHD_SCR2_WSPD_RTRY_DIS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%edx, %esi
	notl	%esi
	andl	%eax, %esi
	cmpl	$1, %ebx
	je	LBB0_11
## %bb.8:
	cmpl	$128, %ebx
	jne	LBB0_10
## %bb.9:
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	jmp	LBB0_11
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	subl	(%r15), %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	movl	%ebx, %edx
LBB0_11:
	orl	%esi, %edx
	movl	(%r13), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bcm_phy_write_shadow           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET,4,2 ## @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK,4,2 ## @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC,4,2 ## @MII_BCM54XX_AUXCTL_SHDWSEL_MISC
	.comm	_MII_BCM54XX_AUXCTL_MISC_WREN,4,2 ## @MII_BCM54XX_AUXCTL_MISC_WREN
	.comm	_DOWNSHIFT_DEV_DISABLE,4,2      ## @DOWNSHIFT_DEV_DISABLE
	.comm	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN,4,2 ## @MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN
	.comm	_BCM54XX_SHD_SCR2,4,2           ## @BCM54XX_SHD_SCR2
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT,4,2 ## @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_DIS,4,2 ## @BCM54XX_SHD_SCR2_WSPD_RTRY_DIS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_phy_downshift_set          ; -- Begin function bcm_phy_downshift_set
	.p2align	2
_bcm_phy_downshift_set:                 ; @bcm_phy_downshift_set
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET@GOTPAGEOFF]
Lloh2:
	adrp	x22, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK@GOTPAGEOFF]
	cmp	w1, #128
	b.eq	LBB0_3
; %bb.1:
	ldr	w8, [x21]
	ldr	w9, [x22]
	sub	w8, w20, w8
	cmp	w8, w9
	b.le	LBB0_3
; %bb.2:
Lloh4:
	adrp	x8, _ERANGE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_3:
Lloh7:
	adrp	x23, _MII_BCM54XX_AUXCTL_SHDWSEL_MISC@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MII_BCM54XX_AUXCTL_SHDWSEL_MISC@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_bcm54xx_auxctl_read
	tbnz	w0, #31, LBB0_10
; %bb.4:
Lloh9:
	adrp	x8, _MII_BCM54XX_AUXCTL_MISC_WREN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MII_BCM54XX_AUXCTL_MISC_WREN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _DOWNSHIFT_DEV_DISABLE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DOWNSHIFT_DEV_DISABLE@GOTPAGEOFF]
	orr	w8, w8, w0
Lloh14:
	ldr	w10, [x9]
Lloh15:
	adrp	x9, _MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w10, w20
	b.ne	LBB0_6
; %bb.5:
	bic	w2, w8, w9
	ldr	w1, [x23]
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_bcm54xx_auxctl_write
LBB0_6:
	orr	w2, w9, w8
	ldr	w1, [x23]
	mov	x0, x19
	bl	_bcm54xx_auxctl_write
	tbnz	w0, #31, LBB0_10
; %bb.7:
Lloh18:
	adrp	x23, _BCM54XX_SHD_SCR2@GOTPAGE
Lloh19:
	ldr	x23, [x23, _BCM54XX_SHD_SCR2@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_bcm_phy_read_shadow
	ldr	w8, [x22]
Lloh20:
	adrp	x9, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh23:
	adrp	x10, _BCM54XX_SHD_SCR2_WSPD_RTRY_DIS@GOTPAGE
Lloh24:
	ldr	x10, [x10, _BCM54XX_SHD_SCR2_WSPD_RTRY_DIS@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	orr	w8, w8, w10
	bic	w8, w0, w8
	cmp	w20, #1
	b.eq	LBB0_13
; %bb.8:
	cmp	w20, #128
	b.ne	LBB0_11
; %bb.9:
	mov	w10, #1
	b	LBB0_12
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	w10, [x21]
	sub	w10, w20, w10
LBB0_12:
	lsl	w10, w10, w9
LBB0_13:
	orr	w2, w10, w8
	ldr	w1, [x23]
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_bcm_phy_write_shadow
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET,4,2 ; @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK,4,2 ; @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_MASK
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC,4,2 ; @MII_BCM54XX_AUXCTL_SHDWSEL_MISC
	.comm	_MII_BCM54XX_AUXCTL_MISC_WREN,4,2 ; @MII_BCM54XX_AUXCTL_MISC_WREN
	.comm	_DOWNSHIFT_DEV_DISABLE,4,2      ; @DOWNSHIFT_DEV_DISABLE
	.comm	_MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN,4,2 ; @MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN
	.comm	_BCM54XX_SHD_SCR2,4,2           ; @BCM54XX_SHD_SCR2
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT,4,2 ; @BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_SHIFT
	.comm	_BCM54XX_SHD_SCR2_WSPD_RTRY_DIS,4,2 ; @BCM54XX_SHD_SCR2_WSPD_RTRY_DIS
.subsections_via_symbols
