	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smu10_set_power_profile_mode
_smu10_set_power_profile_mode:          ## @smu10_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	%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	%rsi, %r12
	movq	(%rsi,%rdx,8), %rsi
	movq	_PP_SMC_POWER_PROFILE_COMPUTE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jle	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	cmpq	%rsi, (%rdi)
	je	LBB0_12
## %bb.3:
	movq	%rdx, %r15
	movq	%rsi, %rdi
	callq	_conv_power_profile_to_pplib_workload
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	movq	%r14, %rdi
	callq	_smu10_is_raven1_refresh
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	cmpl	$0, 8(%r14)
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_smu10_gfx_off_control
	movl	$1, 8(%r14)
LBB0_7:
	movq	_PPSMC_MSG_ActiveProcessNotify@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	movl	%r13d, %ecx
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_smum_send_msg_to_smc_with_parameter
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	(%r12,%r15,8), %rax
	movq	%rax, (%r14)
LBB0_9:
	testl	%r13d, %r13d
	je	LBB0_12
## %bb.10:
	cmpl	$0, 8(%r14)
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_smu10_gfx_off_control
	movl	$0, 8(%r14)
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PP_SMC_POWER_PROFILE_COMPUTE,8,3 ## @PP_SMC_POWER_PROFILE_COMPUTE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid power profile mode %ld\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PPSMC_MSG_ActiveProcessNotify,4,2 ## @PPSMC_MSG_ActiveProcessNotify
	.no_dead_strip	_smu10_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 smu10_set_power_profile_mode
_smu10_set_power_profile_mode:          ; @smu10_set_power_profile_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x1
	ldr	x1, [x1, x2, lsl #3]
Lloh0:
	adrp	x8, _PP_SMC_POWER_PROFILE_COMPUTE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PP_SMC_POWER_PROFILE_COMPUTE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x1, x8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_2:
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, x1
	b.eq	LBB0_12
; %bb.3:
	mov	x20, x2
	mov	x0, x1
	bl	_conv_power_profile_to_pplib_workload
	mov	x22, x0
	cbz	w0, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_smu10_is_raven1_refresh
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	w1, #0
	bl	_smu10_gfx_off_control
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_7:
Lloh8:
	adrp	x8, _PPSMC_MSG_ActiveProcessNotify@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PPSMC_MSG_ActiveProcessNotify@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w8, #1
	lsl	w2, w8, w22
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
	cbz	w0, LBB0_9
; %bb.8:
	cbnz	w22, LBB0_10
	b	LBB0_12
LBB0_9:
	ldr	x8, [x21, x20, lsl #3]
	str	x8, [x19]
	cbz	w22, LBB0_12
LBB0_10:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_12
; %bb.11:
	mov	x0, x19
	mov	w1, #1
	bl	_smu10_gfx_off_control
	mov	w0, #0
	str	wzr, [x19, #8]
	b	LBB0_13
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PP_SMC_POWER_PROFILE_COMPUTE,8,3 ; @PP_SMC_POWER_PROFILE_COMPUTE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid power profile mode %ld\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PPSMC_MSG_ActiveProcessNotify,4,2 ; @PPSMC_MSG_ActiveProcessNotify
	.no_dead_strip	_smu10_set_power_profile_mode
.subsections_via_symbols
