	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ni_enable_smc_cac
_ni_enable_smc_cac:                     ## @ni_enable_smc_cac
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_ni_get_pi
	xorl	%r12d, %r12d
	cmpq	$0, 8(%rax)
	je	LBB0_11
## %bb.1:
	movq	%rax, %r14
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.2:
	movl	(%r13), %esi
	movl	4(%r13), %edi
	callq	_r600_is_uvd_state
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movq	_PPSMC_MSG_CollectCAC_PowerCorreln@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rv770_send_msg_to_smc
	cmpl	$0, (%r14)
	je	LBB0_6
## %bb.4:
	movq	_PPSMC_CACLongTermAvgEnable@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rv770_send_msg_to_smc
	movq	_PPSMC_Result_OK@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_6
## %bb.5:
	movl	$0, (%r14)
LBB0_6:
	movq	_PPSMC_MSG_EnableCac@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rv770_send_msg_to_smc
	movq	_PPSMC_Result_OK@GOTPCREL(%rip), %rcx
	movq	_EINVAL@GOTPCREL(%rip), %rdx
	xorl	%r12d, %r12d
	subl	(%rdx), %r12d
	xorl	%edx, %edx
	xorl	%esi, %esi
	cmpq	%rax, (%rcx)
	sete	%sil
	cmovel	%edx, %r12d
	movl	%esi, 4(%r14)
	jmp	LBB0_11
LBB0_7:
	cmpl	$0, 4(%r14)
	je	LBB0_11
## %bb.8:
	movq	_PPSMC_MSG_DisableCac@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rv770_send_msg_to_smc
	movl	$0, 4(%r14)
	cmpl	$0, (%r14)
	je	LBB0_11
## %bb.9:
	movq	_PPSMC_CACLongTermAvgDisable@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rv770_send_msg_to_smc
	movq	_PPSMC_Result_OK@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_11
## %bb.10:
	movl	$0, (%r14)
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PPSMC_MSG_CollectCAC_PowerCorreln,4,2 ## @PPSMC_MSG_CollectCAC_PowerCorreln
	.comm	_PPSMC_CACLongTermAvgEnable,4,2 ## @PPSMC_CACLongTermAvgEnable
	.comm	_PPSMC_Result_OK,8,3            ## @PPSMC_Result_OK
	.comm	_PPSMC_MSG_EnableCac,4,2        ## @PPSMC_MSG_EnableCac
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PPSMC_MSG_DisableCac,4,2       ## @PPSMC_MSG_DisableCac
	.comm	_PPSMC_CACLongTermAvgDisable,4,2 ## @PPSMC_CACLongTermAvgDisable
	.no_dead_strip	_ni_enable_smc_cac
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ni_enable_smc_cac
_ni_enable_smc_cac:                     ; @ni_enable_smc_cac
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	bl	_ni_get_pi
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_10
; %bb.1:
	mov	x19, x0
	cbz	w22, LBB0_7
; %bb.2:
	ldp	w1, w0, [x21]
	bl	_r600_is_uvd_state
	cbnz	w0, LBB0_10
; %bb.3:
Lloh0:
	adrp	x8, _PPSMC_MSG_CollectCAC_PowerCorreln@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PPSMC_MSG_CollectCAC_PowerCorreln@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rv770_send_msg_to_smc
	ldr	w8, [x19]
Lloh3:
	adrp	x21, _PPSMC_Result_OK@GOTPAGE
Lloh4:
	ldr	x21, [x21, _PPSMC_Result_OK@GOTPAGEOFF]
	cbz	w8, LBB0_6
; %bb.4:
Lloh5:
	adrp	x8, _PPSMC_CACLongTermAvgEnable@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PPSMC_CACLongTermAvgEnable@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rv770_send_msg_to_smc
	ldr	x8, [x21]
	cmp	x8, x0
	b.eq	LBB0_6
; %bb.5:
	str	wzr, [x19]
LBB0_6:
Lloh8:
	adrp	x8, _PPSMC_MSG_EnableCac@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PPSMC_MSG_EnableCac@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rv770_send_msg_to_smc
	ldr	x8, [x21]
	cmp	x8, x0
	cset	w8, eq
Lloh11:
	adrp	x9, _EINVAL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	csneg	w0, wzr, w9, eq
	str	w8, [x19, #4]
	b	LBB0_11
LBB0_7:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_10
; %bb.8:
Lloh14:
	adrp	x8, _PPSMC_MSG_DisableCac@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PPSMC_MSG_DisableCac@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rv770_send_msg_to_smc
	str	wzr, [x19, #4]
	ldr	w8, [x19]
	cbz	w8, LBB0_10
; %bb.9:
Lloh17:
	adrp	x8, _PPSMC_CACLongTermAvgDisable@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PPSMC_CACLongTermAvgDisable@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_rv770_send_msg_to_smc
Lloh20:
	adrp	x8, _PPSMC_Result_OK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PPSMC_Result_OK@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ne	LBB0_12
LBB0_10:
	mov	w0, #0
LBB0_11:
	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_12:
	mov	w0, #0
	str	wzr, [x19]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PPSMC_MSG_CollectCAC_PowerCorreln,4,2 ; @PPSMC_MSG_CollectCAC_PowerCorreln
	.comm	_PPSMC_CACLongTermAvgEnable,4,2 ; @PPSMC_CACLongTermAvgEnable
	.comm	_PPSMC_Result_OK,8,3            ; @PPSMC_Result_OK
	.comm	_PPSMC_MSG_EnableCac,4,2        ; @PPSMC_MSG_EnableCac
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PPSMC_MSG_DisableCac,4,2       ; @PPSMC_MSG_DisableCac
	.comm	_PPSMC_CACLongTermAvgDisable,4,2 ; @PPSMC_CACLongTermAvgDisable
	.no_dead_strip	_ni_enable_smc_cac
.subsections_via_symbols
