	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kv_dpm_powergate_uvd           ## -- Begin function kv_dpm_powergate_uvd
	.p2align	4, 0x90
_kv_dpm_powergate_uvd:                  ## @kv_dpm_powergate_uvd
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_kv_get_pi
	cmpl	%r15d, (%rax)
	jne	LBB0_1
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rax, %rbx
	movl	%r15d, (%rax)
	movq	8(%rax), %rax
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.2:
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_uvd_v1_0_stop
	movq	_RADEON_CG_BLOCK_UVD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_cik_update_cg
LBB0_4:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_kv_update_uvd_dpm
	cmpq	$0, 8(%rbx)
	je	LBB0_9
## %bb.5:
	movq	_PPSMC_MSG_UVDPowerOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kv_notify_message_to_smu       ## TAILCALL
LBB0_6:
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_PPSMC_MSG_UVDPowerON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_kv_notify_message_to_smu
	movq	%r14, %rdi
	callq	_uvd_v4_2_resume
	movq	%r14, %rdi
	callq	_uvd_v1_0_start
	movq	_RADEON_CG_BLOCK_UVD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_cik_update_cg
LBB0_8:
	movq	%r14, %rdi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kv_update_uvd_dpm              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CG_BLOCK_UVD,4,2        ## @RADEON_CG_BLOCK_UVD
	.comm	_PPSMC_MSG_UVDPowerOFF,4,2      ## @PPSMC_MSG_UVDPowerOFF
	.comm	_PPSMC_MSG_UVDPowerON,4,2       ## @PPSMC_MSG_UVDPowerON
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kv_dpm_powergate_uvd           ; -- Begin function kv_dpm_powergate_uvd
	.p2align	2
_kv_dpm_powergate_uvd:                  ; @kv_dpm_powergate_uvd
	.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
	ldr	w8, [x0]
	cmp	w8, w20
	b.ne	LBB0_2
LBB0_1:
	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_2:
	mov	x21, x0
	str	w20, [x0]
	ldr	x8, [x0, #8]
	cbz	w20, LBB0_7
; %bb.3:
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_uvd_v1_0_stop
Lloh0:
	adrp	x8, _RADEON_CG_BLOCK_UVD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADEON_CG_BLOCK_UVD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_cik_update_cg
LBB0_5:
	mov	x0, x19
	mov	x1, x20
	bl	_kv_update_uvd_dpm
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_1
; %bb.6:
Lloh3:
	adrp	x8, _PPSMC_MSG_UVDPowerOFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PPSMC_MSG_UVDPowerOFF@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	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_notify_message_to_smu
LBB0_7:
	cbz	x8, LBB0_9
; %bb.8:
Lloh6:
	adrp	x8, _PPSMC_MSG_UVDPowerON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPSMC_MSG_UVDPowerON@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kv_notify_message_to_smu
	mov	x0, x19
	bl	_uvd_v4_2_resume
	mov	x0, x19
	bl	_uvd_v1_0_start
Lloh9:
	adrp	x8, _RADEON_CG_BLOCK_UVD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_CG_BLOCK_UVD@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_cik_update_cg
LBB0_9:
	mov	x0, x19
	mov	w1, #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
	b	_kv_update_uvd_dpm
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CG_BLOCK_UVD,4,2        ; @RADEON_CG_BLOCK_UVD
	.comm	_PPSMC_MSG_UVDPowerOFF,4,2      ; @PPSMC_MSG_UVDPowerOFF
	.comm	_PPSMC_MSG_UVDPowerON,4,2       ; @PPSMC_MSG_UVDPowerON
.subsections_via_symbols
