	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sf2_sw_mac_link_set
_bcm_sf2_sw_mac_link_set:               ## @bcm_sf2_sw_mac_link_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movl	%esi, %r14d
	callq	_bcm_sf2_to_priv
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_phy_interface_mode_is_rgmii
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	_PHY_INTERFACE_MODE_MII@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_4
## %bb.2:
	movq	_PHY_INTERFACE_MODE_REVMII@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_4
## %bb.3:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	%r14d, %edi
	callq	_REG_RGMII_CNTRL_P
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_reg_readl
	movq	_RGMII_MODE_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%ebx, %ecx
	orl	%eax, %ecx
	notl	%ebx
	andl	%eax, %ebx
	testl	%r15d, %r15d
	cmovnel	%ecx, %ebx
	movl	%r14d, %edi
	callq	_REG_RGMII_CNTRL_P
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reg_writel                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_INTERFACE_MODE_MII,8,3     ## @PHY_INTERFACE_MODE_MII
	.comm	_PHY_INTERFACE_MODE_REVMII,8,3  ## @PHY_INTERFACE_MODE_REVMII
	.comm	_RGMII_MODE_EN,4,2              ## @RGMII_MODE_EN
	.no_dead_strip	_bcm_sf2_sw_mac_link_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sf2_sw_mac_link_set
_bcm_sf2_sw_mac_link_set:               ; @bcm_sf2_sw_mac_link_set
	.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	x20, x3
	mov	x22, x2
	mov	x19, x1
	bl	_bcm_sf2_to_priv
	mov	x21, x0
	mov	x0, x22
	bl	_phy_interface_mode_is_rgmii
	cbnz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _PHY_INTERFACE_MODE_MII@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_INTERFACE_MODE_MII@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _PHY_INTERFACE_MODE_REVMII@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_REVMII@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x22
	ccmp	x9, x22, #4, ne
	b.eq	LBB0_3
; %bb.2:
	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
	ret
LBB0_3:
	mov	x0, x19
	bl	_REG_RGMII_CNTRL_P
	mov	x1, x0
	mov	x0, x21
	bl	_reg_readl
Lloh6:
	adrp	x8, _RGMII_MODE_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RGMII_MODE_EN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w9, w8, w0
	bic	w8, w0, w8
	cmp	w20, #0
	csel	w20, w8, w9, eq
	mov	x0, x19
	bl	_REG_RGMII_CNTRL_P
	mov	x2, x0
	mov	x0, x21
	mov	x1, x20
	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	_reg_writel
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_INTERFACE_MODE_MII,8,3     ; @PHY_INTERFACE_MODE_MII
	.comm	_PHY_INTERFACE_MODE_REVMII,8,3  ; @PHY_INTERFACE_MODE_REVMII
	.comm	_RGMII_MODE_EN,4,2              ; @RGMII_MODE_EN
	.no_dead_strip	_bcm_sf2_sw_mac_link_set
.subsections_via_symbols
