	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si_enable_gfx_cgpg
_si_enable_gfx_cgpg:                    ## @si_enable_gfx_cgpg
	.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_PG_SUPPORT_GFX_PG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_3
## %bb.2:
	movl	$16, %edi
	callq	_RLC_PUD
	movl	%eax, %r14d
	movl	$16, %edi
	callq	_RLC_PDD
	orl	%eax, %r14d
	movl	$16, %edi
	callq	_RLC_TTPD
	movl	%eax, %ebx
	movl	$16, %edi
	callq	_RLC_MSD
	orl	%eax, %ebx
	orl	%r14d, %ebx
	movq	_RLC_TTOP_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_WREG32
	movq	_RLC_PG_CNTL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32
	movq	_GFX_PG_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_WREG32
	movq	_RLC_AUTO_PG_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32
	movq	_AUTO_PG_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %edi
	movl	%eax, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_WREG32                         ## TAILCALL
LBB0_3:
	movq	_RLC_AUTO_PG_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_RREG32
	movq	_AUTO_PG_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movl	(%rbx), %edi
	callq	_WREG32
	movq	_DB_RENDER_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_RREG32                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_PG_SUPPORT_GFX_PG,4,2   ## @RADEON_PG_SUPPORT_GFX_PG
	.comm	_RLC_TTOP_D,4,2                 ## @RLC_TTOP_D
	.comm	_RLC_PG_CNTL,4,2                ## @RLC_PG_CNTL
	.comm	_GFX_PG_ENABLE,4,2              ## @GFX_PG_ENABLE
	.comm	_RLC_AUTO_PG_CTRL,4,2           ## @RLC_AUTO_PG_CTRL
	.comm	_AUTO_PG_EN,4,2                 ## @AUTO_PG_EN
	.comm	_DB_RENDER_CONTROL,4,2          ## @DB_RENDER_CONTROL
	.no_dead_strip	_si_enable_gfx_cgpg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si_enable_gfx_cgpg
_si_enable_gfx_cgpg:                    ; @si_enable_gfx_cgpg
	.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_PG_SUPPORT_GFX_PG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_PG_SUPPORT_GFX_PG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	w0, #16
	bl	_RLC_PUD
	mov	x19, x0
	mov	w0, #16
	bl	_RLC_PDD
	orr	w19, w0, w19
	mov	w0, #16
	bl	_RLC_TTPD
	orr	w19, w19, w0
	mov	w0, #16
	bl	_RLC_MSD
	orr	w1, w19, w0
Lloh3:
	adrp	x8, _RLC_TTOP_D@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RLC_TTOP_D@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_WREG32
Lloh6:
	adrp	x19, _RLC_PG_CNTL@GOTPAGE
Lloh7:
	ldr	x19, [x19, _RLC_PG_CNTL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32
Lloh8:
	adrp	x8, _GFX_PG_ENABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFX_PG_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w0, [x19]
	bl	_WREG32
Lloh11:
	adrp	x19, _RLC_AUTO_PG_CTRL@GOTPAGE
Lloh12:
	ldr	x19, [x19, _RLC_AUTO_PG_CTRL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32
Lloh13:
	adrp	x8, _AUTO_PG_EN@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AUTO_PG_EN@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_WREG32
LBB0_3:
Lloh16:
	adrp	x19, _RLC_AUTO_PG_CTRL@GOTPAGE
Lloh17:
	ldr	x19, [x19, _RLC_AUTO_PG_CTRL@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_RREG32
Lloh18:
	adrp	x8, _AUTO_PG_EN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AUTO_PG_EN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	bic	w1, w0, w8
	ldr	w0, [x19]
	bl	_WREG32
Lloh21:
	adrp	x8, _DB_RENDER_CONTROL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DB_RENDER_CONTROL@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_RREG32
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_PG_SUPPORT_GFX_PG,4,2   ; @RADEON_PG_SUPPORT_GFX_PG
	.comm	_RLC_TTOP_D,4,2                 ; @RLC_TTOP_D
	.comm	_RLC_PG_CNTL,4,2                ; @RLC_PG_CNTL
	.comm	_GFX_PG_ENABLE,4,2              ; @GFX_PG_ENABLE
	.comm	_RLC_AUTO_PG_CTRL,4,2           ; @RLC_AUTO_PG_CTRL
	.comm	_AUTO_PG_EN,4,2                 ; @AUTO_PG_EN
	.comm	_DB_RENDER_CONTROL,4,2          ; @DB_RENDER_CONTROL
	.no_dead_strip	_si_enable_gfx_cgpg
.subsections_via_symbols
