	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vega10_set_power_profile_mode
_vega10_set_power_profile_mode:         ## @vega10_set_power_profile_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	(%rsi,%rdx,8), %rbx
	movq	_PP_SMC_POWER_PROFILE_CUSTOM@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_6
## %bb.1:
	testq	$-5, %rdx
	je	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_3:
	movq	8(%r14), %rax
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.5:
	movl	(%rsi), %r8d
	movq	(%rax), %rax
	movl	%r8d, (%rax)
	movl	8(%rsi), %edi
	movl	%edi, 4(%rax)
	movl	16(%rsi), %ecx
	movl	%ecx, 8(%rax)
	movl	24(%rsi), %edx
	movl	%edx, 12(%rax)
	movq	_PPSMC_MSG_SetCustomGfxDpmParameters@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shll	$8, %edi
	orl	%r8d, %edi
	shll	$16, %ecx
	shll	$24, %edx
	orl	%ecx, %edx
	orl	%edi, %edx
	movq	%r14, %rdi
	callq	_smum_send_msg_to_smc_with_parameter
	jmp	LBB0_6
LBB0_4:
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_2
LBB0_6:
	movq	_PPSMC_MSG_SetWorkloadMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_smum_send_msg_to_smc_with_parameter
	movq	%rbx, (%r14)
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ## @PP_SMC_POWER_PROFILE_CUSTOM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PPSMC_MSG_SetCustomGfxDpmParameters,4,2 ## @PPSMC_MSG_SetCustomGfxDpmParameters
	.comm	_PPSMC_MSG_SetWorkloadMask,4,2  ## @PPSMC_MSG_SetWorkloadMask
	.no_dead_strip	_vega10_set_power_profile_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vega10_set_power_profile_mode
_vega10_set_power_profile_mode:         ; @vega10_set_power_profile_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x1, x2, lsl #3]
Lloh0:
	adrp	x8, _PP_SMC_POWER_PROFILE_CUSTOM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PP_SMC_POWER_PROFILE_CUSTOM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x20, x8
	b.ne	LBB0_6
; %bb.1:
	tst	x2, #0xfffffffffffffffb
	b.eq	LBB0_3
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_3:
	ldr	x8, [x19, #8]
	cbz	x2, LBB0_5
; %bb.4:
	ldr	w9, [x1]
	ldr	x8, [x8]
	ldr	w10, [x1, #8]
	stp	w9, w10, [x8]
	ldr	w11, [x1, #16]
	ldr	w12, [x1, #24]
	stp	w11, w12, [x8, #8]
Lloh6:
	adrp	x8, _PPSMC_MSG_SetCustomGfxDpmParameters@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_SetCustomGfxDpmParameters@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	orr	w8, w9, w10, lsl #8
	orr	w8, w8, w11, lsl #16
	orr	w2, w8, w12, lsl #24
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
	b	LBB0_6
LBB0_5:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_2
LBB0_6:
Lloh9:
	adrp	x8, _PPSMC_MSG_SetWorkloadMask@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PPSMC_MSG_SetWorkloadMask@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w8, #1
	lsl	w2, w8, w20
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
	mov	w0, #0
	str	x20, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ; @PP_SMC_POWER_PROFILE_CUSTOM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PPSMC_MSG_SetCustomGfxDpmParameters,4,2 ; @PPSMC_MSG_SetCustomGfxDpmParameters
	.comm	_PPSMC_MSG_SetWorkloadMask,4,2  ; @PPSMC_MSG_SetWorkloadMask
	.no_dead_strip	_vega10_set_power_profile_mode
.subsections_via_symbols
