PpmIdleCheckProcessorStateEligibility

UINT64 __stdcall PpmIdleCheckProcessorStateEligibility(
        _KPRCB *Prcb,
        UINT64 PreselectState,
        UINT64 RemainingLatency,
        UINT64 ExpectedIdle,
        UINT64 StateIndex,
        UINT8 Lightweight){
  _PPM_IDLE_STATES *IdleStates; 
  UINT64 result; 
  unsigned int v9; 
  __int64 v10; 
  unsigned int v11; 
  __int64 v12; 
  unsigned int v13; 

  IdleStates = Prcb->PowerState.IdleStates;
  if( IdleStates->Type == 3 && PpmIdleVetoBias )
    return 4294967294i64;
  v9 = StateIndex;
  v10 = (unsigned int)StateIndex;
  if( IdleStates->State[v10].NoCState )
    return 2147483658i64;
  if( (_DWORD)PreselectState != -1 && (unsigned int)StateIndex > (unsigned int)PreselectState )
    return 2147483656i64;
  if( !IdleStates->State[v10].Interruptible && IdleStates->PrepareInfo.Constraints.Interruptible )
    return 2147483655i64;
  if( Lightweight )
    goto LABEL_19;
  v11 = PpmCheckIdleVeto(&IdleStates->State[v10].VetoAccounting);
  if( v11 )
    return v11 | 0x100000000i64;
  if( *(unsigned int *)((char *)&IdleStates->State[0].Latency + v12) > v13 )
    return 2147483650i64;
  if( *(unsigned int *)((char *)&IdleStates->State[0].BreakEvenDuration + v12) > ExpectedIdle )
    return 2147483651i64;
LABEL_19:
  result = (UINT64)IdleStates->IdleAvailabilityCheck;
  if( result )
    return((unsigned int(__fastcall *)(void *, _QWORD))result)(IdleStates->PrepareInfo.Context, v9);
  return result;
}

Referenced by:

PpmIdleSelectCoordinatedProcessorDependency