MiGetClosestNodeWithProcessors

__int64 __fastcall MiGetClosestNodeWithProcessors(unsigned int a1){
  unsigned int v1; 
  unsigned int *v3; 
  unsigned int *v4; 
  USHORT Count; 

  Count = 0;
  v1 = a1;
  KeQueryNodeActiveAffinity(a1, 0i64, &Count);
  if( Count )
    return v1;
  v3 = (unsigned int *)(*(&stru_140C4DB30 + 21) + 4i64 * v1 * (unsigned __int16)KeNumberNodes);
  v4 = &v3[(unsigned __int16)KeNumberNodes];
  while( ++v3 < v4 )
  {
    v1 = *v3;
    KeQueryNodeActiveAffinity(*v3, 0i64, &Count);
    if( Count )
      return v1;
  }
  return 0xFFFFFFFFi64;
}

Referenced by:

MiComputeIdealDpcGang
MiCreateColorAnchors