MxInitializeFreeNodeDescriptors

VOID __stdcall MxInitializeFreeNodeDescriptors(_MEMORY_ALLOCATION_DESCRIPTOR *MemoryDescriptor, UINT64 *RequiredPages){
  unsigned __int64 PageCount; 
  char *i; 
  UINT64 v6; 
  UINT64 v7; 
  __int64 v8; 
  __int64 v9; 
  __int64 *v10; 
  __int64 v11; 

  PageCount = MemoryDescriptor->PageCount;
  for( i = (char *)MemoryDescriptor->BasePage; PageCount; PageCount -= v7 )
  {
    MiRestrictRangeToNode((UINT64)i, PageCount);
    v7 = v6;
    LODWORD(v8) = MiSearchNumaNodeTable(i);
    v9 = *(unsigned int *)(v8 + 8);
    v10 = &MxBootFreeDescriptor[5 * v9];
    if( (v7 >= v10[1] || v7 >= RequiredPages[v9] + 0x4000)
      && ((unsigned int)MxPageAlwaysHot((UINT64)&i[v7 - 1]) == 1
       || (v11 = v10[1]) == 0
       || !(unsigned int)MxPageAlwaysHot(*v10 - 1 + v11)
       || *v10 + v10[1] < RequiredPages[v9] + 0x4000) )
    {
      MiInitializeBootMemoryDescriptor((_MX_ALLOCATION_DESCRIPTOR *)v10, MemoryDescriptor, (UINT64)i, v7);
      MxFreeDescriptor[v9] = (__int64)v10;
    }
    i += v7;
  }
}

Referenced by:

MiFindLargestLoaderDescriptor