	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arcturus_set_power_profile_mode
_arcturus_set_power_profile_mode:       ## @arcturus_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 8(%rdi)
	je	LBB0_1
## %bb.2:
	movq	(%rsi,%rdx,8), %r14
	movq	_PP_SMC_POWER_PROFILE_CUSTOM@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jbe	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_5:
	movq	%rdi, %r15
	movq	%r14, %rsi
	callq	_smu_workload_get_type
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	%eax, %r12d
	movq	_SMU_MSG_SetWorkloadMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	movl	%r12d, %ecx
	shll	%cl, %edx
	movq	%r15, %rdi
	callq	_smu_send_smc_msg_with_param
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	callq	_pr_err
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	movl	%r14d, %esi
	callq	_pr_err
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ## @PP_SMC_POWER_PROFILE_CUSTOM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid power profile mode %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unsupported power profile mode %d on arcturus\n"

	.comm	_SMU_MSG_SetWorkloadMask,4,2    ## @SMU_MSG_SetWorkloadMask
L_.str.2:                               ## @.str.2
	.asciz	"Fail to set workload type %d\n"

	.no_dead_strip	_arcturus_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 arcturus_set_power_profile_mode
_arcturus_set_power_profile_mode:       ; @arcturus_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
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_8
; %bb.1:
	ldr	x19, [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	x19, x8
	b.ls	LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_3:
	mov	x20, x0
	mov	x1, x19
	bl	_smu_workload_get_type
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	x22, x0
Lloh5:
	adrp	x8, _SMU_MSG_SetWorkloadMask@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SMU_MSG_SetWorkloadMask@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w8, #1
	lsl	w2, w8, w0
	mov	x0, x20
	bl	_smu_send_smc_msg_with_param
	mov	x21, x0
	cbz	w0, LBB0_10
; %bb.5:
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	b	LBB0_9
LBB0_6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	mov	x1, x19
	bl	_pr_err
LBB0_8:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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
LBB0_10:
	str	x19, [x20]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PP_SMC_POWER_PROFILE_CUSTOM,8,3 ; @PP_SMC_POWER_PROFILE_CUSTOM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid power profile mode %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unsupported power profile mode %d on arcturus\n"

	.comm	_SMU_MSG_SetWorkloadMask,4,2    ; @SMU_MSG_SetWorkloadMask
l_.str.2:                               ; @.str.2
	.asciz	"Fail to set workload type %d\n"

	.no_dead_strip	_arcturus_set_power_profile_mode
.subsections_via_symbols
