	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si_enable_uvd_mgcg
_si_enable_uvd_mgcg:                    ## @si_enable_uvd_mgcg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testl	%esi, %esi
	je	LBB0_3
## %bb.1:
	movq	_RADEON_CG_SUPPORT_UVD_MGCG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_3
## %bb.2:
	movq	_UVD_CGC_MEM_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32_UVD_CTX
	orl	$16383, %eax                    ## imm = 0x3FFF
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_WREG32_UVD_CTX
	movq	_UVD_CGC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_DCM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	%eax, %esi
	xorl	%ebx, %ebx
	cmpl	%esi, %eax
	jne	LBB0_5
	jmp	LBB0_6
LBB0_3:
	movq	_UVD_CGC_MEM_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32_UVD_CTX
	andl	$-16384, %eax                   ## imm = 0xC000
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_WREG32_UVD_CTX
	movq	_UVD_CGC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_DCM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	$-1, %ebx
	cmpl	%esi, %eax
	je	LBB0_6
LBB0_5:
	movq	_UVD_CGC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_WREG32
LBB0_6:
	movq	_SMC_CG_IND_START@GOTPCREL(%rip), %r14
	movq	_CG_CGTT_LOCAL_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	%ebx, %esi
	callq	_WREG32_SMC
	movq	_CG_CGTT_LOCAL_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_WREG32_SMC                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CG_SUPPORT_UVD_MGCG,4,2 ## @RADEON_CG_SUPPORT_UVD_MGCG
	.comm	_UVD_CGC_MEM_CTRL,4,2           ## @UVD_CGC_MEM_CTRL
	.comm	_UVD_CGC_CTRL,4,2               ## @UVD_CGC_CTRL
	.comm	_DCM,4,2                        ## @DCM
	.comm	_SMC_CG_IND_START,8,3           ## @SMC_CG_IND_START
	.comm	_CG_CGTT_LOCAL_0,8,3            ## @CG_CGTT_LOCAL_0
	.comm	_CG_CGTT_LOCAL_1,8,3            ## @CG_CGTT_LOCAL_1
	.no_dead_strip	_si_enable_uvd_mgcg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si_enable_uvd_mgcg
_si_enable_uvd_mgcg:                    ; @si_enable_uvd_mgcg
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	w1, LBB0_3
; %bb.1:
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _RADEON_CG_SUPPORT_UVD_MGCG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_CG_SUPPORT_UVD_MGCG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
Lloh3:
	adrp	x19, _UVD_CGC_MEM_CTRL@GOTPAGE
Lloh4:
	ldr	x19, [x19, _UVD_CGC_MEM_CTRL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32_UVD_CTX
	orr	w1, w0, #0x3fff
	ldr	w0, [x19]
	bl	_WREG32_UVD_CTX
Lloh5:
	adrp	x8, _UVD_CGC_CTRL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _UVD_CGC_CTRL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_RREG32
	mov	w19, #0
Lloh8:
	adrp	x8, _DCM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DCM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w1, w8, w0
	cmp	w0, w1
	b.ne	LBB0_4
	b	LBB0_5
LBB0_3:
Lloh11:
	adrp	x19, _UVD_CGC_MEM_CTRL@GOTPAGE
Lloh12:
	ldr	x19, [x19, _UVD_CGC_MEM_CTRL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32_UVD_CTX
	and	w1, w0, #0xffffc000
	ldr	w0, [x19]
	bl	_WREG32_UVD_CTX
Lloh13:
	adrp	x8, _UVD_CGC_CTRL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _UVD_CGC_CTRL@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_RREG32
Lloh16:
	adrp	x8, _DCM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DCM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	bic	w1, w0, w8
	mov	w19, #-1
	cmp	w0, w1
	b.eq	LBB0_5
LBB0_4:
Lloh19:
	adrp	x8, _UVD_CGC_CTRL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UVD_CGC_CTRL@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_WREG32
LBB0_5:
Lloh22:
	adrp	x20, _SMC_CG_IND_START@GOTPAGE
Lloh23:
	ldr	x20, [x20, _SMC_CG_IND_START@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh24:
	adrp	x9, _CG_CGTT_LOCAL_0@GOTPAGE
Lloh25:
	ldr	x9, [x9, _CG_CGTT_LOCAL_0@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x0, x9, x8
	mov	x1, x19
	bl	_WREG32_SMC
	ldr	x8, [x20]
Lloh27:
	adrp	x9, _CG_CGTT_LOCAL_1@GOTPAGE
Lloh28:
	ldr	x9, [x9, _CG_CGTT_LOCAL_1@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x0, x9, x8
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_WREG32_SMC
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CG_SUPPORT_UVD_MGCG,4,2 ; @RADEON_CG_SUPPORT_UVD_MGCG
	.comm	_UVD_CGC_MEM_CTRL,4,2           ; @UVD_CGC_MEM_CTRL
	.comm	_UVD_CGC_CTRL,4,2               ; @UVD_CGC_CTRL
	.comm	_DCM,4,2                        ; @DCM
	.comm	_SMC_CG_IND_START,8,3           ; @SMC_CG_IND_START
	.comm	_CG_CGTT_LOCAL_0,8,3            ; @CG_CGTT_LOCAL_0
	.comm	_CG_CGTT_LOCAL_1,8,3            ; @CG_CGTT_LOCAL_1
	.no_dead_strip	_si_enable_uvd_mgcg
.subsections_via_symbols
