HalpWatchdogCheckPreResetNMI

INT64 __stdcall HalpWatchdogCheckPreResetNMI(){
  INT64 result; 
  int v1; 
  ULONG_PTR v2; 
  ULONG_PTR v3; 
  ULONG_PTR v4; 
  ULONG_PTR BugCheckParameter3; 
  BugCheckParameter3 = 0i64;
  result = (INT64)HalpWatchdogTimer;
  if( HalpWatchdogTimer )
  {
    v1 = *((_DWORD *)HalpWatchdogTimer + 57);
    if( v1 == 8 )
    {
      LODWORD(result) = *((_DWORD *)KeGetPcr() + 105);
      if( (_DWORD)result )
        return result;
      result = __readmsr(0x40000112u);
      if( !result )
        return result;
      __writemsr(0x40000112u, 0i64);
    }
    else
    {
      if( v1 != 13 )
        return result;
      result = *(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart - HalpTimerWatchdogLastReset + 100000000;
      if( result <= (unsigned __int64)HalpTimerWatchdogTimeout )
        return result;
    }
    v2 = *(_QWORD *)&KUSER_SHARED_DATA.InterruptTime.LowPart - HalpTimerWatchdogLastReset;
    LODWORD(v3) = RtlGetInterruptTimePrecise((INT64 *)&BugCheckParameter3);
    v4 = v3;
    result = *((unsigned int *)HalpWatchdogTimer + 57);
    if( (_DWORD)result == 8 )
      KeBugCheckEx(0x1CAu, v2, v4, BugCheckParameter3, (unsigned int)KiClockTimerOwner);
    if( (_DWORD)result == 13 )
      KeBugCheckEx(0x1CFu, v2, v4, BugCheckParameter3, (unsigned int)KiClockTimerOwner);
  }
  return result;
}

Referenced by:

HalpPreprocessNmi