	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_cpu_freq
_set_cpu_freq:                          ## @set_cpu_freq
	.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
	movq	%rdi, %rbx
	callq	_get_speed_point
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	(%r14), %rdx
	cmpq	%rdx, (%rax)
	jge	LBB0_2
## %bb.1:
	movl	8(%rbx), %edi
	movq	%rdx, %rsi
	callq	_regulator_set_voltage
	movl	%eax, %r15d
	movl	$10000, %edi                    ## imm = 0x2710
	callq	_DELAY
	testl	%r15d, %r15d
	jne	LBB0_11
LBB0_2:
	movl	20(%rbx), %edi
	movl	24(%rbx), %esi
	callq	_clk_set_parent_by_clk
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	movl	12(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_11
LBB0_4:
	movl	16(%rbx), %edi
	movl	8(%r14), %esi
	movq	_CLK_SET_ROUND_DOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_clk_set_freq
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movl	12(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_11
LBB0_6:
	movl	16(%rbx), %esi
	movl	20(%rbx), %edi
	callq	_clk_set_parent_by_clk
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	movl	12(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_device_printf
	jmp	LBB0_11
LBB0_8:
	movq	(%rbx), %rax
	movq	(%r14), %rdx
	cmpq	%rdx, (%rax)
	jle	LBB0_10
## %bb.9:
	movl	8(%rbx), %edi
	movq	%rdx, %rsi
	callq	_regulator_set_voltage
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_11
LBB0_10:
	movq	%r14, (%rbx)
	xorl	%r15d, %r15d
LBB0_11:
	movl	%r15d, %eax
	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	"Can't set parent to PLLP\n"

	.comm	_CLK_SET_ROUND_DOWN,4,2         ## @CLK_SET_ROUND_DOWN
L_.str.1:                               ## @.str.1
	.asciz	"Can't set CPU clock frequency\n"

L_.str.2:                               ## @.str.2
	.asciz	"Can't set parent to PLLX\n"

	.no_dead_strip	_set_cpu_freq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_cpu_freq
_set_cpu_freq:                          ; @set_cpu_freq
	.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
	mov	x19, x0
	bl	_get_speed_point
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x1, [x0]
	cmp	x8, x1
	b.ge	LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
	mov	x2, x1
	bl	_regulator_set_voltage
	mov	x21, x0
	mov	w0, #10000
	bl	_DELAY
	cbnz	w21, LBB0_11
LBB0_2:
	ldp	w0, w1, [x19, #20]
	bl	_clk_set_parent_by_clk
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
	b	LBB0_11
LBB0_4:
	ldr	w0, [x19, #16]
	ldr	w1, [x20, #8]
Lloh2:
	adrp	x8, _CLK_SET_ROUND_DOWN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CLK_SET_ROUND_DOWN@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_clk_set_freq
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_device_printf
	b	LBB0_11
LBB0_6:
	ldp	w1, w0, [x19, #16]
	bl	_clk_set_parent_by_clk
	cbz	w0, LBB0_8
; %bb.7:
	mov	x21, x0
	ldr	w0, [x19, #12]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_device_printf
	b	LBB0_11
LBB0_8:
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x1, [x20]
	cmp	x8, x1
	b.le	LBB0_10
; %bb.9:
	ldr	w0, [x19, #8]
	mov	x2, x1
	bl	_regulator_set_voltage
	mov	x21, x0
	cbnz	w0, LBB0_11
LBB0_10:
	mov	w21, #0
	str	x20, [x19]
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't set parent to PLLP\n"

	.comm	_CLK_SET_ROUND_DOWN,4,2         ; @CLK_SET_ROUND_DOWN
l_.str.1:                               ; @.str.1
	.asciz	"Can't set CPU clock frequency\n"

l_.str.2:                               ; @.str.2
	.asciz	"Can't set parent to PLLX\n"

	.no_dead_strip	_set_cpu_freq
.subsections_via_symbols
