ExpAllocateFannedOutPushLock

NTSTATUS __stdcall ExpAllocateFannedOutPushLock(PVOID ParentLock, UINT64 Flags){
  __int64 v3; 
  unsigned int v4; 
  unsigned int MaximumProcessorCount; 
  __int64 *v6; 
  unsigned int v7; 
  __int64 v8; 
  __int64 v9; 
  unsigned int v10; 
  __int64 v11; 
  __int64 v12; 
  LODWORD(v3) = ExSaAllocate(0x10ui64);
  v4 = v3;
  if( v3 != -1 )
  {
    MaximumProcessorCount = KeQueryMaximumProcessorCountEx(0xFFFFu);
    if( MaximumProcessorCount )
    {
      v6 = (__int64 *)ExSaPageArrays;
      v7 = (v4 >> 13) & 0x3FFFF;
      v8 = (v4 >> 4) & 0x1FF;
      v9 = MaximumProcessorCount;
      do
      {
        _BitScanReverse(&v10, v7);
        v11 = *v6++;
        v12 = *(_QWORD *)(*(_QWORD *)(v11 + 8i64 * (v10 - 2)) + 8 * (v7 ^ (unsigned __int64)(unsigned int)(1 << v10)) + 8);
        *(_QWORD *)(v12 + 8 * v8) = 0i64;
        *(_QWORD *)(v12 + 8 * v8 + 8) = ParentLock;
        --v9;
      }
      while( v9 );
    }
  }
  return v4;
}

Referenced by:

ExpTryExpandAutoExpandPushLock