KiCheckKeepAlive

UINT8 __stdcall KiCheckKeepAlive(UINT64 ProcNumber){
  int v1; 
  UINT8 v2; 
  unsigned __int64 v3; 
  char v4; 
  unsigned __int64 v5; 
  v1 = ProcNumber;
  v2 = 0;
  v3 = (unsigned int)KiProcessorIndexToNumberMappingTable[(unsigned int)ProcNumber];
  v4 = v3 & 0x3F;
  v5 = v3 >> 6;
  if( ((*(_QWORD *)&KiClockCheckPending[4 * v5 + 4] >> v4) & 1) != 0 )
  {
    if( (((unsigned __int64)KiClockCheckReady[v5 + 1] >> v4) & 1) != 0 )
    {
      KeRemoveProcessorAffinityEx((unsigned __int16 *)KiClockCheckReady, ProcNumber);
      KeRemoveProcessorAffinityEx((unsigned __int16 *)KiClockCheckPending, v1);
      return 1;
    }
    else
    {
      KeAddProcessorAffinityEx(KiClockCheckReady, ProcNumber);
    }
  }
  return v2;
}

Referenced by:

KeAccumulateTicks