	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pollux_cpu_clock_set           ## -- Begin function pollux_cpu_clock_set
	.p2align	4, 0x90
_pollux_cpu_clock_set:                  ## @pollux_cpu_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
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_cpu_clock_allowed@GOTPCREL(%rip), %rax
	movl	$-1, %r14d
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.1:
	movl	%edi, %ebx
	xorl	%eax, %eax
	callq	_pollux_cpu_clock_get
	cmpl	%ebx, %eax
	je	LBB0_6
## %bb.2:
	movslq	%ebx, %rax
	imulq	$1431655766, %rax, %rcx         ## imm = 0x55555556
	movq	%rcx, %rax
	shrq	$63, %rax
	shrq	$32, %rcx
	addl	%eax, %ecx
	cmpl	$1023, %ecx                     ## imm = 0x3FF
	ja	LBB0_7
## %bb.3:
	shll	$8, %ecx
	movl	$1, %edi
	movl	$-64, %esi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %eax
	cltd
	idivl	%edi
	incl	%edi
	addl	$64, %esi
	cmpl	$250, %eax
	jg	LBB0_4
## %bb.5:
	orl	$2359296, %ecx                  ## imm = 0x240000
	movq	_memregl@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	$-961, %edi                     ## imm = 0xFC3F
	andl	61440(%rdx), %edi
	orl	%esi, %edi
	movl	%edi, 61440(%rdx)
	movl	%ecx, 61444(%rdx)
	orb	$-128, 61565(%rdx)
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_printf
LBB0_6:
	xorl	%r14d, %r14d
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cpu_clock_allowed,4,2          ## @cpu_clock_allowed
	.comm	_memregl,8,3                    ## @memregl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"clock set to %dMHz, AHB set to %dMHz\n"

	.comm	_SYS_CLK_FREQ,4,2               ## @SYS_CLK_FREQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pollux_cpu_clock_set           ; -- Begin function pollux_cpu_clock_set
	.p2align	2
_pollux_cpu_clock_set:                  ; @pollux_cpu_clock_set
	.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
Lloh0:
	adrp	x8, _cpu_clock_allowed@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cpu_clock_allowed@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.1:
	mov	x19, x0
	bl	_pollux_cpu_clock_get
	cmp	w0, w19
	b.eq	LBB0_6
; %bb.2:
	mov	w8, #21846
	movk	w8, #21845, lsl #16
	smull	x8, w19, w8
	lsr	x9, x8, #63
	lsr	x8, x8, #32
	add	w8, w8, w9
	cmp	w8, #1023
	b.hi	LBB0_7
; %bb.3:
	lsl	w9, w8, #8
	mov	w10, #1
	mov	w8, #-64
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sdiv	w2, w19, w10
	add	w10, w10, #1
	add	w8, w8, #64
	cmp	w2, #250
	b.gt	LBB0_4
; %bb.5:
	mov	w10, #2359296
	orr	w9, w9, w10
Lloh3:
	adrp	x10, _memregl@GOTPAGE
Lloh4:
	ldr	x10, [x10, _memregl@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	add	x10, x10, #15, lsl #12          ; =61440
	ldr	w11, [x10]
	and	w11, w11, #0xfffffc3f
	orr	w8, w11, w8
	stp	w8, w9, [x10]
	ldr	w8, [x10, #124]
	orr	w8, w8, #0x8000
	str	w8, [x10, #124]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printf
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	mov	w0, #-1
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_cpu_clock_allowed,4,2          ; @cpu_clock_allowed
	.comm	_memregl,8,3                    ; @memregl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clock set to %dMHz, AHB set to %dMHz\n"

	.comm	_SYS_CLK_FREQ,4,2               ; @SYS_CLK_FREQ
.subsections_via_symbols
