MiMakeEntireHugePfnGood

RTL_BALANCED_NODE *__fastcall MiMakeEntireHugePfnGood(INT64 a1){
  _QWORD *v1; 
  INT64 v2; 
  INT64 v3; 
  unsigned __int64 v4; 
  __int64 v5; 
  unsigned __int64 *v6; 
  RTL_BALANCED_NODE *v7; 
  unsigned __int64 v8; 
  v1 = (_QWORD *)(qword_140C4E3B0 + 8 * (a1 & 0x3FFFF));
  v2 = MiHugePfnPartition(v1);
  v6 = (unsigned __int64 *)(v2 + 4896);
  v7 = *(RTL_BALANCED_NODE **)(v2 + 4896);
  while( v7 )
  {
    v8 = v5 & (__int64)v7[1].Children[0];
    if( v4 > v8 )
    {
      v7 = v7->Children[1];
    }
    else
    {
      if( v4 >= v8 )
        break;
      v7 = v7->Children[0];
    }
  }
  if( (*(_DWORD *)v1 & 0x1C0000) == 0x100000i64 )
    MiUnlinkHugeRange(v2, v3);
  RtlAvlRemoveNode(v6, (__int64 *)v7);
  *v1 &= ~0x10000000000ui64;
  return v7;
}

Referenced by:

MiHotRemoveHugeRange