	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function unimac_mdio_clk_set
_unimac_mdio_clk_set:                   ## @unimac_mdio_clk_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	(%rdi), %ecx
	testl	%ecx, %ecx
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	testl	%edi, %edi
	je	LBB0_2
## %bb.3:
	callq	_clk_get_rate
	movl	(%r14), %ecx
	jmp	LBB0_4
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	$250000000, %eax                ## imm = 0xEE6B280
LBB0_4:
	addl	%ecx, %ecx
	movslq	%ecx, %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %rbx
	jmp	LBB0_7
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_7:
	decl	%ebx
	movq	_MDIO_CLK_DIV_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	notl	%eax
	testl	%eax, %ebx
	je	LBB0_8
## %bb.10:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_warn                        ## TAILCALL
LBB0_8:
	movq	_MDIO_CFG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_unimac_mdio_readl
	movl	(%r15), %edx
	movq	_MDIO_CLK_DIV_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	shll	%cl, %ebx
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %ebx
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_unimac_mdio_writel             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MDIO_CLK_DIV_MASK,4,2          ## @MDIO_CLK_DIV_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Incorrect MDIO clock frequency, ignoring\n"

	.comm	_MDIO_CFG,4,2                   ## @MDIO_CFG
	.comm	_MDIO_CLK_DIV_SHIFT,4,2         ## @MDIO_CLK_DIV_SHIFT
	.no_dead_strip	_unimac_mdio_clk_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function unimac_mdio_clk_set
_unimac_mdio_clk_set:                   ; @unimac_mdio_clk_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
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #4]
	cbz	w0, LBB0_4
; %bb.2:
	bl	_clk_get_rate
	ldr	w8, [x19]
	b	LBB0_5
LBB0_3:
	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_4:
	mov	w0, #45696
	movk	w0, #3814, lsl #16
LBB0_5:
	lsl	w8, w8, #1
	sxtw	x8, w8
	udiv	x8, x0, x8
	sub	w20, w8, #1
Lloh0:
	adrp	x21, _MDIO_CLK_DIV_MASK@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MDIO_CLK_DIV_MASK@GOTPAGEOFF]
	ldr	w8, [x21]
	bics	wzr, w20, w8
	b.eq	LBB0_7
; %bb.6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	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	_pr_warn
LBB0_7:
Lloh4:
	adrp	x22, _MDIO_CFG@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MDIO_CFG@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_unimac_mdio_readl
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _MDIO_CLK_DIV_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MDIO_CLK_DIV_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	bic	w8, w0, w8
	lsl	w9, w20, w9
	orr	w1, w8, w9
	ldr	w2, [x22]
	mov	x0, x19
	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	_unimac_mdio_writel
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MDIO_CLK_DIV_MASK,4,2          ; @MDIO_CLK_DIV_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Incorrect MDIO clock frequency, ignoring\n"

	.comm	_MDIO_CFG,4,2                   ; @MDIO_CFG
	.comm	_MDIO_CLK_DIV_SHIFT,4,2         ; @MDIO_CLK_DIV_SHIFT
	.no_dead_strip	_unimac_mdio_clk_set
.subsections_via_symbols
