	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hifn_init_pll
_hifn_init_pll:                         ## @hifn_init_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_HIFN_1_PLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_HIFN_PLL_RESERVED_1@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_hifn_pll_ref@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$3, %edx
	callq	_strncmp
	movq	%rax, %r15
	movq	_HIFN_PLL_REF_CLK_PLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_HIFN_PLL_REF_CLK_HBI@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r12), %rcx
	cmpb	$0, 3(%rcx)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	addq	$3, %rcx
	movq	%rcx, %rdi
	xorl	%esi, %esi
	movl	$10, %edx
	callq	_simple_strtoul
	movl	%eax, %ebx
	jmp	LBB0_3
LBB0_2:
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$66, %ebx
	movl	$66, %edx
	callq	_dev_info
LBB0_3:
	testq	%r15, %r15
	cmovel	-44(%rbp), %r14d                ## 4-byte Folded Reload
	movq	_HIFN_PLL_FCK_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edx, %edx
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	divl	%ebx
	movl	%eax, %r12d
	movq	_HIFN_PLL_ND_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r12d, %ebx
	shrl	%ebx
	decl	%ebx
	shll	%cl, %ebx
	orl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	orl	%r14d, %r13d
	orl	%r13d, %ebx
	cmpl	$9, %r12d
	jae	LBB0_4
## %bb.5:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	_HIFN_PLL_IS_1_8@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	_HIFN_PLL_IS_9_12@GOTPCREL(%rip), %rax
LBB0_6:
	orl	(%rax), %ebx
	movq	_HIFN_PLL_PK_CLK_HBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%ebx, %edx
	movq	_HIFN_PLL_PE_CLK_HBI@GOTPCREL(%rip), %r13
	orl	(%r13), %edx
	movq	_HIFN_1_PLL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_HIFN_PLL_BP@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_hifn_write_1
	movl	$10, %edi
	callq	_mdelay
	movl	(%r15), %esi
	movq	_HIFN_PLL_PK_CLK_HBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%ebx, %edx
	orl	(%r13), %edx
	movq	%r14, %rdi
	callq	_hifn_write_1
	movq	_HIFN_PLL_PK_CLK_PLL@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	(%r15), %esi
	movq	_HIFN_PLL_PE_CLK_PLL@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_hifn_write_1
	imull	$1000000, -44(%rbp), %eax       ## 4-byte Folded Reload
                                        ## imm = 0xF4240
	addl	$1000000, %eax                  ## imm = 0xF4240
	imull	%r12d, %eax
	shrl	%eax
	movl	%eax, (%r14)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIFN_1_PLL,4,2                 ## @HIFN_1_PLL
	.comm	_HIFN_PLL_RESERVED_1,4,2        ## @HIFN_PLL_RESERVED_1
	.comm	_hifn_pll_ref,8,3               ## @hifn_pll_ref
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ext"

	.comm	_HIFN_PLL_REF_CLK_PLL,4,2       ## @HIFN_PLL_REF_CLK_PLL
	.comm	_HIFN_PLL_REF_CLK_HBI,4,2       ## @HIFN_PLL_REF_CLK_HBI
L_.str.1:                               ## @.str.1
	.asciz	"assuming %uMHz clock speed, override with hifn_pll_ref=%.3s<frequency>\n"

	.comm	_HIFN_PLL_FCK_MAX,4,2           ## @HIFN_PLL_FCK_MAX
	.comm	_HIFN_PLL_ND_SHIFT,4,2          ## @HIFN_PLL_ND_SHIFT
	.comm	_HIFN_PLL_IS_1_8,4,2            ## @HIFN_PLL_IS_1_8
	.comm	_HIFN_PLL_IS_9_12,4,2           ## @HIFN_PLL_IS_9_12
	.comm	_HIFN_PLL_PK_CLK_HBI,4,2        ## @HIFN_PLL_PK_CLK_HBI
	.comm	_HIFN_PLL_PE_CLK_HBI,4,2        ## @HIFN_PLL_PE_CLK_HBI
	.comm	_HIFN_PLL_BP,4,2                ## @HIFN_PLL_BP
	.comm	_HIFN_PLL_PK_CLK_PLL,4,2        ## @HIFN_PLL_PK_CLK_PLL
	.comm	_HIFN_PLL_PE_CLK_PLL,4,2        ## @HIFN_PLL_PE_CLK_PLL
	.no_dead_strip	_hifn_init_pll
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hifn_init_pll
_hifn_init_pll:                         ; @hifn_init_pll
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
Lloh0:
	adrp	x22, _HIFN_1_PLL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HIFN_1_PLL@GOTPAGEOFF]
	ldr	w23, [x22]
Lloh2:
	adrp	x8, _HIFN_PLL_RESERVED_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _HIFN_PLL_RESERVED_1@GOTPAGEOFF]
Lloh4:
	ldr	w24, [x8]
Lloh5:
	adrp	x20, _hifn_pll_ref@GOTPAGE
Lloh6:
	ldr	x20, [x20, _hifn_pll_ref@GOTPAGEOFF]
	ldr	x0, [x20]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #3
	bl	_strncmp
	mov	x21, x0
Lloh9:
	adrp	x8, _HIFN_PLL_REF_CLK_PLL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HIFN_PLL_REF_CLK_PLL@GOTPAGEOFF]
Lloh11:
	adrp	x9, _HIFN_PLL_REF_CLK_HBI@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HIFN_PLL_REF_CLK_HBI@GOTPAGEOFF]
Lloh13:
	ldr	w25, [x8]
Lloh14:
	ldr	w26, [x9]
	ldr	x3, [x20]
	mov	x0, x3
	ldrb	w8, [x0, #3]!
	cbz	w8, LBB0_2
; %bb.1:
	mov	x1, #0
	mov	w2, #10
	bl	_simple_strtoul
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	ldr	x0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w20, #66
	mov	w2, #66
	bl	_dev_info
LBB0_3:
	cmp	x21, #0
	csel	w8, w25, w26, eq
Lloh17:
	adrp	x9, _HIFN_PLL_FCK_MAX@GOTPAGE
Lloh18:
	ldr	x9, [x9, _HIFN_PLL_FCK_MAX@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	udiv	w21, w9, w20
Lloh20:
	adrp	x9, _HIFN_PLL_ND_SHIFT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _HIFN_PLL_ND_SHIFT@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	orr	w10, w24, w23
	orr	w8, w10, w8
	lsr	w10, w21, #1
	sub	w10, w10, #1
	lsl	w9, w10, w9
Lloh23:
	adrp	x10, _HIFN_PLL_IS_1_8@GOTPAGE
Lloh24:
	ldr	x10, [x10, _HIFN_PLL_IS_1_8@GOTPAGEOFF]
Lloh25:
	adrp	x11, _HIFN_PLL_IS_9_12@GOTPAGE
Lloh26:
	ldr	x11, [x11, _HIFN_PLL_IS_9_12@GOTPAGEOFF]
	orr	w8, w8, w9
	cmp	w21, #9
	csel	x9, x10, x11, lo
	ldr	w9, [x9]
	orr	w23, w8, w9
	ldr	w1, [x22]
Lloh27:
	adrp	x24, _HIFN_PLL_PK_CLK_HBI@GOTPAGE
Lloh28:
	ldr	x24, [x24, _HIFN_PLL_PK_CLK_HBI@GOTPAGEOFF]
	ldr	w8, [x24]
	orr	w8, w23, w8
Lloh29:
	adrp	x25, _HIFN_PLL_PE_CLK_HBI@GOTPAGE
Lloh30:
	ldr	x25, [x25, _HIFN_PLL_PE_CLK_HBI@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w8, w8, w9
Lloh31:
	adrp	x9, _HIFN_PLL_BP@GOTPAGE
Lloh32:
	ldr	x9, [x9, _HIFN_PLL_BP@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_hifn_write_1
	mov	w0, #10
	bl	_mdelay
	ldr	w1, [x22]
	ldr	w8, [x24]
	orr	w8, w8, w23
	ldr	w9, [x25]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_hifn_write_1
	ldr	w1, [x22]
Lloh34:
	adrp	x8, _HIFN_PLL_PK_CLK_PLL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _HIFN_PLL_PK_CLK_PLL@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	orr	w8, w8, w23
Lloh37:
	adrp	x9, _HIFN_PLL_PE_CLK_PLL@GOTPAGE
Lloh38:
	ldr	x9, [x9, _HIFN_PLL_PE_CLK_PLL@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_hifn_write_1
	mov	w8, #16960
	movk	w8, #15, lsl #16
	madd	w8, w20, w8, w8
	mul	w8, w8, w21
	lsr	w8, w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_HIFN_1_PLL,4,2                 ; @HIFN_1_PLL
	.comm	_HIFN_PLL_RESERVED_1,4,2        ; @HIFN_PLL_RESERVED_1
	.comm	_hifn_pll_ref,8,3               ; @hifn_pll_ref
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ext"

	.comm	_HIFN_PLL_REF_CLK_PLL,4,2       ; @HIFN_PLL_REF_CLK_PLL
	.comm	_HIFN_PLL_REF_CLK_HBI,4,2       ; @HIFN_PLL_REF_CLK_HBI
l_.str.1:                               ; @.str.1
	.asciz	"assuming %uMHz clock speed, override with hifn_pll_ref=%.3s<frequency>\n"

	.comm	_HIFN_PLL_FCK_MAX,4,2           ; @HIFN_PLL_FCK_MAX
	.comm	_HIFN_PLL_ND_SHIFT,4,2          ; @HIFN_PLL_ND_SHIFT
	.comm	_HIFN_PLL_IS_1_8,4,2            ; @HIFN_PLL_IS_1_8
	.comm	_HIFN_PLL_IS_9_12,4,2           ; @HIFN_PLL_IS_9_12
	.comm	_HIFN_PLL_PK_CLK_HBI,4,2        ; @HIFN_PLL_PK_CLK_HBI
	.comm	_HIFN_PLL_PE_CLK_HBI,4,2        ; @HIFN_PLL_PE_CLK_HBI
	.comm	_HIFN_PLL_BP,4,2                ; @HIFN_PLL_BP
	.comm	_HIFN_PLL_PK_CLK_PLL,4,2        ; @HIFN_PLL_PK_CLK_PLL
	.comm	_HIFN_PLL_PE_CLK_PLL,4,2        ; @HIFN_PLL_PE_CLK_PLL
	.no_dead_strip	_hifn_init_pll
.subsections_via_symbols
