	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv40_ram_calc
_nv40_ram_calc:                         ## @nv40_ram_calc
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	callq	_nv40_ram
	movq	%rax, %r15
	movq	8(%rax), %r12
	movq	(%r12), %rax
	movq	(%rax), %rdi
	leaq	-72(%rbp), %rdx
	movl	$4, %esi
	callq	_nvbios_pll_parse
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_nvkm_error
	jmp	LBB0_8
LBB0_2:
	leaq	-36(%rbp), %rax
	leaq	-40(%rbp), %rbx
	leaq	-72(%rbp), %rsi
	leaq	-52(%rbp), %rcx
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	movq	%r12, %rdi
	movl	%r14d, %edx
	pushq	%rax
	pushq	%rbx
	callq	_nv04_pll_calc
	addq	$16, %rsp
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	-36(%rbp), %eax
	shll	$16, %eax
	orl	$-2147483648, %eax              ## imm = 0x80000000
	movl	%eax, (%r15)
	movslq	-36(%rbp), %rdi
	addq	-64(%rbp), %rdi
	movl	-72(%rbp), %esi
	callq	_min
	shll	$20, %eax
	orl	(%r15), %eax
	movl	-44(%rbp), %ecx
	cmpl	-40(%rbp), %ecx
	jne	LBB0_6
## %bb.5:
	orl	$256, %eax                      ## imm = 0x100
	movl	%eax, (%r15)
	movl	-52(%rbp), %eax
	shll	$8, %eax
	jmp	LBB0_7
LBB0_3:
	movl	%eax, %ebx
	jmp	LBB0_8
LBB0_6:
	orl	$1073741824, %eax               ## imm = 0x40000000
	movl	%eax, (%r15)
	movl	-44(%rbp), %eax
	shll	$24, %eax
	movl	-40(%rbp), %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	-52(%rbp), %eax
	shll	$8, %eax
	orl	%ecx, %eax
LBB0_7:
	orl	-48(%rbp), %eax
	movl	%eax, 4(%r15)
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mclk pll data not found\n"

	.no_dead_strip	_nv40_ram_calc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv40_ram_calc
_nv40_ram_calc:                         ; @nv40_ram_calc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	bl	_nv40_ram
	mov	x19, x0
	ldr	x22, [x0, #8]
	ldr	x8, [x22]
	ldr	x0, [x8]
	add	x2, sp, #32
	mov	w1, #4
	bl	_nvbios_pll_parse
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_nvkm_error
	b	LBB0_8
LBB0_2:
	add	x1, sp, #32
	add	x3, sp, #28
	add	x4, sp, #24
	add	x5, sp, #20
	add	x6, sp, #16
	add	x7, sp, #12
	mov	x0, x22
	mov	x2, x21
	bl	_nv04_pll_calc
	tbnz	w0, #31, LBB0_5
; %bb.3:
	ldr	w8, [sp, #12]
	lsl	w8, w8, #16
	orr	w8, w8, #0x80000000
	str	w8, [x19]
	ldr	x8, [sp, #40]
	ldrsw	x9, [sp, #12]
	add	x0, x8, x9
	ldr	w1, [sp, #32]
	bl	_min
	ldr	w8, [x19]
	orr	w8, w8, w0, lsl #20
	ldp	w10, w9, [sp, #16]
	cmp	w9, w10
	b.ne	LBB0_6
; %bb.4:
	mov	w20, #0
	orr	w8, w8, #0x100
	str	w8, [x19]
	ldp	w9, w8, [sp, #24]
	orr	w8, w9, w8, lsl #8
	b	LBB0_7
LBB0_5:
	mov	x20, x0
	b	LBB0_8
LBB0_6:
	mov	w20, #0
	orr	w8, w8, #0x40000000
	str	w8, [x19]
	ldp	w9, w8, [sp, #16]
	lsl	w9, w9, #16
	orr	w8, w9, w8, lsl #24
	ldr	w9, [sp, #28]
	orr	w8, w8, w9, lsl #8
	ldr	w9, [sp, #24]
	orr	w8, w8, w9
LBB0_7:
	str	w8, [x19, #4]
LBB0_8:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mclk pll data not found\n"

	.no_dead_strip	_nv40_ram_calc
.subsections_via_symbols
