	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rv770_mg_clock_gating_enable
_rv770_mg_clock_gating_enable:          ## @rv770_mg_clock_gating_enable
	.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, %rbx
	callq	_rv770_get_pi
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	_CHIP_RV770@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	_RV770_MGCGTTLOCAL0_DFLT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_CG_CGTT_LOCAL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-1, %esi
	callq	_WREG32
	movq	_CG_CGTT_LOCAL_1@GOTPCREL(%rip), %rax
	movl	$-12289, %esi                   ## imm = 0xCFFF
	jmp	LBB0_7
LBB0_2:
	movq	_RV7XX_MGCGTTLOCAL0_DFLT@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	_CG_CGTT_LOCAL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_WREG32
	movq	_CG_CGTT_LOCAL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_RV770_MGCGTTLOCAL1_DFLT@GOTPCREL(%rip), %rax
	movl	$-12289, %esi                   ## imm = 0xCFFF
	andl	(%rax), %esi
	callq	_WREG32
	cmpq	$0, (%r14)
	je	LBB0_8
## %bb.5:
	movq	_RV770_MGCGCGTSSMCTRL_DFLT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CGTS_SM_CTRL_REG@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_WREG32                         ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_RV770,8,3                 ## @CHIP_RV770
	.comm	_RV770_MGCGTTLOCAL0_DFLT,4,2    ## @RV770_MGCGTTLOCAL0_DFLT
	.comm	_RV7XX_MGCGTTLOCAL0_DFLT,4,2    ## @RV7XX_MGCGTTLOCAL0_DFLT
	.comm	_CG_CGTT_LOCAL_0,4,2            ## @CG_CGTT_LOCAL_0
	.comm	_CG_CGTT_LOCAL_1,4,2            ## @CG_CGTT_LOCAL_1
	.comm	_RV770_MGCGTTLOCAL1_DFLT,4,2    ## @RV770_MGCGTTLOCAL1_DFLT
	.comm	_CGTS_SM_CTRL_REG,4,2           ## @CGTS_SM_CTRL_REG
	.comm	_RV770_MGCGCGTSSMCTRL_DFLT,4,2  ## @RV770_MGCGCGTSSMCTRL_DFLT
	.no_dead_strip	_rv770_mg_clock_gating_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rv770_mg_clock_gating_enable
_rv770_mg_clock_gating_enable:          ; @rv770_mg_clock_gating_enable
	.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	x21, x1
	mov	x20, x0
	bl	_rv770_get_pi
	cbz	w21, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _CHIP_RV770@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CHIP_RV770@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x10, _RV770_MGCGTTLOCAL0_DFLT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _RV770_MGCGTTLOCAL0_DFLT@GOTPAGEOFF]
Lloh5:
	adrp	x11, _RV7XX_MGCGTTLOCAL0_DFLT@GOTPAGE
Lloh6:
	ldr	x11, [x11, _RV7XX_MGCGTTLOCAL0_DFLT@GOTPAGEOFF]
	cmp	x9, x8
	csel	x8, x10, x11, eq
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _CG_CGTT_LOCAL_0@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CG_CGTT_LOCAL_0@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_WREG32
Lloh10:
	adrp	x8, _CG_CGTT_LOCAL_1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CG_CGTT_LOCAL_1@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _RV770_MGCGTTLOCAL1_DFLT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _RV770_MGCGTTLOCAL1_DFLT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	and	w1, w8, #0xffffcfff
	bl	_WREG32
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.2:
Lloh16:
	adrp	x8, _RV770_MGCGCGTSSMCTRL_DFLT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _RV770_MGCGCGTSSMCTRL_DFLT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x8, _CGTS_SM_CTRL_REG@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CGTS_SM_CTRL_REG@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh21:
	adrp	x8, _CG_CGTT_LOCAL_0@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CG_CGTT_LOCAL_0@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	w1, #-1
	bl	_WREG32
Lloh24:
	adrp	x8, _CG_CGTT_LOCAL_1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CG_CGTT_LOCAL_1@GOTPAGEOFF]
	mov	w1, #-12289
LBB0_4:
	ldr	w0, [x8]
	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	_WREG32
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_RV770,8,3                 ; @CHIP_RV770
	.comm	_RV770_MGCGTTLOCAL0_DFLT,4,2    ; @RV770_MGCGTTLOCAL0_DFLT
	.comm	_RV7XX_MGCGTTLOCAL0_DFLT,4,2    ; @RV7XX_MGCGTTLOCAL0_DFLT
	.comm	_CG_CGTT_LOCAL_0,4,2            ; @CG_CGTT_LOCAL_0
	.comm	_CG_CGTT_LOCAL_1,4,2            ; @CG_CGTT_LOCAL_1
	.comm	_RV770_MGCGTTLOCAL1_DFLT,4,2    ; @RV770_MGCGTTLOCAL1_DFLT
	.comm	_CGTS_SM_CTRL_REG,4,2           ; @CGTS_SM_CTRL_REG
	.comm	_RV770_MGCGCGTSSMCTRL_DFLT,4,2  ; @RV770_MGCGCGTSSMCTRL_DFLT
	.no_dead_strip	_rv770_mg_clock_gating_enable
.subsections_via_symbols
