	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmsp2_clock_set
_mmsp2_clock_set:                       ## @mmsp2_clock_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%edi, %ecx
	imull	$3000000, %edi, %eax            ## imm = 0x2DC6C0
	movq	_SYS_CLK_FREQ@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	divl	(%rdi)
	cmpl	$256, %eax                      ## imm = 0x100
	jae	LBB0_1
## %bb.2:
	shll	$8, %eax
	addl	$-2044, %eax                    ## imm = 0xF804
	movq	_memregs@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, 4640(%rdx)
	movq	_cpuclk_was_changed@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_cpu_current_mhz@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	jmp	LBB0_3
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	callq	_fprintf
	movl	$-1, %esi
LBB0_3:
	movl	%esi, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_CLK_FREQ,4,2               ## @SYS_CLK_FREQ
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid cpuclk MHz: %u\n"

	.comm	_memregs,8,3                    ## @memregs
	.comm	_cpuclk_was_changed,4,2         ## @cpuclk_was_changed
	.comm	_cpu_current_mhz,4,2            ## @cpu_current_mhz
	.no_dead_strip	_mmsp2_clock_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmsp2_clock_set
_mmsp2_clock_set:                       ; @mmsp2_clock_set
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	mov	x2, x0
	mov	w8, #50880
	movk	w8, #45, lsl #16
	mul	w8, w0, w8
Lloh0:
	adrp	x9, _SYS_CLK_FREQ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SYS_CLK_FREQ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	udiv	w8, w8, w9
	cmp	w8, #256
	b.hs	LBB0_2
; %bb.1:
	mov	w0, #0
	lsl	w8, w8, #8
	sub	w8, w8, #2044
Lloh3:
	adrp	x9, _memregs@GOTPAGE
Lloh4:
	ldr	x9, [x9, _memregs@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _cpuclk_was_changed@GOTPAGE
Lloh7:
	ldr	x10, [x10, _cpuclk_was_changed@GOTPAGEOFF]
	str	w8, [x9, #4640]
	mov	w8, #1
Lloh8:
	str	w8, [x10]
Lloh9:
	adrp	x8, _cpu_current_mhz@GOTPAGE
Lloh10:
	ldr	x8, [x8, _cpu_current_mhz@GOTPAGEOFF]
Lloh11:
	str	w2, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh12:
	adrp	x8, _stderr@GOTPAGE
Lloh13:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #-1
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_CLK_FREQ,4,2               ; @SYS_CLK_FREQ
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid cpuclk MHz: %u\n"

	.comm	_memregs,8,3                    ; @memregs
	.comm	_cpuclk_was_changed,4,2         ; @cpuclk_was_changed
	.comm	_cpu_current_mhz,4,2            ; @cpu_current_mhz
	.no_dead_strip	_mmsp2_clock_set
.subsections_via_symbols
