	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu10_force_clock_level
_smu10_force_clock_level:               ## @smu10_force_clock_level
	.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
	movl	%esi, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r13
	movq	8(%r13), %r14
	bsfl	%edx, %r15d
	cmovel	%edx, %r15d
	movl	$0, %r12d
	je	LBB0_2
## %bb.1:
	movl	%edx, %edi
	callq	_fls
	movl	%eax, %r12d
	decl	%r12d
LBB0_2:
	cmpl	$130, %ebx
	je	LBB0_20
## %bb.3:
	cmpl	$128, %ebx
	jne	LBB0_24
## %bb.4:
	cmpl	$2, %r15d
	ja	LBB0_6
## %bb.5:
	cmpl	$3, %r12d
	jge	LBB0_6
## %bb.7:
	movq	_PPSMC_MSG_SetHardMinGfxClk@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$1, %r15d
	je	LBB0_10
## %bb.8:
	cmpl	$2, %r15d
	jne	LBB0_11
## %bb.9:
	movslq	(%r13), %rax
	jmp	LBB0_12
LBB0_20:
	movl	8(%r14), %eax
	cmpl	%eax, %r15d
	jge	LBB0_22
## %bb.21:
	cmpl	%eax, %r12d
	jge	LBB0_22
## %bb.23:
	movq	_PPSMC_MSG_SetHardMinFclkByFreq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rax
	movl	%r15d, %ecx
	movslq	(%rax,%rcx,4), %rax
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smum_send_msg_to_smc_with_parameter
	movq	_PPSMC_MSG_SetSoftMaxFclkByFreq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r14), %rax
	movslq	%r12d, %rcx
	movslq	(%rax,%rcx,4), %rax
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
	movq	%rbx, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_24:
	xorl	%ebx, %ebx
	jmp	LBB0_25
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_25
LBB0_10:
	movq	_SMU10_UMD_PSTATE_GFXCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	jmp	LBB0_13
LBB0_11:
	movslq	4(%r13), %rax
LBB0_12:
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
LBB0_13:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smum_send_msg_to_smc_with_parameter
	movq	_PPSMC_MSG_SetSoftMaxGfxClk@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	$1, %r12d
	je	LBB0_16
## %bb.14:
	testl	%r12d, %r12d
	jne	LBB0_17
## %bb.15:
	movslq	4(%r13), %rax
	jmp	LBB0_18
LBB0_16:
	movq	_SMU10_UMD_PSTATE_GFXCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	jmp	LBB0_19
LBB0_17:
	movslq	(%r13), %rax
LBB0_18:
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$37, %rdx
	addl	%eax, %edx
LBB0_19:
	movq	%r14, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_25:
	movl	%ebx, %eax
	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	"Currently sclk only support 3 levels on RV\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PPSMC_MSG_SetHardMinGfxClk,4,2 ## @PPSMC_MSG_SetHardMinGfxClk
	.comm	_SMU10_UMD_PSTATE_GFXCLK,4,2    ## @SMU10_UMD_PSTATE_GFXCLK
	.comm	_PPSMC_MSG_SetSoftMaxGfxClk,4,2 ## @PPSMC_MSG_SetSoftMaxGfxClk
	.comm	_PPSMC_MSG_SetHardMinFclkByFreq,4,2 ## @PPSMC_MSG_SetHardMinFclkByFreq
	.comm	_PPSMC_MSG_SetSoftMaxFclkByFreq,4,2 ## @PPSMC_MSG_SetSoftMaxFclkByFreq
	.no_dead_strip	_smu10_force_clock_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smu10_force_clock_level
_smu10_force_clock_level:               ; @smu10_force_clock_level
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0]
	ldr	x23, [x22, #8]
	rbit	w8, w2
	clz	w8, w8
	cmp	w2, #0
	csel	w24, wzr, w8, eq
	cbz	w2, LBB0_8
; %bb.1:
	mov	x0, x2
	bl	_fls
	sub	w21, w0, #1
	cmp	w20, #130
	b.eq	LBB0_9
LBB0_2:
	cmp	w20, #128
	b.ne	LBB0_24
; %bb.3:
	cmp	w24, #2
	b.hi	LBB0_11
; %bb.4:
	cmp	w21, #3
	b.ge	LBB0_11
; %bb.5:
Lloh0:
	adrp	x8, _PPSMC_MSG_SetHardMinGfxClk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PPSMC_MSG_SetHardMinGfxClk@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	cmp	w24, #1
	b.eq	LBB0_13
; %bb.6:
	cmp	w24, #2
	b.ne	LBB0_14
; %bb.7:
	ldrsw	x8, [x22]
	b	LBB0_15
LBB0_8:
	mov	w21, #0
	cmp	w20, #130
	b.ne	LBB0_2
LBB0_9:
	ldr	w8, [x23, #8]
	cmp	w24, w8
	ccmp	w21, w8, #0, lt
	b.ge	LBB0_12
; %bb.10:
Lloh3:
	adrp	x8, _PPSMC_MSG_SetHardMinFclkByFreq@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPSMC_MSG_SetHardMinFclkByFreq@GOTPAGEOFF]
	ldr	x9, [x23]
	ldrsw	x9, [x9, w24, uxtw #2]
Lloh5:
	ldr	w1, [x8]
	mov	w20, #34079
	movk	w20, #20971, lsl #16
	mul	x8, x9, x20
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w2, w8, w9
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
Lloh6:
	adrp	x8, _PPSMC_MSG_SetSoftMaxFclkByFreq@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_SetSoftMaxFclkByFreq@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x8, [x23]
	ldrsw	x8, [x8, w21, sxtw #2]
	mul	x8, x8, x20
	b	LBB0_22
LBB0_11:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_12:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_25
LBB0_13:
Lloh14:
	adrp	x8, _SMU10_UMD_PSTATE_GFXCLK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SMU10_UMD_PSTATE_GFXCLK@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	b	LBB0_16
LBB0_14:
	ldrsw	x8, [x22, #4]
LBB0_15:
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w2, w8, w9
LBB0_16:
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
Lloh17:
	adrp	x8, _PPSMC_MSG_SetSoftMaxGfxClk@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PPSMC_MSG_SetSoftMaxGfxClk@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	cmp	w21, #1
	b.eq	LBB0_19
; %bb.17:
	cbnz	w21, LBB0_20
; %bb.18:
	ldrsw	x8, [x22, #4]
	b	LBB0_21
LBB0_19:
Lloh20:
	adrp	x8, _SMU10_UMD_PSTATE_GFXCLK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SMU10_UMD_PSTATE_GFXCLK@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	b	LBB0_23
LBB0_20:
	ldrsw	x8, [x22]
LBB0_21:
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
LBB0_22:
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w2, w8, w9
LBB0_23:
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
LBB0_24:
	mov	w0, #0
LBB0_25:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Currently sclk only support 3 levels on RV\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PPSMC_MSG_SetHardMinGfxClk,4,2 ; @PPSMC_MSG_SetHardMinGfxClk
	.comm	_SMU10_UMD_PSTATE_GFXCLK,4,2    ; @SMU10_UMD_PSTATE_GFXCLK
	.comm	_PPSMC_MSG_SetSoftMaxGfxClk,4,2 ; @PPSMC_MSG_SetSoftMaxGfxClk
	.comm	_PPSMC_MSG_SetHardMinFclkByFreq,4,2 ; @PPSMC_MSG_SetHardMinFclkByFreq
	.comm	_PPSMC_MSG_SetSoftMaxFclkByFreq,4,2 ; @PPSMC_MSG_SetSoftMaxFclkByFreq
	.no_dead_strip	_smu10_force_clock_level
.subsections_via_symbols
