	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vsc85xx_mac_if_set
_vsc85xx_mac_if_set:                    ## @vsc85xx_mac_if_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	_MSCC_PHY_EXT_PHY_CNTL_1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_phy_read
	addl	$-128, %ebx
	cmpl	$4, %ebx
	jae	LBB0_1
## %bb.2:
	movslq	%ebx, %rcx
	leaq	l_switch.table.vsc85xx_mac_if_set(%rip), %rdx
	movq	(%rdx,%rcx,8), %rdx
	movq	_MAC_IF_SELECTION_POS@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_MAC_IF_SELECTION_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	(%rdx), %edx
	shll	%cl, %edx
	notl	%esi
	andl	%esi, %eax
	orl	%eax, %edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_phy_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_genphy_soft_reset
	movl	%eax, %ebx
	jmp	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSCC_PHY_EXT_PHY_CNTL_1,4,2    ## @MSCC_PHY_EXT_PHY_CNTL_1
	.comm	_MAC_IF_SELECTION_MASK,4,2      ## @MAC_IF_SELECTION_MASK
	.comm	_MAC_IF_SELECTION_RGMII,4,2     ## @MAC_IF_SELECTION_RGMII
	.comm	_MAC_IF_SELECTION_POS,4,2       ## @MAC_IF_SELECTION_POS
	.comm	_MAC_IF_SELECTION_RMII,4,2      ## @MAC_IF_SELECTION_RMII
	.comm	_MAC_IF_SELECTION_GMII,4,2      ## @MAC_IF_SELECTION_GMII
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_vsc85xx_mac_if_set
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.vsc85xx_mac_if_set
l_switch.table.vsc85xx_mac_if_set:
	.quad	_MAC_IF_SELECTION_RMII
	.quad	_MAC_IF_SELECTION_RGMII
	.quad	_MAC_IF_SELECTION_GMII
	.quad	_MAC_IF_SELECTION_GMII

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vsc85xx_mac_if_set
_vsc85xx_mac_if_set:                    ; @vsc85xx_mac_if_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, x1
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x21, _MSCC_PHY_EXT_PHY_CNTL_1@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MSCC_PHY_EXT_PHY_CNTL_1@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_phy_read
	sub	w8, w20, #128
	cmp	w8, #4
	b.hs	LBB0_3
; %bb.1:
Lloh2:
	adrp	x9, _MAC_IF_SELECTION_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAC_IF_SELECTION_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bic	w9, w0, w9
Lloh5:
	adrp	x10, l_switch.table.vsc85xx_mac_if_set@PAGE
Lloh6:
	add	x10, x10, l_switch.table.vsc85xx_mac_if_set@PAGEOFF
	ldr	x8, [x10, w8, sxtw #3]
	ldr	w8, [x8]
Lloh7:
	adrp	x10, _MAC_IF_SELECTION_POS@GOTPAGE
Lloh8:
	ldr	x10, [x10, _MAC_IF_SELECTION_POS@GOTPAGEOFF]
Lloh9:
	ldr	w10, [x10]
	lsl	w8, w8, w10
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x19
	bl	_phy_write
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_genphy_soft_reset
	mov	x20, x0
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, 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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_MSCC_PHY_EXT_PHY_CNTL_1,4,2    ; @MSCC_PHY_EXT_PHY_CNTL_1
	.comm	_MAC_IF_SELECTION_MASK,4,2      ; @MAC_IF_SELECTION_MASK
	.comm	_MAC_IF_SELECTION_RGMII,4,2     ; @MAC_IF_SELECTION_RGMII
	.comm	_MAC_IF_SELECTION_POS,4,2       ; @MAC_IF_SELECTION_POS
	.comm	_MAC_IF_SELECTION_RMII,4,2      ; @MAC_IF_SELECTION_RMII
	.comm	_MAC_IF_SELECTION_GMII,4,2      ; @MAC_IF_SELECTION_GMII
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_vsc85xx_mac_if_set
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.vsc85xx_mac_if_set
l_switch.table.vsc85xx_mac_if_set:
	.quad	_MAC_IF_SELECTION_RMII
	.quad	_MAC_IF_SELECTION_RGMII
	.quad	_MAC_IF_SELECTION_GMII
	.quad	_MAC_IF_SELECTION_GMII

.subsections_via_symbols
