	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vce_v3_0_get_clockgating_state
_vce_v3_0_get_clockgating_state:        ## @vce_v3_0_get_clockgating_state
	.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
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	4(%rdi), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_AMD_IS_APU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rbx), %eax
	jne	LBB0_1
## %bb.2:
	movq	_ixCURRENT_PG_STATUS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_ixCURRENT_PG_STATUS_APU@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	callq	_RREG32_SMC
	movq	_CURRENT_PG_STATUS__VCE_PG_STATUS_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
	jmp	LBB0_7
LBB0_5:
	movq	_GRBM_GFX_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VCE_INSTANCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_WREG32_FIELD
	movq	_mmVCE_CLOCK_GATING_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	testb	$64, %al
	je	LBB0_7
## %bb.6:
	movq	_AMD_CG_SUPPORT_VCE_MGCG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
LBB0_7:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_IS_APU,4,2                 ## @AMD_IS_APU
	.comm	_ixCURRENT_PG_STATUS_APU,4,2    ## @ixCURRENT_PG_STATUS_APU
	.comm	_ixCURRENT_PG_STATUS,4,2        ## @ixCURRENT_PG_STATUS
	.comm	_CURRENT_PG_STATUS__VCE_PG_STATUS_MASK,4,2 ## @CURRENT_PG_STATUS__VCE_PG_STATUS_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot get clockgating state when VCE is powergated.\n"

	.comm	_GRBM_GFX_INDEX,4,2             ## @GRBM_GFX_INDEX
	.comm	_VCE_INSTANCE,4,2               ## @VCE_INSTANCE
	.comm	_mmVCE_CLOCK_GATING_A,4,2       ## @mmVCE_CLOCK_GATING_A
	.comm	_AMD_CG_SUPPORT_VCE_MGCG,4,2    ## @AMD_CG_SUPPORT_VCE_MGCG
	.no_dead_strip	_vce_v3_0_get_clockgating_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vce_v3_0_get_clockgating_state
_vce_v3_0_get_clockgating_state:        ; @vce_v3_0_get_clockgating_state
	.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	x21, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _AMD_IS_APU@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMD_IS_APU@GOTPAGEOFF]
Lloh2:
	adrp	x10, _ixCURRENT_PG_STATUS@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ixCURRENT_PG_STATUS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
Lloh5:
	adrp	x11, _ixCURRENT_PG_STATUS_APU@GOTPAGE
Lloh6:
	ldr	x11, [x11, _ixCURRENT_PG_STATUS_APU@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w0, [x8]
	bl	_RREG32_SMC
Lloh7:
	adrp	x8, _CURRENT_PG_STATUS__VCE_PG_STATUS_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CURRENT_PG_STATUS__VCE_PG_STATUS_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
	b	LBB0_4
LBB0_2:
Lloh12:
	adrp	x8, _GRBM_GFX_INDEX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GRBM_GFX_INDEX@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _VCE_INSTANCE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VCE_INSTANCE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_WREG32_FIELD
Lloh18:
	adrp	x8, _mmVCE_CLOCK_GATING_A@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mmVCE_CLOCK_GATING_A@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_RREG32
	tbz	w0, #6, LBB0_4
; %bb.3:
Lloh21:
	adrp	x8, _AMD_CG_SUPPORT_VCE_MGCG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AMD_CG_SUPPORT_VCE_MGCG@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_4:
	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	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_IS_APU,4,2                 ; @AMD_IS_APU
	.comm	_ixCURRENT_PG_STATUS_APU,4,2    ; @ixCURRENT_PG_STATUS_APU
	.comm	_ixCURRENT_PG_STATUS,4,2        ; @ixCURRENT_PG_STATUS
	.comm	_CURRENT_PG_STATUS__VCE_PG_STATUS_MASK,4,2 ; @CURRENT_PG_STATUS__VCE_PG_STATUS_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot get clockgating state when VCE is powergated.\n"

	.comm	_GRBM_GFX_INDEX,4,2             ; @GRBM_GFX_INDEX
	.comm	_VCE_INSTANCE,4,2               ; @VCE_INSTANCE
	.comm	_mmVCE_CLOCK_GATING_A,4,2       ; @mmVCE_CLOCK_GATING_A
	.comm	_AMD_CG_SUPPORT_VCE_MGCG,4,2    ; @AMD_CG_SUPPORT_VCE_MGCG
	.no_dead_strip	_vce_v3_0_get_clockgating_state
.subsections_via_symbols
