KeEnumerateNextProcessor

__int64 __fastcall KeEnumerateNextProcessor(_DWORD *a1, unsigned __int16 **a2){
  unsigned int v3; 
  unsigned __int16 *v4; 
  unsigned __int64 v5; 
  if( *a2 )
    v3 = **a2;
  else
    v3 = *((unsigned __int16 *)a2 + 8) + 1;
  v4 = a2[1];
  if( v4 )
  {
LABEL_4:
    _BitScanForward64(&v5, (unsigned __int64)v4);
    a2[1] = (unsigned __int16 *)((unsigned __int64)v4 & ~(1i64 << v5));
    *a1 = KiProcessorNumberToIndexMappingTable[64 * *((unsigned __int16 *)a2 + 8) + (unsigned __int8)v5];
    return 0i64;
  }
  else
  {
    while( (unsigned __int16)++*((_WORD *)a2 + 8) < v3 )
    {
      v4 = *(unsigned __int16 **)&(*a2)[4 * *((unsigned __int16 *)a2 + 8) + 4];
      a2[1] = v4;
      if( v4 )
        goto LABEL_4;
    }
    return 3221226021i64;
  }
}

Referenced by:

EmonAllocateResources
HalGetMessageRoutingInfo
HvlpAffinityToHvProcessorSet
IopAddLiveDumpPagesToPartialKernelDump
IopLiveDumpCorralProcessors
IopLiveDumpMarkImportantDumpData
IopLiveDumpMarkRequiredDumpData
KeFlushQueuedDpcs
KeFreezeExecution
KeIntSteerPeriodic
KeRemoveQueueDpcEx
KiConfigureSchedulingInformation
KiForceIdleUpdateSchedulerParkState
KiIntSteerLogStatus
KiIntSteerUpdateDeviceInterruptMask
KiIpiEnlightenedGuestPriorityKick
KiSendFreeze
KiSendThawExecution
KiStartProfileTarget
KiStopProfileTarget
KiSynchNumaCounterSetCallback
PnprQuiesceProcessors
PopCheckForIdleness
PopEndMirroring
PopEtIsrDpcQuery
PopInitializeHeteroProcessors
PopProcessorInformation
PopQueueTargetDpc
PpmCapturePerformanceDistribution
PpmCheckComputeHeteroResponse
PpmCheckInitProcessors
PpmCheckMakeupSkippedChecks
PpmEstimateIdleDuration
PpmEventTraceControlCallback
PpmHeteroDetectHgsCores
PpmHeteroDistributeUtility
PpmHeteroUpdateHgsConfiguration
PpmIdleCheckCoordinatedDependency
PpmIdlePrepare
PpmIdleWaitForDependentTransitions
PpmParkApplyPolicy
PpmParkCalculateCoreParkingMask
PpmParkDistributeUtility
PpmParkRegisterParking
PpmParkReportParkedCores
PpmParkReportUnparkedCores
PpmParkSteerInterrupts
PpmParkUnblockIdle
PpmPerfApplyProcessorStates
PpmPerfGetBrandedFrequency
PpmPerfResetHistoryAll
PpmPerfResizeHistoryAll
PpmUnlockProcessors
VslConnectSwInterrupt