HalpTimerStallCounterPowerChange

INT8 __stdcall HalpTimerStallCounterPowerChange(PVOID BugCheckParameter3, INT8 a2){
  void *v2; 
  void *v3; 
  ULONG_PTR v4; 
  int v5; 
  __int64 v6; 
  ULONG_PTR BugCheckParameter4; 
  v4 = HalpSavedStallCounter;
  LOBYTE(v5) = a2;
  if( HalpSavedStallCounter )
  {
    if( BugCheckParameter3 == (PVOID)HalpSavedStallCounter && a2 )
    {
      if( HalpSavedStallCounter != HalpPerformanceCounter )
      {
        HalpTimerGetInternalData((KDPC *)HalpSavedStallCounter, (PVOID)a2, v2, v3);
        v5 = (*(__int64(__fastcall **)(__int64))(v4 + 104))(v6);
        if( v5 < 0 )
          KeBugCheckEx(0x5Cu, 0x113ui64, 0xFui64, v4, v5);
      }
      HalpSavedStallCounter = 0i64;
      HalpStallCounter = (KDPC *)v4;
    }
  }
  else if( BugCheckParameter3 == HalpStallCounter && !a2 )
  {
    LOBYTE(v5) = HalpAlwaysOnCounter;
    if( !HalpAlwaysOnCounter )
      KeBugCheckEx(
        HalpAlwaysOnCounter + 92,
        0x113ui64,
        (unsigned int)(HalpAlwaysOnCounter + 34),
        (ULONG_PTR)BugCheckParameter3,
        HalpAlwaysOnCounter & BugCheckParameter4);
    HalpSavedStallCounter = (ULONG_PTR)HalpStallCounter;
    HalpStallCounter = (KDPC *)HalpAlwaysOnCounter;
  }
  return v5;
}

Referenced by:

HalpTimerPowerChange