PopSetPowerActionWatchdogState

VOID __stdcall PopSetPowerActionWatchdogState(UINT64 a1, _XSTATE_CONFIGURATION *a2){
  int v2; 
  unsigned __int64 v3; 
  int v4; 

  if( (unsigned int)a1 <= 2 )
  {
    v2 = a1;
    if( (_DWORD)a1 == 1 )
      PopUpdatePowerActionWatchdogTimeouts();
    v3 = (unsigned __int8)KeAcquireSpinLockRaiseToDpc(&qword_140C23378);
    if( dword_140C23404 != v2 )
    {
      if( dword_140C23404 )
      {
        if( !(unsigned __int8)KeCancelTimer((INT64)&Timer) )
          PopPowerActionWatchdog();
        qword_140C23408 = 0i64;
        dword_140C23404 = 0;
      }
      if( v2 )
      {
        if( v2 == 1 )
          v4 = PopPowerActionTransitioningWatchdogTimeout;
        else
          v4 = PopPowerActionResumingWatchdogTimeout;
        if( v4 )
        {
          qword_140C23408 = *(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart;
          dword_140C23404 = v2;
          KiSetTimerEx(&Timer, (_LARGE_INTEGER)(-10000000i64 * v4), 0i64, 0, &stru_140C23380);
        }
      }
    }
    KxReleaseSpinLock(&qword_140C23378);
    __writecr8(v3);
  }
}

Referenced by:

PopIssueActionRequest
PopTransitionSystemPowerStateEx