	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv6xx_program_mclk_spread_spectrum_parameters
_rv6xx_program_mclk_spread_spectrum_parameters: ## @rv6xx_program_mclk_spread_spectrum_parameters
	.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, %r15
	callq	_rv6xx_get_pi
	movq	%rax, %rbx
	movl	(%r15), %r14d
	movl	$0, -44(%rbp)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_rv6xx_enable_memory_spread_spectrum
	cmpq	$0, 40(%rbx)
	je	LBB0_4
## %bb.1:
	movq	8(%rbx), %rax
	movq	32(%rbx), %rcx
	movl	(%rcx,%rax,4), %esi
	leaq	-48(%rbp), %r12
	leaq	-44(%rbp), %r13
	movq	%r15, %rdi
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	%r13, %r8
	callq	_rv6xx_find_memory_clock_with_highest_vco
	movq	16(%rbx), %rax
	movq	32(%rbx), %rcx
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	%r13, %r8
	callq	_rv6xx_find_memory_clock_with_highest_vco
	movq	24(%rbx), %rax
	movq	32(%rbx), %rcx
	movl	(%rcx,%rax,4), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	%r13, %r8
	callq	_rv6xx_find_memory_clock_with_highest_vco
	movl	-44(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_4
## %bb.2:
	movq	_ASIC_INTERNAL_MEMORY_SS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_radeon_atombios_get_asic_ss_info
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	-44(%rbp), %edi
	movl	-48(%rbp), %ecx
	incl	%ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	movl	(%rbx), %r8d
	movl	%eax, %esi
	callq	_rv6xx_calculate_spread_spectrum_clk_v
	movl	%eax, %r12d
	movl	-56(%rbp), %edi
	movl	-48(%rbp), %ecx
	incl	%ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %esi
	callq	_rv6xx_calculate_spread_spectrum_clk_s
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_rv6xx_set_memory_spread_spectrum_clk_v
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_rv6xx_set_memory_spread_spectrum_clk_s
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_rv6xx_enable_memory_spread_spectrum
LBB0_4:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ASIC_INTERNAL_MEMORY_SS,4,2    ## @ASIC_INTERNAL_MEMORY_SS
	.no_dead_strip	_rv6xx_program_mclk_spread_spectrum_parameters
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv6xx_program_mclk_spread_spectrum_parameters
_rv6xx_program_mclk_spread_spectrum_parameters: ; @rv6xx_program_mclk_spread_spectrum_parameters
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	bl	_rv6xx_get_pi
	mov	x21, x0
	ldr	w20, [x19]
	str	wzr, [sp, #12]
	mov	x0, x19
	mov	w1, #0
	bl	_rv6xx_enable_memory_spread_spectrum
	ldr	x8, [x21, #40]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #8]
	ldr	w1, [x8, x9, lsl #2]
	add	x3, sp, #24
	add	x4, sp, #12
	mov	x0, x19
	mov	x2, x20
	bl	_rv6xx_find_memory_clock_with_highest_vco
	ldr	x8, [x21, #32]
	ldr	x9, [x21, #16]
	ldr	w1, [x8, x9, lsl #2]
	add	x3, sp, #24
	add	x4, sp, #12
	mov	x0, x19
	mov	x2, x20
	bl	_rv6xx_find_memory_clock_with_highest_vco
	ldp	x9, x8, [x21, #24]
	ldr	w1, [x8, x9, lsl #2]
	add	x3, sp, #24
	add	x4, sp, #12
	mov	x0, x19
	mov	x2, x20
	bl	_rv6xx_find_memory_clock_with_highest_vco
	ldr	w3, [sp, #12]
	cbz	w3, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _ASIC_INTERNAL_MEMORY_SS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ASIC_INTERNAL_MEMORY_SS@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	add	x1, sp, #16
	mov	x0, x19
	bl	_radeon_atombios_get_asic_ss_info
	cbz	x0, LBB0_4
; %bb.3:
	ldp	w0, w2, [sp, #12]
	ldp	w3, w8, [sp, #20]
	add	w8, w8, #1
	ldr	w4, [x21]
	sdiv	w1, w20, w8
	bl	_rv6xx_calculate_spread_spectrum_clk_v
	mov	x21, x0
	ldr	w0, [sp, #16]
	ldr	w8, [sp, #24]
	add	w8, w8, #1
	sdiv	w1, w20, w8
	bl	_rv6xx_calculate_spread_spectrum_clk_s
	mov	x20, x0
	mov	x0, x19
	mov	x1, x21
	bl	_rv6xx_set_memory_spread_spectrum_clk_v
	mov	x0, x19
	mov	x1, x20
	bl	_rv6xx_set_memory_spread_spectrum_clk_s
	mov	x0, x19
	mov	w1, #1
	bl	_rv6xx_enable_memory_spread_spectrum
LBB0_4:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ASIC_INTERNAL_MEMORY_SS,4,2    ; @ASIC_INTERNAL_MEMORY_SS
	.no_dead_strip	_rv6xx_program_mclk_spread_spectrum_parameters
.subsections_via_symbols
