	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gk104_ram_calc_xits
_gk104_ram_calc_xits:                   ## @gk104_ram_calc_xits
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r15
	leaq	68(%rdi), %r13
	movq	32(%rdi), %r12
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ram_init
	testl	%eax, %eax
	jne	LBB0_21
## %bb.1:
	movl	(%rbx), %eax
	xorl	%ecx, %ecx
	cmpl	76(%r15), %eax
	setg	%cl
	incl	%ecx
	movl	%ecx, (%r15)
	movq	%r13, %rdi
	movl	$1274868, %esi                  ## imm = 0x1373F4
	callq	_ram_rd32
	andl	$15, %eax
	movl	%eax, 4(%r15)
	movl	(%rbx), %eax
	cmpl	$2, (%r15)
	jne	LBB0_5
## %bb.2:
	movq	(%r12), %rcx
	movl	(%rcx), %esi
	leaq	52(%r15), %rdx
	leaq	48(%r15), %rcx
	leaq	44(%r15), %r8
	leaq	40(%r15), %r9
	leaq	64(%r15), %r10
	leaq	60(%r15), %r11
	leaq	56(%r15), %r14
	subq	$8, %rsp
	movl	%eax, %edi
	pushq	%r14
	pushq	%r11
	pushq	%r10
	callq	_gk104_pll_calc_hiclk
	addq	$32, %rsp
	movl	%eax, 72(%r15)
	testl	%eax, %eax
	jle	LBB0_3
## %bb.7:
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %ecx
	callq	_nvkm_debug
	jmp	LBB0_8
LBB0_5:
	leaq	76(%r15), %rsi
	leaq	52(%r15), %rcx
	leaq	48(%r15), %r8
	leaq	44(%r15), %r9
	leaq	40(%r15), %r10
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	%eax, %edx
	pushq	%r10
	callq	_gt215_pll_calc
	addq	$16, %rsp
	movl	%eax, 72(%r15)
	testl	%eax, %eax
	jle	LBB0_6
LBB0_8:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	16(%r15), %r12
	movl	(%r13), %edi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_13
## %bb.9:
	xorl	%ebx, %ebx
	movq	_mr@GOTPCREL(%rip), %r14
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rbx
	movl	(%r13), %edi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_13
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r13, %rdi
	callq	_ram_have
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r13, %rdi
	callq	_ram_rd32
	movq	(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	jmp	LBB0_12
LBB0_13:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %eax
	movl	%eax, 24(%r15)
	movl	28(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_17
## %bb.14:
	cmpl	$129, %eax
	jne	LBB0_19
## %bb.15:
	movq	%r12, %rdi
	callq	_nvkm_sddr3_calc
	testl	%eax, %eax
	jne	LBB0_21
## %bb.16:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gk104_ram_calc_sddr3           ## TAILCALL
LBB0_17:
	xorl	%esi, %esi
	cmpl	$0, 8(%r15)
	setne	%sil
	movq	%r12, %rdi
	callq	_nvkm_gddr5_calc
	testl	%eax, %eax
	jne	LBB0_21
## %bb.18:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gk104_ram_calc_gddr5           ## TAILCALL
LBB0_19:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_20
LBB0_3:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
LBB0_4:
	movq	%r12, %rdi
	callq	_nvkm_error
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_20:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to calc plls\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"successfully calced PLLs for clock %i kHz (refclock: %i kHz)\n"

L_.str.2:                               ## @.str.2
	.asciz	"unable to calc refpll\n"

	.comm	_mr,8,3                         ## @mr
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.no_dead_strip	_gk104_ram_calc_xits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gk104_ram_calc_xits
_gk104_ram_calc_xits:                   ; @gk104_ram_calc_xits
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x19, x0
	add	x21, x0, #68
	ldr	x22, [x0, #32]
	mov	x0, x21
	mov	x1, x22
	bl	_ram_init
	cbnz	w0, LBB0_21
; %bb.1:
	ldr	w8, [x20]
	mov	x23, x19
	ldr	w9, [x23, #76]!
	cmp	w8, w9
	mov	w8, #1
	cinc	w8, w8, gt
	str	w8, [x19]
	mov	x0, x21
	mov	w1, #29684
	movk	w1, #19, lsl #16
	bl	_ram_rd32
	and	w8, w0, #0xf
	str	w8, [x19, #4]
	ldr	w8, [x20]
	ldr	w9, [x19]
	cmp	w9, #2
	b.ne	LBB0_4
; %bb.2:
	ldr	x9, [x22]
	add	x2, x19, #52
	add	x3, x19, #48
	add	x4, x19, #44
	ldr	w1, [x9]
	add	x5, x19, #40
	add	x6, x19, #64
	add	x7, x19, #60
	add	x9, x19, #56
	str	x9, [sp]
	mov	x0, x8
	bl	_gk104_pll_calc_hiclk
	str	w0, [x19, #72]
	cmp	w0, #0
	b.le	LBB0_17
; %bb.3:
	mov	x3, x0
	ldr	w2, [x20]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_nvkm_debug
	b	LBB0_5
LBB0_4:
	add	x3, x19, #52
	add	x4, x19, #48
	add	x5, x19, #44
	add	x6, x19, #40
	mov	x0, x22
	mov	x1, x23
	mov	x2, x8
	bl	_gt215_pll_calc
	str	w0, [x19, #72]
	cmp	w0, #0
	b.le	LBB0_18
LBB0_5:
	add	x22, x19, #16
	ldr	w0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x23, #0
Lloh2:
	adrp	x24, _mr@GOTPAGE
Lloh3:
	ldr	x24, [x24, _mr@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	ldr	w0, [x21]
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	w1, [x8, x23, lsl #2]
	mov	x0, x21
	bl	_ram_have
	cbz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x24]
	lsl	x25, x23, #2
	ldr	w1, [x8, x25]
	mov	x0, x21
	bl	_ram_rd32
	ldr	x8, [x22]
	str	w0, [x8, x25]
	b	LBB0_7
LBB0_10:
	ldr	w8, [x20]
	str	w8, [x19, #24]
	ldr	w8, [x19, #28]
	cmp	w8, #128
	b.eq	LBB0_14
; %bb.11:
	cmp	w8, #129
	b.ne	LBB0_16
; %bb.12:
	mov	x0, x22
	bl	_nvkm_sddr3_calc
	cbnz	w0, LBB0_21
; %bb.13:
	ldr	w1, [x20]
	mov	x0, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_gk104_ram_calc_sddr3
LBB0_14:
	ldr	w8, [x19, #8]
	cmp	w8, #0
	cset	w1, ne
	mov	x0, x22
	bl	_nvkm_gddr5_calc
	cbnz	w0, LBB0_21
; %bb.15:
	ldr	w1, [x20]
	mov	x0, x19
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_gk104_ram_calc_gddr5
LBB0_16:
Lloh4:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_20
LBB0_17:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_19:
	mov	x0, x22
	bl	_nvkm_error
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to calc plls\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"successfully calced PLLs for clock %i kHz (refclock: %i kHz)\n"

l_.str.2:                               ; @.str.2
	.asciz	"unable to calc refpll\n"

	.comm	_mr,8,3                         ; @mr
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.no_dead_strip	_gk104_ram_calc_xits
.subsections_via_symbols
