	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_clk
_calc_clk:                              ## @calc_clk
	.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
	movl	$0, -48(%rbp)
	testl	%ecx, %ecx
	je	LBB0_17
## %bb.1:
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movl	%esi, %r12d
	movq	%rdi, %r13
	leaq	-60(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movl	%ebx, %edx
	callq	_calc_src
	leaq	-52(%rbp), %r8
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_calc_div
	xorl	%r15d, %r15d
	cmpl	%ebx, %eax
	je	LBB0_7
## %bb.2:
	movl	$17287, %ecx                    ## imm = 0x4387
	btl	%r12d, %ecx
	jae	LBB0_7
## %bb.3:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$6, %r12d
	jg	LBB0_5
## %bb.4:
	leaq	20(%r14), %rcx
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	callq	_calc_pll
	jmp	LBB0_6
LBB0_5:
	movq	%r13, %rdi
	movl	$1274080, %esi                  ## imm = 0x1370E0
	callq	_read_pll
LBB0_6:
	leaq	-48(%rbp), %r8
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	movl	%ebx, %ecx
	callq	_calc_div
	movl	%eax, %r15d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_7:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%ebx, %edi
	subl	%eax, %edi
	movl	%eax, %r12d
	callq	_abs
	movq	%rax, %r13
	subl	%r15d, %ebx
	movl	%ebx, %edi
	callq	_abs
	cmpq	%rax, %r13
	jle	LBB0_11
## %bb.8:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	shll	$8, %eax
	orl	8(%r14), %eax
	orl	$-2147483648, %eax              ## imm = 0x80000000
	movl	%eax, 8(%r14)
LBB0_10:
	movl	$1, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	jmp	LBB0_16
LBB0_11:
	movl	-60(%rbp), %eax
	movl	%eax, (%r14)
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	4(%r14), %ecx
	orl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	%ecx, 4(%r14)
LBB0_13:
	movl	-52(%rbp), %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.14:
	orl	8(%r14), %ecx
	orl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	%ecx, 8(%r14)
LBB0_15:
	movl	%r12d, %r15d
LBB0_16:
	movl	%eax, 12(%r14)
	movl	%r15d, 16(%r14)
LBB0_17:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_calc_clk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_clk
_calc_clk:                              ; @calc_clk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	str	wzr, [sp]
	cbz	w3, LBB0_19
; %bb.1:
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x23, x0
	add	x3, sp, #12
	add	x4, sp, #8
	mov	x2, x22
	bl	_calc_src
	mov	x2, x0
	add	x4, sp, #4
	mov	x0, x23
	mov	x1, x20
	mov	x3, x22
	bl	_calc_div
	mov	x21, x0
	cmp	w0, w22
	b.eq	LBB0_5
; %bb.2:
	mov	w8, #1
	lsl	w8, w8, w20
	mov	w9, #17287
	tst	w8, w9
	b.eq	LBB0_5
; %bb.3:
	cmp	w20, #6
	b.gt	LBB0_6
; %bb.4:
	add	x3, x19, #20
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	bl	_calc_pll
	b	LBB0_7
LBB0_5:
	mov	w23, #0
	b	LBB0_8
LBB0_6:
	mov	x0, x23
	mov	w1, #28896
	movk	w1, #19, lsl #16
	bl	_read_pll
LBB0_7:
	mov	x2, x0
	mov	x4, sp
	mov	x0, x23
	mov	x1, x20
	mov	x3, x22
	bl	_calc_div
	mov	x23, x0
LBB0_8:
	sub	w0, w22, w21
	bl	_abs
	mov	x24, x0
	sub	w0, w22, w23
	bl	_abs
	cmp	x24, x0
	b.le	LBB0_12
; %bb.9:
	ldr	w8, [sp]
	cbz	w8, LBB0_11
; %bb.10:
	ldr	w9, [x19, #8]
	orr	w8, w9, w8, lsl #8
	orr	w8, w8, #0x80000000
	str	w8, [x19, #8]
LBB0_11:
	mov	w8, #1
	lsl	w8, w8, w20
	b	LBB0_18
LBB0_12:
	ldr	w8, [sp, #12]
	str	w8, [x19]
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_14
; %bb.13:
	ldr	w9, [x19, #4]
	orr	w8, w8, w8, lsl #8
	orr	w8, w8, w9
	orr	w8, w8, #0x80000000
	str	w8, [x19, #4]
LBB0_14:
	ldr	w9, [sp, #4]
	cbz	w9, LBB0_16
; %bb.15:
	mov	w8, #0
	ldr	w10, [x19, #8]
	orr	w9, w9, w10
	orr	w9, w9, #0x80000000
	str	w9, [x19, #8]
	b	LBB0_17
LBB0_16:
	mov	w8, #0
LBB0_17:
	mov	x23, x21
LBB0_18:
	stp	w8, w23, [x19, #12]
LBB0_19:
	mov	w0, #0
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_calc_clk
.subsections_via_symbols
