MiInitializeRebuildCandidateCounts

INT64 __fastcall MiInitializeRebuildCandidateCounts(UINT64 a1, UINT64 a2){
  unsigned int v2; 
  __int64 v3; 
  __int64 v4; 
  unsigned __int8 *v5; 
  INT64 result; 
  INT64 v7; 
  __int64 v8; 
  char ***v9; 
  __int64 v10; 
  char **v11; 
  __int64 v12; 
  char *i; 
  unsigned __int8 *v14; 
  __int64 v15; 
  unsigned int v16; 
  unsigned int v17; 
  __int64 v18; 
  unsigned __int8 *v19; 
  v17 = a2;
  v2 = dword_140C4DCC0[(unsigned int)a2];
  v3 = qword_140C50AD0 + 4544i64 * (unsigned int)a1;
  v16 = v2;
  v4 = v3 + 1072i64 * (unsigned int)a2;
  v14 = (unsigned __int8 *)(v3 + (unsigned int)MmNumberOfChannels + 4317i64);
  v15 = v4;
  v5 = (unsigned __int8 *)(v3 + 4317);
  v19 = (unsigned __int8 *)(v3 + 4317);
  do
  {
    result = 32i64 * *v5;
    v7 = result + v4 + 560;
    v18 = 2i64;
    do
    {
      v8 = 2i64;
      do
      {
        v9 = (char ***)v7;
        v10 = 4i64;
        do
        {
          if( *(v9 - 64) )
          {
            v11 = *v9;
            if( v2 )
            {
              v12 = v2;
              do
              {
                for( i = *v11; i != (char *)v11; i = *(char **)i )
                  result = MiUpdateLargePageCandidates((i - (char *)MmGetPfnDb()) / 48, v17, 1i64);
                v11 += 3;
                --v12;
              }
              while( v12 );
              v2 = v16;
            }
          }
          ++v9;
          --v10;
        }
        while( v10 );
        v7 += 128i64;
        --v8;
      }
      while( v8 );
      --v18;
    }
    while( v18 );
    v4 = v15;
    v5 = v19 + 1;
    v19 = v5;
  }
  while( v5 != v14 );
  return result;
}

Referenced by:

MiCreatePfnBitMaps