	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu8_update_sclk_limit
_smu8_update_sclk_limit:                ## @smu8_update_sclk_limit
	.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	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	32(%rdi), %r12
	movq	8(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	callq	_smu8_get_max_sclk_level
	decl	%eax
	cltq
	movq	(%rbx), %rcx
	movq	8(%rbx), %rdx
	leaq	-1(%rcx), %rsi
	cmpq	%rax, %rcx
	cmovaq	%rax, %rsi
	movq	(%rdx,%rsi,8), %rax
	movq	%rax, 8(%r12)
	movq	24(%r15), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	cmpq	%rbx, 16(%r12)
	je	LBB0_4
LBB0_3:
	movq	%rbx, 16(%r12)
	movq	_PPSMC_MSG_SetSclkHardMin@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_smu8_get_sclk_level
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%eax, %edx
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_4:
	movq	(%r12), %r14
	movl	(%r15), %edi
	movq	_PHM_PlatformCaps_StablePState@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_phm_cap_enabled
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	imulq	$75, 8(%r15), %rax
	shrq	$2, %rax
	movabsq	$2951479051793528259, %rcx      ## imm = 0x28F5C28F5C28F5C3
	mulq	%rcx
	shrq	$2, %rdx
	cmpq	%rdx, %r14
	cmovbeq	%rdx, %r14
LBB0_6:
	cmpq	%r14, (%r12)
	je	LBB0_8
## %bb.7:
	movq	%r14, (%r12)
	movq	_PPSMC_MSG_SetSclkSoftMin@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_smu8_get_sclk_level
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_8:
	movl	(%r15), %edi
	movl	(%r13), %esi
	callq	_phm_cap_enabled
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	cmpq	%r14, 8(%r12)
	je	LBB0_11
## %bb.10:
	movq	%r14, 8(%r12)
	movq	_PPSMC_MSG_SetSclkSoftMax@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_smu8_get_sclk_level
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_11:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_debug
	cmpq	%rbx, 16(%r12)
	jne	LBB0_3
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"min_core_set_clock not set\n"

	.comm	_PPSMC_MSG_SetSclkHardMin,4,2   ## @PPSMC_MSG_SetSclkHardMin
	.comm	_PHM_PlatformCaps_StablePState,4,2 ## @PHM_PlatformCaps_StablePState
	.comm	_PPSMC_MSG_SetSclkSoftMin,4,2   ## @PPSMC_MSG_SetSclkSoftMin
	.comm	_PPSMC_MSG_SetSclkSoftMax,4,2   ## @PPSMC_MSG_SetSclkSoftMax
	.no_dead_strip	_smu8_update_sclk_limit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu8_update_sclk_limit
_smu8_update_sclk_limit:                ; @smu8_update_sclk_limit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x22, [x0, #32]
	ldr	x20, [x0, #16]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	str	x8, [x22]
	bl	_smu8_get_max_sclk_level
	sub	w8, w0, #1
	sxtw	x8, w8
	ldp	x9, x10, [x20]
	sub	x11, x9, #1
	cmp	x9, x8
	csel	x8, x8, x11, hi
	ldr	x8, [x10, x8, lsl #3]
	str	x8, [x22, #8]
	ldr	x8, [x19, #24]
	ldr	x20, [x8]
	cbnz	x20, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
LBB0_2:
	ldr	x8, [x22, #16]
	cmp	x8, x20
	b.eq	LBB0_4
; %bb.3:
	str	x20, [x22, #16]
Lloh2:
	adrp	x8, _PPSMC_MSG_SetSclkHardMin@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PPSMC_MSG_SetSclkHardMin@GOTPAGEOFF]
Lloh4:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_smu8_get_sclk_level
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_smum_send_msg_to_smc_with_parameter
LBB0_4:
	ldr	x20, [x22]
	ldr	w0, [x19]
Lloh5:
	adrp	x23, _PHM_PlatformCaps_StablePState@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PHM_PlatformCaps_StablePState@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_phm_cap_enabled
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x19, #8]
	mov	w9, #75
	mul	x8, x8, x9
	lsr	x8, x8, #2
	mov	x9, #62915
	movk	x9, #23592, lsl #16
	movk	x9, #49807, lsl #32
	movk	x9, #10485, lsl #48
	umulh	x8, x8, x9
	lsr	x8, x8, #2
	cmp	x20, x8
	csel	x20, x20, x8, hi
LBB0_6:
	ldr	x8, [x22]
	cmp	x8, x20
	b.eq	LBB0_8
; %bb.7:
	str	x20, [x22]
Lloh7:
	adrp	x8, _PPSMC_MSG_SetSclkSoftMin@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PPSMC_MSG_SetSclkSoftMin@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_smu8_get_sclk_level
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_smum_send_msg_to_smc_with_parameter
LBB0_8:
	ldr	w0, [x19]
	ldr	w1, [x23]
	bl	_phm_cap_enabled
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x8, [x22, #8]
	cmp	x8, x20
	b.eq	LBB0_11
; %bb.10:
	str	x20, [x22, #8]
Lloh10:
	adrp	x8, _PPSMC_MSG_SetSclkSoftMax@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PPSMC_MSG_SetSclkSoftMax@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_smu8_get_sclk_level
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_smum_send_msg_to_smc_with_parameter
LBB0_11:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"min_core_set_clock not set\n"

	.comm	_PPSMC_MSG_SetSclkHardMin,4,2   ; @PPSMC_MSG_SetSclkHardMin
	.comm	_PHM_PlatformCaps_StablePState,4,2 ; @PHM_PlatformCaps_StablePState
	.comm	_PPSMC_MSG_SetSclkSoftMin,4,2   ; @PPSMC_MSG_SetSclkSoftMin
	.comm	_PPSMC_MSG_SetSclkSoftMax,4,2   ; @PPSMC_MSG_SetSclkSoftMax
	.no_dead_strip	_smu8_update_sclk_limit
.subsections_via_symbols
