MiReduceUnusedSubsectionCount

VOID __fastcall MiReduceUnusedSubsectionCount(_MSUBSECTION *MappedSubsection){
  __int64 v1; 
  unsigned int v2; 
  unsigned __int64 v3; 
  unsigned __int64 v4; 
  unsigned __int64 v5; 
  unsigned int v6; 
  v1 = *(_QWORD *)(qword_140C4E388 + 8i64 * (*(_WORD *)(*(_QWORD *)MappedSubsection + 60i64) & 0x3FF));
  v2 = *((_DWORD *)MappedSubsection + 11);
  v3 = 8i64 * v2;
  if( v3 > 0xFE0 )
  {
    v6 = (8 * (_WORD)v2) & 0xFFF;
    if( v3 >= 0x10000 || v6 > 0xFC0 )
    {
      v5 = (v3 + 4095) & 0xFFFFFFFFFFFFF000ui64;
      goto LABEL_4;
    }
    v4 = v3 + 15;
  }
  else
  {
    v4 = v3 + 31;
  }
  v5 = v4 & 0xFFFFFFFFFFFFFFF0ui64;
LABEL_4:
  _InterlockedExchangeAdd64(&qword_140C4C6D8, -(__int64)v5);
  *(_QWORD *)(v1 + 1696) -= v5;
}

Referenced by:

MiDeleteCachedSubsection
MiDeleteEmptySubsections
MiRemoveUnusedSubsection