	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sf2_sw_mac_config
_bcm_sf2_sw_mac_config:                 ## @bcm_sf2_sw_mac_config
	.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	%rcx, %r14
	movl	%esi, %r13d
	callq	_bcm_sf2_to_priv
	movq	%rax, %r12
	movq	_CORE_IMP0_PRT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_core_readl
	cmpl	%r13d, %eax
	jne	LBB0_1
## %bb.22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	(%r12), %rax
	movq	_BCM7445_DEVICE_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	movl	%r13d, %edi
	callq	_CORE_STS_OVERRIDE_GMIIP_PORT
	jmp	LBB0_4
LBB0_3:
	movl	%r13d, %edi
	callq	_CORE_STS_OVERRIDE_GMIIP2_PORT
LBB0_4:
	movl	%eax, %edx
	movl	$-130, %ecx
	addl	(%r14), %ecx
	cmpl	$3, %ecx
	ja	LBB0_12
## %bb.5:
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	_EXT_GPHY@GOTPCREL(%rip), %rax
	movb	$1, %r15b
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_6:
	xorl	%r15d, %r15d
	jmp	LBB0_9
LBB0_8:
	movq	_EXT_REVMII@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_EXT_EPHY@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edi
	callq	_REG_RGMII_CNTRL_P
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_reg_readl
	movq	_ID_MODE_DIS@GOTPCREL(%rip), %rdx
	movq	_PORT_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_PORT_MODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	movl	(%rdx), %r8d
	movq	_RX_PAUSE_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_TX_PAUSE_EN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%r8d, %edi
	orl	%ecx, %edi
	orl	%edx, %edi
	orl	%esi, %edi
	notl	%edi
	andl	%eax, %edi
	xorl	%ebx, %ebx
	testb	%r15b, %r15b
	cmovel	%r8d, %ebx
	orl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%edi, %ebx
	movl	4(%r14), %eax
	movq	_MLO_PAUSE_TXRX_MASK@GOTPCREL(%rip), %rsi
	testl	%eax, (%rsi)
	je	LBB0_11
## %bb.10:
	movq	_MLO_PAUSE_TX@GOTPCREL(%rip), %rsi
	andl	(%rsi), %eax
	cmovel	%eax, %edx
	orl	%ecx, %ebx
	orl	%edx, %ebx
LBB0_11:
	movl	%r13d, %edi
	callq	_REG_RGMII_CNTRL_P
	movq	%r12, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_reg_writel
	movl	-48(%rbp), %edx                 ## 4-byte Reload
LBB0_12:
	movq	_SW_OVERRIDE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	8(%r14), %ecx
	cmpl	$129, %ecx
	je	LBB0_15
## %bb.13:
	cmpl	$128, %ecx
	jne	LBB0_17
## %bb.14:
	movq	_SPDSTS_1000@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_15:
	movq	_SPDSTS_100@GOTPCREL(%rip), %rcx
LBB0_16:
	movl	(%rcx), %esi
	movq	_SPEED_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%esi, %eax
LBB0_17:
	xorl	%ecx, %ecx
	cmpq	$0, 24(%r14)
	movl	$0, %esi
	je	LBB0_19
## %bb.18:
	movq	_LINK_STS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
LBB0_19:
	orl	%eax, %esi
	movq	16(%r14), %rax
	movq	_DUPLEX_FULL@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	jne	LBB0_21
## %bb.20:
	movq	_DUPLX_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_21:
	orl	%ecx, %esi
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_core_writel                    ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_9
	.long	L0_0_set_6
	.long	L0_0_set_8
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_CORE_IMP0_PRT_ID,4,2           ## @CORE_IMP0_PRT_ID
	.comm	_BCM7445_DEVICE_ID,8,3          ## @BCM7445_DEVICE_ID
	.comm	_EXT_GPHY,4,2                   ## @EXT_GPHY
	.comm	_EXT_EPHY,4,2                   ## @EXT_EPHY
	.comm	_EXT_REVMII,4,2                 ## @EXT_REVMII
	.comm	_ID_MODE_DIS,4,2                ## @ID_MODE_DIS
	.comm	_PORT_MODE_MASK,4,2             ## @PORT_MODE_MASK
	.comm	_PORT_MODE_SHIFT,4,2            ## @PORT_MODE_SHIFT
	.comm	_RX_PAUSE_EN,4,2                ## @RX_PAUSE_EN
	.comm	_TX_PAUSE_EN,4,2                ## @TX_PAUSE_EN
	.comm	_MLO_PAUSE_TXRX_MASK,4,2        ## @MLO_PAUSE_TXRX_MASK
	.comm	_MLO_PAUSE_TX,4,2               ## @MLO_PAUSE_TX
	.comm	_SW_OVERRIDE,4,2                ## @SW_OVERRIDE
	.comm	_SPDSTS_1000,4,2                ## @SPDSTS_1000
	.comm	_SPEED_SHIFT,4,2                ## @SPEED_SHIFT
	.comm	_SPDSTS_100,4,2                 ## @SPDSTS_100
	.comm	_LINK_STS,4,2                   ## @LINK_STS
	.comm	_DUPLEX_FULL,8,3                ## @DUPLEX_FULL
	.comm	_DUPLX_MODE,4,2                 ## @DUPLX_MODE
	.no_dead_strip	_bcm_sf2_sw_mac_config
.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_config
_bcm_sf2_sw_mac_config:                 ; @bcm_sf2_sw_mac_config
	.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, x3
	mov	x22, x1
	bl	_bcm_sf2_to_priv
	mov	x19, x0
Lloh0:
	adrp	x8, _CORE_IMP0_PRT_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CORE_IMP0_PRT_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_core_readl
	cmp	w0, w22
	b.ne	LBB0_2
; %bb.1:
	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_2:
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _BCM7445_DEVICE_ID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BCM7445_DEVICE_ID@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	mov	x0, x22
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	bl	_CORE_STS_OVERRIDE_GMIIP_PORT
	b	LBB0_5
LBB0_4:
	bl	_CORE_STS_OVERRIDE_GMIIP2_PORT
LBB0_5:
	mov	x21, x0
	ldr	w8, [x20]
	sub	w9, w8, #130
	cmp	w9, #3
	b.hi	LBB0_14
; %bb.6:
Lloh6:
	adrp	x8, _EXT_GPHY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXT_GPHY@GOTPAGEOFF]
	mov	w23, #1
Lloh8:
	adrp	x10, lJTI0_0@PAGE
Lloh9:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_7
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_7:
	mov	w23, #0
Lloh10:
	adrp	x8, _EXT_GPHY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EXT_GPHY@GOTPAGEOFF]
	b	LBB0_11
LBB0_8:
Lloh12:
	adrp	x8, _EXT_REVMII@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EXT_REVMII@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x8, _EXT_EPHY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EXT_EPHY@GOTPAGEOFF]
LBB0_10:
	mov	w23, #1
LBB0_11:
	ldr	w24, [x8]
	mov	x0, x22
	bl	_REG_RGMII_CNTRL_P
	mov	x1, x0
	mov	x0, x19
	bl	_reg_readl
Lloh16:
	adrp	x8, _ID_MODE_DIS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ID_MODE_DIS@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x8]
Lloh19:
	adrp	x8, _PORT_MODE_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PORT_MODE_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _PORT_MODE_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PORT_MODE_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
Lloh25:
	adrp	x11, _RX_PAUSE_EN@GOTPAGE
Lloh26:
	ldr	x11, [x11, _RX_PAUSE_EN@GOTPAGEOFF]
	lsl	w12, w8, w9
Lloh27:
	ldr	w8, [x11]
Lloh28:
	adrp	x9, _TX_PAUSE_EN@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TX_PAUSE_EN@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w11, w12, w10
	orr	w11, w11, w8
	orr	w11, w11, w9
	bic	w11, w0, w11
	cmp	w23, #0
	csel	w10, wzr, w10, ne
	orr	w10, w10, w24
	orr	w23, w10, w11
	ldr	w10, [x20, #4]
Lloh31:
	adrp	x11, _MLO_PAUSE_TXRX_MASK@GOTPAGE
Lloh32:
	ldr	x11, [x11, _MLO_PAUSE_TXRX_MASK@GOTPAGEOFF]
Lloh33:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_13
; %bb.12:
Lloh34:
	adrp	x11, _MLO_PAUSE_TX@GOTPAGE
Lloh35:
	ldr	x11, [x11, _MLO_PAUSE_TX@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
	tst	w11, w10
	csel	w9, wzr, w9, eq
	orr	w8, w23, w8
	orr	w23, w8, w9
LBB0_13:
	mov	x0, x22
	bl	_REG_RGMII_CNTRL_P
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	bl	_reg_writel
LBB0_14:
Lloh37:
	adrp	x8, _SW_OVERRIDE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SW_OVERRIDE@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	cmp	w9, #129
	b.eq	LBB0_17
; %bb.15:
	cmp	w9, #128
	b.ne	LBB0_19
; %bb.16:
Lloh40:
	adrp	x9, _SPDSTS_1000@GOTPAGE
Lloh41:
	ldr	x9, [x9, _SPDSTS_1000@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
Lloh42:
	adrp	x9, _SPDSTS_100@GOTPAGE
Lloh43:
	ldr	x9, [x9, _SPDSTS_100@GOTPAGEOFF]
LBB0_18:
	ldr	w9, [x9]
Lloh44:
	adrp	x10, _SPEED_SHIFT@GOTPAGE
Lloh45:
	ldr	x10, [x10, _SPEED_SHIFT@GOTPAGEOFF]
Lloh46:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
LBB0_19:
Lloh47:
	adrp	x9, _LINK_STS@GOTPAGE
Lloh48:
	ldr	x9, [x9, _LINK_STS@GOTPAGEOFF]
Lloh49:
	ldr	w9, [x9]
	ldp	x11, x10, [x20, #16]
	cmp	x10, #0
	csel	w9, wzr, w9, eq
	orr	w8, w9, w8
Lloh50:
	adrp	x9, _DUPLEX_FULL@GOTPAGE
Lloh51:
	ldr	x9, [x9, _DUPLEX_FULL@GOTPAGEOFF]
Lloh52:
	ldr	x9, [x9]
Lloh53:
	adrp	x10, _DUPLX_MODE@GOTPAGE
Lloh54:
	ldr	x10, [x10, _DUPLX_MODE@GOTPAGEOFF]
Lloh55:
	ldr	w10, [x10]
	cmp	x11, x9
	csel	w9, w10, wzr, eq
	orr	w1, w8, w9
	mov	x0, x19
	mov	x2, x21
	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	_core_writel
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_11-LBB0_7)>>2
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_8-LBB0_7)>>2
	.byte	(LBB0_9-LBB0_7)>>2
                                        ; -- End function
	.comm	_CORE_IMP0_PRT_ID,4,2           ; @CORE_IMP0_PRT_ID
	.comm	_BCM7445_DEVICE_ID,8,3          ; @BCM7445_DEVICE_ID
	.comm	_EXT_GPHY,4,2                   ; @EXT_GPHY
	.comm	_EXT_EPHY,4,2                   ; @EXT_EPHY
	.comm	_EXT_REVMII,4,2                 ; @EXT_REVMII
	.comm	_ID_MODE_DIS,4,2                ; @ID_MODE_DIS
	.comm	_PORT_MODE_MASK,4,2             ; @PORT_MODE_MASK
	.comm	_PORT_MODE_SHIFT,4,2            ; @PORT_MODE_SHIFT
	.comm	_RX_PAUSE_EN,4,2                ; @RX_PAUSE_EN
	.comm	_TX_PAUSE_EN,4,2                ; @TX_PAUSE_EN
	.comm	_MLO_PAUSE_TXRX_MASK,4,2        ; @MLO_PAUSE_TXRX_MASK
	.comm	_MLO_PAUSE_TX,4,2               ; @MLO_PAUSE_TX
	.comm	_SW_OVERRIDE,4,2                ; @SW_OVERRIDE
	.comm	_SPDSTS_1000,4,2                ; @SPDSTS_1000
	.comm	_SPEED_SHIFT,4,2                ; @SPEED_SHIFT
	.comm	_SPDSTS_100,4,2                 ; @SPDSTS_100
	.comm	_LINK_STS,4,2                   ; @LINK_STS
	.comm	_DUPLEX_FULL,8,3                ; @DUPLEX_FULL
	.comm	_DUPLX_MODE,4,2                 ; @DUPLX_MODE
	.no_dead_strip	_bcm_sf2_sw_mac_config
.subsections_via_symbols
