	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pll
_set_pll:                               ## @set_pll
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	cmpl	$3, %esi
	movl	$2, %eax
	cmovgel	%esi, %eax
	cmpl	$5, %eax
	movl	$5, %r15d
	cmovbl	%eax, %r15d
	movl	%edx, %ebx
	imull	%r15d, %ebx
	leal	(,%rbx,8), %r12d
	shll	$23, %ebx
	movq	_xtal@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_do_div
	andl	$56, %r12d
	cmpl	$13, %r12d
	ja	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_7
LBB0_2:
	andl	$58720256, %ebx                 ## imm = 0x3800000
	movl	%r15d, %eax
	leaq	_set_pll.pre(%rip), %rcx
	movl	(%rcx,%rax,4), %r12d
	shll	$26, %r12d
	orl	%ebx, %r12d
	movq	_MO_PLL_REG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_cx_read
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%r12d, %edx
	movl	%eax, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_dprintk
	movl	(%rbx), %edi
	movl	%r12d, %esi
	callq	_cx_write
	movl	$100, %ebx
	movq	_MO_DEVICE_STATUS@GOTPCREL(%rip), %r13
	leaq	L_.str.3(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_cx_read
	testb	$4, %al
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_dprintk
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$20000, %esi                    ## imm = 0x4E20
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_3
## %bb.6:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_7:
	movl	$-1, %ebx
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$1, %edi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @set_pll.pre
_set_pll.pre:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	3                               ## 0x3
	.long	2                               ## 0x2
	.long	1                               ## 0x1

	.comm	_xtal,4,2                       ## @xtal
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pll out of range\n"

L_.str.1:                               ## @.str.1
	.asciz	"set_pll:    MO_PLL_REG       0x%08x [old=0x%08x,freq=%d]\n"

	.comm	_MO_PLL_REG,4,2                 ## @MO_PLL_REG
	.comm	_MO_DEVICE_STATUS,4,2           ## @MO_DEVICE_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"pll locked [pre=%d,ofreq=%d]\n"

L_.str.3:                               ## @.str.3
	.asciz	"pll not locked yet, waiting ...\n"

L_.str.4:                               ## @.str.4
	.asciz	"pll NOT locked [pre=%d,ofreq=%d]\n"

	.no_dead_strip	_set_pll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pll
_set_pll:                               ; @set_pll
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	w8, #2
	cmp	w1, #2
	csel	w8, w1, w8, gt
	mov	w9, #5
	cmp	w8, #5
	csel	w21, w8, w9, lo
	mul	w22, w2, w21
	lsl	w20, w22, #23
Lloh0:
	adrp	x8, _xtal@GOTPAGE
Lloh1:
	ldr	x8, [x8, _xtal@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_do_div
	ubfiz	w8, w22, #3, #3
	cmp	w8, #13
	b.hi	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_6
LBB0_2:
	and	w20, w20, #0x3800000
Lloh5:
	adrp	x8, _set_pll.pre@PAGE
Lloh6:
	add	x8, x8, _set_pll.pre@PAGEOFF
	ldr	w8, [x8, w21, uxtw #2]
	bfi	w20, w8, #26, #6
Lloh7:
	adrp	x22, _MO_PLL_REG@GOTPAGE
Lloh8:
	ldr	x22, [x22, _MO_PLL_REG@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_cx_read
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x19, [sp, #8]
	str	x20, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_dprintk
	ldr	w0, [x22]
	mov	x1, x20
	bl	_cx_write
	mov	w22, #100
Lloh11:
	adrp	x23, _MO_DEVICE_STATUS@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MO_DEVICE_STATUS@GOTPAGEOFF]
Lloh13:
	adrp	x20, l_.str.3@PAGE
Lloh14:
	add	x20, x20, l_.str.3@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_cx_read
	tbnz	w0, #2, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_dprintk
	mov	w0, #10000
	mov	w1, #20000
	bl	_usleep_range
	subs	w22, w22, #1
	b.ne	LBB0_3
; %bb.5:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	stp	x21, x19, [sp]
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_dprintk
LBB0_6:
	mov	w0, #-1
	b	LBB0_8
LBB0_7:
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
	stp	x21, x19, [sp]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_dprintk
	mov	w0, #0
LBB0_8:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @set_pll.pre
_set_pll.pre:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.long	1                               ; 0x1

	.comm	_xtal,4,2                       ; @xtal
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pll out of range\n"

l_.str.1:                               ; @.str.1
	.asciz	"set_pll:    MO_PLL_REG       0x%08x [old=0x%08x,freq=%d]\n"

	.comm	_MO_PLL_REG,4,2                 ; @MO_PLL_REG
	.comm	_MO_DEVICE_STATUS,4,2           ; @MO_DEVICE_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"pll locked [pre=%d,ofreq=%d]\n"

l_.str.3:                               ; @.str.3
	.asciz	"pll not locked yet, waiting ...\n"

l_.str.4:                               ; @.str.4
	.asciz	"pll NOT locked [pre=%d,ofreq=%d]\n"

	.no_dead_strip	_set_pll
.subsections_via_symbols
