	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega20_set_od_percentage
_vega20_set_od_percentage:              ## @vega20_set_od_percentage
	.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
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_mutex_lock
	movq	16(%r12), %r13
	movq	24(%r12), %rax
	cmpl	$129, %ebx
	je	LBB0_4
## %bb.1:
	cmpl	$128, %ebx
	jne	LBB0_3
## %bb.2:
	addq	$16, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	$16, %r13
	movq	_OD8_SETTING_GFXCLK_FMAX@GOTPCREL(%rip), %rbx
	movq	_PPCLK_GFXCLK@GOTPCREL(%rip), %r14
	movq	_SMU_FEATURE_DPM_GFXCLK_BIT@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_OD8_SETTING_UCLK_FMAX@GOTPCREL(%rip), %rbx
	movq	_PPCLK_UCLK@GOTPCREL(%rip), %r14
	movq	_SMU_FEATURE_DPM_UCLK_BIT@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_smu_feature_is_enabled
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %esi
	movl	(%r14), %r14d
	movq	8(%r13), %rax
	movslq	(%r13), %rcx
	movl	-4(%rax,%rcx,4), %eax
	imull	%eax, %r15d
	movslq	%r15d, %rcx
	imulq	$1374389535, %rcx, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rcx
	shrq	$63, %rcx
	sarq	$37, %rdx
	addl	%ecx, %edx
	addl	%eax, %edx
	movq	%r12, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_vega20_update_od8_settings
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_12
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_7:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.8:
	movq	%r12, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_vega20_set_single_dpm_table
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
	jmp	LBB0_12
LBB0_10:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, (%rdx)
	movslq	4(%r12), %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movq	8(%rdx), %rcx
	movl	%eax, (%rcx)
LBB0_11:
	movl	8(%r12), %esi
	movq	_AMD_PP_TASK_READJUST_POWER_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_smu_handle_task
	movl	%eax, %ebx
LBB0_12:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU_FEATURE_DPM_GFXCLK_BIT,4,2 ## @SMU_FEATURE_DPM_GFXCLK_BIT
	.comm	_PPCLK_GFXCLK,4,2               ## @PPCLK_GFXCLK
	.comm	_OD8_SETTING_GFXCLK_FMAX,4,2    ## @OD8_SETTING_GFXCLK_FMAX
	.comm	_SMU_FEATURE_DPM_UCLK_BIT,4,2   ## @SMU_FEATURE_DPM_UCLK_BIT
	.comm	_PPCLK_UCLK,4,2                 ## @PPCLK_UCLK
	.comm	_OD8_SETTING_UCLK_FMAX,4,2      ## @OD8_SETTING_UCLK_FMAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Setoverdrive] failed to set od clk!\n"

L_.str.1:                               ## @.str.1
	.asciz	"[Setoverdrive] failed to refresh dpm table!\n"

	.comm	_AMD_PP_TASK_READJUST_POWER_STATE,4,2 ## @AMD_PP_TASK_READJUST_POWER_STATE
	.no_dead_strip	_vega20_set_od_percentage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vega20_set_od_percentage
_vega20_set_od_percentage:              ; @vega20_set_od_percentage
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_mutex_lock
	ldp	x24, x20, [x19, #16]
	cmp	w22, #129
	b.eq	LBB0_3
; %bb.1:
	cmp	w22, #128
	b.ne	LBB0_6
; %bb.2:
	add	x20, x20, #16
	add	x24, x24, #16
Lloh0:
	adrp	x22, _OD8_SETTING_GFXCLK_FMAX@GOTPAGE
Lloh1:
	ldr	x22, [x22, _OD8_SETTING_GFXCLK_FMAX@GOTPAGEOFF]
Lloh2:
	adrp	x25, _PPCLK_GFXCLK@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PPCLK_GFXCLK@GOTPAGEOFF]
Lloh4:
	adrp	x8, _SMU_FEATURE_DPM_GFXCLK_BIT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SMU_FEATURE_DPM_GFXCLK_BIT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh6:
	adrp	x22, _OD8_SETTING_UCLK_FMAX@GOTPAGE
Lloh7:
	ldr	x22, [x22, _OD8_SETTING_UCLK_FMAX@GOTPAGEOFF]
Lloh8:
	adrp	x25, _PPCLK_UCLK@GOTPAGE
Lloh9:
	ldr	x25, [x25, _PPCLK_UCLK@GOTPAGEOFF]
Lloh10:
	adrp	x8, _SMU_FEATURE_DPM_UCLK_BIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SMU_FEATURE_DPM_UCLK_BIT@GOTPAGEOFF]
LBB0_4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_smu_feature_is_enabled
	mov	x23, x0
	ldr	w1, [x22]
	ldr	w22, [x25]
	ldr	x8, [x24, #8]
	ldrsw	x9, [x24]
	add	x8, x8, x9, lsl #2
	ldur	w8, [x8, #-4]
	mul	w9, w8, w21
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	add	w2, w9, w8
	mov	x0, x19
	bl	_vega20_update_od8_settings
	cbz	w0, LBB0_7
; %bb.5:
	mov	x21, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_12
LBB0_6:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_12
LBB0_7:
	cbz	w23, LBB0_10
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_vega20_set_single_dpm_table
	cbz	w0, LBB0_11
; %bb.9:
	mov	x21, x0
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
	b	LBB0_12
LBB0_10:
	mov	w8, #1
	str	w8, [x20]
	ldrsw	x8, [x19, #4]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	ldr	x9, [x20, #8]
	str	w8, [x9]
LBB0_11:
	ldr	w1, [x19, #8]
Lloh19:
	adrp	x8, _AMD_PP_TASK_READJUST_POWER_STATE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AMD_PP_TASK_READJUST_POWER_STATE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_smu_handle_task
	mov	x21, x0
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU_FEATURE_DPM_GFXCLK_BIT,4,2 ; @SMU_FEATURE_DPM_GFXCLK_BIT
	.comm	_PPCLK_GFXCLK,4,2               ; @PPCLK_GFXCLK
	.comm	_OD8_SETTING_GFXCLK_FMAX,4,2    ; @OD8_SETTING_GFXCLK_FMAX
	.comm	_SMU_FEATURE_DPM_UCLK_BIT,4,2   ; @SMU_FEATURE_DPM_UCLK_BIT
	.comm	_PPCLK_UCLK,4,2                 ; @PPCLK_UCLK
	.comm	_OD8_SETTING_UCLK_FMAX,4,2      ; @OD8_SETTING_UCLK_FMAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Setoverdrive] failed to set od clk!\n"

l_.str.1:                               ; @.str.1
	.asciz	"[Setoverdrive] failed to refresh dpm table!\n"

	.comm	_AMD_PP_TASK_READJUST_POWER_STATE,4,2 ; @AMD_PP_TASK_READJUST_POWER_STATE
	.no_dead_strip	_vega20_set_od_percentage
.subsections_via_symbols
