	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpufreq_set_clock
_cpufreq_set_clock:                     ## @cpufreq_set_clock
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	(%rsi), %rsi
	cmpq	(%rdi), %rsi
	jle	LBB0_2
## %bb.1:
	movl	8(%rbx), %esi
	movq	%r15, %rdi
	callq	_vdd_set
	movq	(%rbx), %rsi
LBB0_2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r15, %rdi
	callq	_cpufreq_mhz_to_div
	movq	_IMX6_ANALOG_CCM_PLL_ARM_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_imx6_anatop_write_4
	movq	_IMX6_ANALOG_CCM_PLL_ARM_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IMX6_ANALOG_CCM_PLL_ARM_BYPASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_imx6_anatop_write_4
	movq	_IMX6_ANALOG_CCM_PLL_ARM@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_imx6_anatop_read_4
	movq	_IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	orl	-44(%rbp), %esi
	movl	(%r12), %edi
	callq	_imx6_anatop_write_4
	movl	(%r12), %edi
	callq	_imx6_anatop_read_4
	movq	_IMX6_ANALOG_CCM_PLL_ARM_LOCK@GOTPCREL(%rip), %r13
	testl	%eax, (%r13)
	je	LBB0_3
LBB0_7:
	movq	_IMX6_ANALOG_CCM_PLL_ARM_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IMX6_ANALOG_CCM_PLL_ARM_BYPASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_imx6_anatop_write_4
	movl	-48(%rbp), %edi
	callq	_imx_ccm_set_cacrr
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rsi
	cmpq	(%r15), %rsi
	jge	LBB0_9
## %bb.8:
	movl	8(%rbx), %esi
	movq	%r15, %rdi
	callq	_vdd_set
	movq	(%rbx), %rsi
LBB0_9:
	movq	%rsi, (%r15)
	movq	%r15, %rdi
	callq	_cpufreq_actual_mhz
	imull	$500000, %eax, %edi             ## imm = 0x7A120
	callq	_arm_tmr_change_frequency
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	$-9999, %r14d                   ## imm = 0xD8F1
	leaq	L_.str(%rip), %rbx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r12), %edi
	callq	_imx6_anatop_read_4
	incl	%r14d
	testl	%eax, (%r13)
	jne	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r14d, %r14d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_panic
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_CLR,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_CLR
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_SET,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_SET
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_BYPASS,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_BYPASS
	.comm	_IMX6_ANALOG_CCM_PLL_ARM,4,2    ## @IMX6_ANALOG_CCM_PLL_ARM
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_LOCK,4,2 ## @IMX6_ANALOG_CCM_PLL_ARM_LOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"imx6_set_cpu_clock(): PLL never locked"

	.no_dead_strip	_cpufreq_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpufreq_set_clock
_cpufreq_set_clock:                     ; @cpufreq_set_clock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	ldr	x1, [x1]
	ldr	x8, [x0]
	cmp	x1, x8
	b.le	LBB0_2
; %bb.1:
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_vdd_set
	ldr	x1, [x20]
LBB0_2:
	add	x2, sp, #12
	add	x3, sp, #8
	mov	x0, x19
	bl	_cpufreq_mhz_to_div
Lloh0:
	adrp	x22, _IMX6_ANALOG_CCM_PLL_ARM_CLR@GOTPAGE
Lloh1:
	ldr	x22, [x22, _IMX6_ANALOG_CCM_PLL_ARM_CLR@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x8, _IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_imx6_anatop_write_4
Lloh5:
	adrp	x8, _IMX6_ANALOG_CCM_PLL_ARM_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IMX6_ANALOG_CCM_PLL_ARM_SET@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x23, _IMX6_ANALOG_CCM_PLL_ARM_BYPASS@GOTPAGE
Lloh9:
	ldr	x23, [x23, _IMX6_ANALOG_CCM_PLL_ARM_BYPASS@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_imx6_anatop_write_4
Lloh10:
	adrp	x24, _IMX6_ANALOG_CCM_PLL_ARM@GOTPAGE
Lloh11:
	ldr	x24, [x24, _IMX6_ANALOG_CCM_PLL_ARM@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_imx6_anatop_read_4
Lloh12:
	adrp	x8, _IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	w9, [sp, #8]
	orr	w1, w8, w9
	ldr	w0, [x24]
	bl	_imx6_anatop_write_4
	ldr	w0, [x24]
	bl	_imx6_anatop_read_4
Lloh15:
	adrp	x25, _IMX6_ANALOG_CCM_PLL_ARM_LOCK@GOTPAGE
Lloh16:
	ldr	x25, [x25, _IMX6_ANALOG_CCM_PLL_ARM_LOCK@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_6
LBB0_3:
	ldr	w0, [x22]
	ldr	w1, [x23]
	bl	_imx6_anatop_write_4
	ldr	w0, [sp, #12]
	bl	_imx_ccm_set_cacrr
	ldr	x1, [x20]
	ldr	x8, [x19]
	cmp	x1, x8
	b.ge	LBB0_5
; %bb.4:
	ldr	w1, [x20, #8]
	mov	x0, x19
	bl	_vdd_set
	ldr	x1, [x20]
LBB0_5:
	str	x1, [x19]
	mov	x0, x19
	bl	_cpufreq_actual_mhz
	mov	w8, #41248
	movk	w8, #7, lsl #16
	mul	w0, w0, w8
	bl	_arm_tmr_change_frequency
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	mov	w26, #-9999
Lloh17:
	adrp	x21, l_.str@PAGE
Lloh18:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x24]
	bl	_imx6_anatop_read_4
	ldr	w8, [x25]
	add	w26, w26, #1
	tst	w8, w0
	b.ne	LBB0_3
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	w26, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_panic
	b	LBB0_7
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_CLR,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_CLR
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_CLK_SRC_MASK
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_SET,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_SET
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_BYPASS,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_BYPASS
	.comm	_IMX6_ANALOG_CCM_PLL_ARM,4,2    ; @IMX6_ANALOG_CCM_PLL_ARM
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_DIV_MASK
	.comm	_IMX6_ANALOG_CCM_PLL_ARM_LOCK,4,2 ; @IMX6_ANALOG_CCM_PLL_ARM_LOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"imx6_set_cpu_clock(): PLL never locked"

	.no_dead_strip	_cpufreq_set_clock
.subsections_via_symbols
