	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_update_acp_dpm
_kv_update_acp_dpm:                     ## @kv_update_acp_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
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_kv_get_pi
	testl	%r14d, %r14d
	je	LBB0_1
LBB0_7:
	xorl	%esi, %esi
	testl	%r14d, %r14d
	sete	%sil
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kv_enable_acp_dpm              ## TAILCALL
LBB0_1:
	movq	%rax, %rbx
	cmpq	$0, 8(%rax)
	je	LBB0_3
## %bb.2:
	movl	(%r15), %eax
	decl	%eax
	jmp	LBB0_4
LBB0_3:
	movq	%r15, %rdi
	callq	_kv_get_acp_boot_level
LBB0_4:
	movl	%eax, (%rbx)
	movq	24(%rbx), %r12
	movq	_SMU7_Fusion_DpmTable@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_AcpBootLevel@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	addq	%rax, %r12
	movl	16(%rbx), %r8d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	movl	$4, %ecx
	callq	_amdgpu_kv_copy_bytes_to_smc
	testl	%eax, %eax
	je	LBB0_5
## %bb.8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpq	$0, 8(%rbx)
	je	LBB0_7
## %bb.6:
	movq	_PPSMC_MSG_ACPDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	(%rbx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movq	%r15, %rdi
	callq	_amdgpu_kv_send_msg_to_smc_with_parameter
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_SMU7_Fusion_DpmTable,4,2       ## @SMU7_Fusion_DpmTable
	.comm	_AcpBootLevel,4,2               ## @AcpBootLevel
	.comm	_PPSMC_MSG_ACPDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_ACPDPM_SetEnabledMask
	.no_dead_strip	_kv_update_acp_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_acp_dpm
_kv_update_acp_dpm:                     ; @kv_update_acp_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	x20, x1
	mov	x19, x0
	bl	_kv_get_pi
	cbz	w20, LBB0_2
LBB0_1:
	cmp	w20, #0
	cset	w1, eq
	mov	x0, x19
	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
	b	_kv_enable_acp_dpm
LBB0_2:
	mov	x21, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	sub	w0, w8, #1
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_kv_get_acp_boot_level
LBB0_5:
	str	w0, [x21]
	ldr	x22, [x21, #24]
Lloh0:
	adrp	x8, _SMU7_Fusion_DpmTable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU7_Fusion_DpmTable@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _AcpBootLevel@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AcpBootLevel@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_offsetof
	add	x1, x0, x22
	ldr	w4, [x21, #16]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #4
	bl	_amdgpu_kv_copy_bytes_to_smc
	cbz	w0, LBB0_7
; %bb.6:
	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_7:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_1
; %bb.8:
Lloh6:
	adrp	x8, _PPSMC_MSG_ACPDPM_SetEnabledMask@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_ACPDPM_SetEnabledMask@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w8, [x21]
	mov	w9, #1
	lsl	w2, w9, w8
	mov	x0, x19
	bl	_amdgpu_kv_send_msg_to_smc_with_parameter
	b	LBB0_1
	.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	_AcpBootLevel,4,2               ; @AcpBootLevel
	.comm	_PPSMC_MSG_ACPDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_ACPDPM_SetEnabledMask
	.no_dead_strip	_kv_update_acp_dpm
.subsections_via_symbols
