	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tonga_update_vce_smc_table
_tonga_update_vce_smc_table:            ## @tonga_update_vce_smc_table
	.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
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	16(%rdi), %r15
	movq	(%rax), %rax
	movl	(%rax), %eax
	decl	%eax
	movl	%eax, (%r15)
	movl	4(%r15), %r12d
	movq	_SMU72_Discrete_DpmTable@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VceBootLevel@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rax,%r12), %ebx
	addl	$3, %ebx
                                        ## kill: def $eax killed $eax killed $rax
	addl	%r12d, %eax
	cmovnsl	%eax, %ebx
	andl	$-4, %ebx
	movl	4(%r14), %edi
	movq	_CGS_IND_REG__SMC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%ebx, %edx
	callq	_cgs_read_ind_register
	andl	$-16711681, %eax                ## imm = 0xFF00FFFF
	movl	(%r15), %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	movl	4(%r14), %edi
	movl	(%r12), %esi
	movl	%ebx, %edx
	callq	_cgs_write_ind_register
	movl	(%r14), %edi
	movq	_PHM_PlatformCaps_StablePState@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_phm_cap_enabled
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	(%r15), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_smum_send_msg_to_smc_with_parameter
LBB0_2:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU72_Discrete_DpmTable,4,2    ## @SMU72_Discrete_DpmTable
	.comm	_VceBootLevel,4,2               ## @VceBootLevel
	.comm	_CGS_IND_REG__SMC,4,2           ## @CGS_IND_REG__SMC
	.comm	_PHM_PlatformCaps_StablePState,4,2 ## @PHM_PlatformCaps_StablePState
	.comm	_PPSMC_MSG_VCEDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_VCEDPM_SetEnabledMask
	.no_dead_strip	_tonga_update_vce_smc_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tonga_update_vce_smc_table
_tonga_update_vce_smc_table:            ; @tonga_update_vce_smc_table
	.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	x19, x0
	ldp	x8, x21, [x0, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	sub	w8, w8, #1
	str	w8, [x21]
	ldr	w20, [x21, #4]
Lloh0:
	adrp	x8, _SMU72_Discrete_DpmTable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU72_Discrete_DpmTable@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _VceBootLevel@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VceBootLevel@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_offsetof
	add	w8, w0, w20
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	and	w20, w8, #0xfffffffc
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x22, _CGS_IND_REG__SMC@GOTPAGE
Lloh7:
	ldr	x22, [x22, _CGS_IND_REG__SMC@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, x20
	bl	_cgs_read_ind_register
	and	w8, w0, #0xff00ffff
	ldr	w9, [x21]
	orr	w3, w8, w9, lsl #16
	ldr	w0, [x19, #4]
	ldr	w1, [x22]
	mov	x2, x20
	bl	_cgs_write_ind_register
	ldr	w0, [x19]
Lloh8:
	adrp	x8, _PHM_PlatformCaps_StablePState@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PHM_PlatformCaps_StablePState@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_phm_cap_enabled
	cbz	x0, LBB0_2
; %bb.1:
Lloh11:
	adrp	x8, _PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w8, [x21]
	mov	w9, #1
	lsl	w2, w9, w8
	mov	x0, x19
	bl	_smum_send_msg_to_smc_with_parameter
LBB0_2:
	mov	w0, #0
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU72_Discrete_DpmTable,4,2    ; @SMU72_Discrete_DpmTable
	.comm	_VceBootLevel,4,2               ; @VceBootLevel
	.comm	_CGS_IND_REG__SMC,4,2           ; @CGS_IND_REG__SMC
	.comm	_PHM_PlatformCaps_StablePState,4,2 ; @PHM_PlatformCaps_StablePState
	.comm	_PPSMC_MSG_VCEDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_VCEDPM_SetEnabledMask
	.no_dead_strip	_tonga_update_vce_smc_table
.subsections_via_symbols
