	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	(%rdi), %rdx
	movq	(%rsi), %rax
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %r15
	movq	$0, -72(%rbp)
	testq	%r15, %r15
	je	LBB0_19
## %bb.1:
	movq	%rsi, %r12
	movq	%rdi, %r13
	movslq	%r14d, %rbx
	movq	%rbx, %rax
	shlq	$5, %rax
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	%rdx, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	-96(%rbp), %rcx
	leaq	-88(%rbp), %r8
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_calc_src
	leaq	-80(%rbp), %r8
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%rax, %rdx
	movq	%r15, %rcx
	callq	_calc_div
	movq	%rax, %rbx
	cmpq	%r15, %rax
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_3:
	movl	$17287, %eax                    ## imm = 0x4387
	btl	%r14d, %eax
	movl	%r14d, %esi
	jae	LBB0_4
## %bb.5:
	cmpl	$7, %esi
	jg	LBB0_7
## %bb.6:
	movq	%r13, %rdi
	movq	%r15, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%esi, %r14d
	callq	_calc_pll
	movl	%r14d, %esi
	movq	%rax, %rdx
	jmp	LBB0_8
LBB0_4:
	movl	%esi, %r14d
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_7:
	movq	(%r12), %rax
	movq	_nv_clk_src_hubk06@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rdx
LBB0_8:
	leaq	-72(%rbp), %r8
	movq	%r13, %rdi
	movl	%esi, %r14d
	movq	%r15, %rcx
	callq	_calc_div
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movslq	%r15d, %rcx
	movq	%rcx, %rdx
	subq	%rbx, %rdx
	movq	%rdx, %rsi
	negq	%rsi
	cmovsq	%rdx, %rsi
	subq	%rax, %rcx
	movq	%rcx, %rdx
	negq	%rdx
	cmovsq	%rcx, %rdx
	cmpq	%rdx, %rsi
	jbe	LBB0_10
## %bb.15:
	movq	-72(%rbp), %rcx
	testq	%rcx, %rcx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_17
## %bb.16:
	shll	$8, %ecx
	orl	8(%rsi,%rdi), %ecx
	orl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	%ecx, 8(%rsi,%rdi)
LBB0_17:
	movl	$1, %edx
	movl	%r14d, %ecx
	shll	%cl, %edx
	jmp	LBB0_18
LBB0_10:
	movq	-96(%rbp), %rax
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, 24(%rsi,%rdi)
	movq	-88(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ecx
	shll	$8, %ecx
	orl	%eax, %ecx
	orl	4(%rsi,%rdi), %ecx
	orl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	%ecx, 4(%rsi,%rdi)
LBB0_12:
	movq	-80(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	orl	8(%rsi,%rdi), %eax
	orl	$-2147483648, %eax              ## imm = 0x80000000
	movl	%eax, 8(%rsi,%rdi)
LBB0_14:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	xorl	%edx, %edx
	movq	%rbx, %rax
LBB0_18:
	movl	%edx, 12(%rsi,%rdi)
	movq	%rax, 16(%rsi,%rdi)
LBB0_19:
	xorl	%eax, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nv_clk_src_hubk06,8,3          ## @nv_clk_src_hubk06
	.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, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x25, [x0]
	ldr	x8, [x1]
	ldr	x22, [x8, w3, sxtw #3]
	str	xzr, [sp]
	cbz	x22, LBB0_18
; %bb.1:
	mov	x20, x2
	mov	x24, x1
	mov	x23, x0
	sxtw	x26, w20
	add	x19, x25, x26, lsl #5
	add	x3, sp, #24
	add	x4, sp, #16
	mov	x1, x2
	mov	x2, x22
	bl	_calc_src
	mov	x2, x0
	add	x4, sp, #8
	mov	x0, x23
	mov	x1, x20
	mov	x3, x22
	bl	_calc_div
	mov	x21, x0
	cmp	x0, x22
	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, #7
	b.gt	LBB0_6
; %bb.4:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	mov	x3, x19
	bl	_calc_pll
	mov	x2, x0
	b	LBB0_7
LBB0_5:
	mov	x0, #0
	b	LBB0_8
LBB0_6:
	ldr	x8, [x24]
Lloh0:
	adrp	x9, _nv_clk_src_hubk06@GOTPAGE
Lloh1:
	ldr	x9, [x9, _nv_clk_src_hubk06@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	x2, [x8, x9, lsl #3]
LBB0_7:
	mov	x4, sp
	mov	x0, x23
	mov	x1, x20
	mov	x3, x22
	bl	_calc_div
LBB0_8:
	sxtw	x8, w22
	subs	x9, x8, x21
	cneg	x9, x9, mi
	subs	x8, x8, x0
	cneg	x8, x8, mi
	cmp	x9, x8
	b.ls	LBB0_12
; %bb.9:
	ldr	x8, [sp]
	cbz	x8, LBB0_11
; %bb.10:
	add	x9, x25, x26, lsl #5
	ldr	w10, [x9, #8]
	orr	w8, w10, w8, lsl #8
	orr	w8, w8, #0x80000000
	str	w8, [x9, #8]
LBB0_11:
	mov	w8, #1
	lsl	w8, w8, w20
	b	LBB0_17
LBB0_12:
	ldr	x9, [sp, #24]
	add	x8, x25, x26, lsl #5
	str	x9, [x8, #24]
	ldr	x9, [sp, #16]
	cbz	x9, LBB0_14
; %bb.13:
	ldr	w10, [x8, #4]
	orr	w9, w9, w9, lsl #8
	orr	w9, w9, w10
	orr	w9, w9, #0x80000000
	str	w9, [x8, #4]
LBB0_14:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_16
; %bb.15:
	add	x9, x25, x26, lsl #5
	ldr	w10, [x9, #8]
	orr	w8, w10, w8
	orr	w8, w8, #0x80000000
	str	w8, [x9, #8]
LBB0_16:
	mov	w8, #0
	str	wzr, [x19]
	mov	x0, x21
LBB0_17:
	add	x9, x25, x26, lsl #5
	str	w8, [x9, #12]
	str	x0, [x9, #16]
LBB0_18:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_nv_clk_src_hubk06,8,3          ; @nv_clk_src_hubk06
	.no_dead_strip	_calc_clk
.subsections_via_symbols
