	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mdio_mux_syscon_switch_fn
_mdio_mux_syscon_switch_fn:             ## @mdio_mux_syscon_switch_fn
	.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
	xorl	%eax, %eax
	cmpl	%esi, %edi
	je	LBB0_7
## %bb.1:
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	8(%rdx), %rax
	movq	(%rax), %r14
	movl	(%r14), %edi
	leaq	-28(%rbp), %rsi
	callq	_regmap_field_read
	cmpl	$129, %ebx
	je	LBB0_5
## %bb.2:
	cmpl	$128, %ebx
	jne	LBB0_4
## %bb.3:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	_H3_EPHY_MUX_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	andl	-28(%rbp), %esi
	movq	_H3_EPHY_SELECT@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	(%r14), %edi
	callq	_regmap_field_write
	movq	%r15, %rdi
	callq	_sun8i_dwmac_power_internal_phy
	testl	%eax, %eax
	jne	LBB0_7
	jmp	LBB0_6
LBB0_5:
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
	movq	_H3_EPHY_MUX_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	notl	%esi
	andl	-28(%rbp), %esi
	movq	_H3_EPHY_SHUTDOWN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	(%r14), %edi
	callq	_regmap_field_write
	movq	%r14, %rdi
	callq	_sun8i_dwmac_unpower_internal_phy
LBB0_6:
	movq	%r15, %rdi
	callq	_sun8i_dwmac_reset
	jmp	LBB0_7
LBB0_4:
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switch mux to internal PHY"

	.comm	_H3_EPHY_MUX_MASK,4,2           ## @H3_EPHY_MUX_MASK
	.comm	_H3_EPHY_SELECT,4,2             ## @H3_EPHY_SELECT
L_.str.1:                               ## @.str.1
	.asciz	"Switch mux to external PHY"

	.comm	_H3_EPHY_SHUTDOWN,4,2           ## @H3_EPHY_SHUTDOWN
L_.str.2:                               ## @.str.2
	.asciz	"Invalid child ID %x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mdio_mux_syscon_switch_fn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mdio_mux_syscon_switch_fn
_mdio_mux_syscon_switch_fn:             ; @mdio_mux_syscon_switch_fn
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	cmp	w0, w1
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_8
LBB0_2:
	mov	x19, x2
	mov	x21, x1
	ldr	x8, [x2, #8]
	ldr	x20, [x8]
	ldr	w0, [x20]
	add	x1, sp, #12
	bl	_regmap_field_read
	cmp	w21, #129
	b.eq	LBB0_5
; %bb.3:
	cmp	w21, #128
	b.ne	LBB0_7
; %bb.4:
	ldr	w0, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _H3_EPHY_MUX_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _H3_EPHY_MUX_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh5:
	adrp	x9, _H3_EPHY_SELECT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _H3_EPHY_SELECT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w1, w8, w9
	ldr	w0, [x20]
	bl	_regmap_field_write
	mov	x0, x19
	bl	_sun8i_dwmac_power_internal_phy
	cbnz	w0, LBB0_8
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	w8, [sp, #12]
Lloh10:
	adrp	x9, _H3_EPHY_MUX_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _H3_EPHY_MUX_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh13:
	adrp	x9, _H3_EPHY_SHUTDOWN@GOTPAGE
Lloh14:
	ldr	x9, [x9, _H3_EPHY_SHUTDOWN@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w1, w8, w9
	ldr	w0, [x20]
	bl	_regmap_field_write
	mov	x0, x20
	bl	_sun8i_dwmac_unpower_internal_phy
LBB0_6:
	mov	x0, x19
	bl	_sun8i_dwmac_reset
	b	LBB0_8
LBB0_7:
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switch mux to internal PHY"

	.comm	_H3_EPHY_MUX_MASK,4,2           ; @H3_EPHY_MUX_MASK
	.comm	_H3_EPHY_SELECT,4,2             ; @H3_EPHY_SELECT
l_.str.1:                               ; @.str.1
	.asciz	"Switch mux to external PHY"

	.comm	_H3_EPHY_SHUTDOWN,4,2           ; @H3_EPHY_SHUTDOWN
l_.str.2:                               ; @.str.2
	.asciz	"Invalid child ID %x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mdio_mux_syscon_switch_fn
.subsections_via_symbols
