	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sun7i_fix_speed
_sun7i_fix_speed:                       ## @sun7i_fix_speed
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rax
	movq	_PHY_INTERFACE_MODE_GMII@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	cmpl	$0, 8(%rdi)
	je	LBB0_3
## %bb.2:
	movl	12(%rbx), %edi
	callq	_clk_disable
	movl	$0, 8(%rbx)
LBB0_3:
	movl	12(%rbx), %edi
	callq	_clk_unprepare
	movl	12(%rbx), %edi
	cmpl	$1000, %r14d                    ## imm = 0x3E8
	jne	LBB0_6
## %bb.4:
	movq	_SUN7I_GMAC_GMII_RGMII_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clk_set_rate
	movl	12(%rbx), %edi
	callq	_clk_prepare_enable
	movl	$1, 8(%rbx)
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	_SUN7I_GMAC_MII_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_clk_set_rate
	movl	12(%rbx), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_clk_prepare                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ## @PHY_INTERFACE_MODE_GMII
	.comm	_SUN7I_GMAC_GMII_RGMII_RATE,4,2 ## @SUN7I_GMAC_GMII_RGMII_RATE
	.comm	_SUN7I_GMAC_MII_RATE,4,2        ## @SUN7I_GMAC_MII_RATE
	.no_dead_strip	_sun7i_fix_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sun7i_fix_speed
_sun7i_fix_speed:                       ; @sun7i_fix_speed
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PHY_INTERFACE_MODE_GMII@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PHY_INTERFACE_MODE_GMII@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_3
; %bb.2:
	ldr	w0, [x19, #12]
	bl	_clk_disable
	str	wzr, [x19, #8]
LBB0_3:
	ldr	w0, [x19, #12]
	bl	_clk_unprepare
	ldr	w0, [x19, #12]
	cmp	w20, #1000
	b.ne	LBB0_6
; %bb.4:
Lloh3:
	adrp	x8, _SUN7I_GMAC_GMII_RGMII_RATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SUN7I_GMAC_GMII_RGMII_RATE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_clk_set_rate
	ldr	w0, [x19, #12]
	bl	_clk_prepare_enable
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh6:
	adrp	x8, _SUN7I_GMAC_MII_RATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SUN7I_GMAC_MII_RATE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_clk_set_rate
	ldr	w0, [x19, #12]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_clk_prepare
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_INTERFACE_MODE_GMII,8,3    ; @PHY_INTERFACE_MODE_GMII
	.comm	_SUN7I_GMAC_GMII_RGMII_RATE,4,2 ; @SUN7I_GMAC_GMII_RGMII_RATE
	.comm	_SUN7I_GMAC_MII_RATE,4,2        ; @SUN7I_GMAC_MII_RATE
	.no_dead_strip	_sun7i_fix_speed
.subsections_via_symbols
