MiInitializePrivateFixupBitmap

NTSTATUS __stdcall MiInitializePrivateFixupBitmap(_RTL_BITMAP *BitMap, _CONTROL_AREA *ControlArea){
  _CONTROL_AREA *v2; 
  _MI_IMAGE_SECURITY_REFERENCE *SeImageStub; 
  unsigned int TotalNumberOfPtes; 
  unsigned int v6; 
  NTSTATUS v7; 
  __int64 v8; 
  unsigned __int64 i; 
  __int64 *DynamicRelocations; 
  __int64 v11; 
  UINT64 v12; 
  int v13; 
  int v14; 

  v2 = ControlArea + 1;
  SeImageStub = ControlArea->u2.SeImageStub;
  TotalNumberOfPtes = ControlArea->Segment->TotalNumberOfPtes;
  BitMap->Buffer = &BitMap[1].SizeOfBitMap;
  BitMap->SizeOfBitMap = TotalNumberOfPtes;
  RtlClearAllBits(BitMap);
  v6 = 0;
  v7 = 0;
  do
  {
    v8 = 8i64 * HIDWORD(v2->NumberOfMappedViews);
    if( *(_QWORD *)v2->gap8 < (unsigned __int64)(v8 + *(_QWORD *)v2->gap8) )
    {
      for( i = ((unsigned __int64)(v8 - 1) >> 3) + 1; i; --i )
      {
        DynamicRelocations = (__int64 *)SeImageStub->DynamicRelocations;
        v11 = *DynamicRelocations;
        if( v6 >= (unsigned __int64)DynamicRelocations[7] )
        {
LABEL_14:
          if( (v2->NumberOfPfnReferences & 0xA) != 10 )
            goto LABEL_10;
        }
        else
        {
          v12 = v6;
          while( !*(_QWORD *)(v11 + 8i64 * (unsigned int)v12) )
          {
            LOBYTE(v13) = MiDoesPageRequireRetpolineFixups((INT64)(DynamicRelocations + 9), v12);
            if( v13 )
              break;
            v12 = (unsigned int)(v14 + 1);
            if( (_DWORD)v12 != v6 )
              goto LABEL_14;
          }
          _bittestandset((signed __int32 *)BitMap->Buffer, v6);
        }
        ++v7;
LABEL_10:
        ++v6;
      }
    }
    v2 = *(_CONTROL_AREA **)&v2->gap8[8];
  }
  while( v2 );
  return v7;
}

Referenced by:

MiAddPrivateFixupEntryForSystemImage
MiAllocateFixupVad