	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_update_vce_dpm
_kv_update_vce_dpm:                     ## @kv_update_vce_dpm
	.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	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_kv_get_pi
	movq	(%rbx), %rsi
	xorl	%ebx, %ebx
	testq	%rsi, %rsi
	jle	LBB0_9
## %bb.1:
	cmpq	$0, (%r12)
	jne	LBB0_12
## %bb.2:
	movq	%rax, %r15
	cmpq	$0, 8(%rax)
	je	LBB0_4
## %bb.3:
	movl	(%r14), %eax
	decl	%eax
	jmp	LBB0_5
LBB0_9:
	testq	%rsi, %rsi
	jne	LBB0_12
## %bb.10:
	xorl	%ebx, %ebx
	cmpq	$0, (%r12)
	jg	LBB0_11
	jmp	LBB0_12
LBB0_4:
	movq	%r14, %rdi
	callq	_kv_get_vce_boot_level
LBB0_5:
	movl	%eax, (%r15)
	movq	24(%r15), %rbx
	movq	_SMU7_Fusion_DpmTable@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VceBootLevel@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	addq	%rax, %rbx
	movl	16(%r15), %r8d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	$4, %ecx
	callq	_amdgpu_kv_copy_bytes_to_smc
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.6:
	cmpq	$0, 8(%r15)
	je	LBB0_7
## %bb.8:
	movq	_PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	(%r15), %cl
	movl	$1, %ebx
	movl	$1, %edx
	shll	%cl, %edx
	movq	%r14, %rdi
	callq	_amdgpu_kv_send_msg_to_smc_with_parameter
	jmp	LBB0_11
LBB0_7:
	movl	$1, %ebx
LBB0_11:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_kv_enable_vce_dpm
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU7_Fusion_DpmTable,4,2       ## @SMU7_Fusion_DpmTable
	.comm	_VceBootLevel,4,2               ## @VceBootLevel
	.comm	_PPSMC_MSG_VCEDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_VCEDPM_SetEnabledMask
	.no_dead_strip	_kv_update_vce_dpm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kv_update_vce_dpm
_kv_update_vce_dpm:                     ; @kv_update_vce_dpm
	.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	x22, x2
	mov	x21, x1
	mov	x19, x0
	bl	_kv_get_pi
	ldr	x1, [x21]
	cmp	x1, #1
	b.lt	LBB0_4
; %bb.1:
	ldr	x8, [x22]
	cbnz	x8, LBB0_11
; %bb.2:
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	w8, [x19]
	sub	w0, w8, #1
	b	LBB0_7
LBB0_4:
	cbnz	x1, LBB0_11
; %bb.5:
	mov	w21, #0
	mov	w0, #0
	ldr	x8, [x22]
	cmp	x8, #1
	b.ge	LBB0_10
	b	LBB0_12
LBB0_6:
	mov	x0, x19
	bl	_kv_get_vce_boot_level
LBB0_7:
	str	w0, [x20]
	ldr	x21, [x20, #24]
Lloh0:
	adrp	x8, _SMU7_Fusion_DpmTable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU7_Fusion_DpmTable@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _VceBootLevel@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VceBootLevel@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_offsetof
	add	x1, x0, x21
	ldr	w4, [x20, #16]
	mov	x0, x19
	mov	x2, x20
	mov	w3, #4
	bl	_amdgpu_kv_copy_bytes_to_smc
	cbnz	w0, LBB0_12
; %bb.8:
	ldr	x8, [x20, #8]
	mov	w21, #1
	cbz	x8, LBB0_10
; %bb.9:
Lloh6:
	adrp	x8, _PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_VCEDPM_SetEnabledMask@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w8, [x20]
	lsl	w2, w21, w8
	mov	x0, x19
	bl	_amdgpu_kv_send_msg_to_smc_with_parameter
LBB0_10:
	mov	x0, x19
	mov	x1, x21
	bl	_kv_enable_vce_dpm
LBB0_11:
	mov	w0, #0
LBB0_12:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_SMU7_Fusion_DpmTable,4,2       ; @SMU7_Fusion_DpmTable
	.comm	_VceBootLevel,4,2               ; @VceBootLevel
	.comm	_PPSMC_MSG_VCEDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_VCEDPM_SetEnabledMask
	.no_dead_strip	_kv_update_vce_dpm
.subsections_via_symbols
