	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_update_uvd_dpm
_kv_update_uvd_dpm:                     ## @kv_update_uvd_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	%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
	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
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kv_enable_uvd_dpm              ## TAILCALL
LBB0_1:
	movq	%rax, %rbx
	movl	(%r15), %ecx
	xorl	%eax, %eax
	subl	$1, %ecx
	cmovbl	%eax, %ecx
	movl	%ecx, (%rbx)
	cmpl	$0, 24(%rbx)
	je	LBB0_4
## %bb.2:
	cmpq	$0, 16(%rbx)
	je	LBB0_3
LBB0_4:
	movl	$1, %r12d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	jmp	LBB0_5
LBB0_3:
	movl	$31, %r12d
LBB0_5:
	movq	8(%rbx), %r13
	movq	_SMU7_Fusion_DpmTable@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_UvdBootLevel@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	addq	%rax, %r13
	movl	4(%rbx), %r8d
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	movl	$4, %ecx
	callq	_amdgpu_kv_copy_bytes_to_smc
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	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	_UvdBootLevel,4,2               ## @UvdBootLevel
	.comm	_PPSMC_MSG_UVDDPM_SetEnabledMask,4,2 ## @PPSMC_MSG_UVDDPM_SetEnabledMask
	.no_dead_strip	_kv_update_uvd_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_uvd_dpm
_kv_update_uvd_dpm:                     ; @kv_update_uvd_dpm
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	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, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_kv_enable_uvd_dpm
LBB0_2:
	mov	x21, x0
	ldr	w8, [x19]
	sub	w9, w8, #1
	cmp	w8, #0
	csel	w8, wzr, w9, eq
	str	w8, [x0]
	ldr	w9, [x0, #24]
	cbz	w9, LBB0_4
; %bb.3:
	ldr	x9, [x21, #16]
	cbz	x9, LBB0_5
LBB0_4:
	mov	w9, #1
	lsl	w22, w9, w8
	b	LBB0_6
LBB0_5:
	mov	w22, #31
LBB0_6:
	ldr	x23, [x21, #8]
Lloh0:
	adrp	x8, _SMU7_Fusion_DpmTable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SMU7_Fusion_DpmTable@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _UvdBootLevel@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UvdBootLevel@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_offsetof
	add	x1, x0, x23
	ldr	w4, [x21, #4]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #4
	bl	_amdgpu_kv_copy_bytes_to_smc
	cbz	w0, LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh6:
	adrp	x8, _PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_UVDDPM_SetEnabledMask@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	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	_UvdBootLevel,4,2               ; @UvdBootLevel
	.comm	_PPSMC_MSG_UVDDPM_SetEnabledMask,4,2 ; @PPSMC_MSG_UVDDPM_SetEnabledMask
	.no_dead_strip	_kv_update_uvd_dpm
.subsections_via_symbols
