MiImageRvaRawEnumNext

INT64 __fastcall MiImageRvaRawEnumNext(_DWORD *a1, _DWORD *a2){
  unsigned int v4; 
  int v5; 
  _DWORD *v6; 
  unsigned int *v7; 
  unsigned int v8; 
  unsigned int v9; 
  unsigned int i; 
  __int64(__fastcall *v11)(_DWORD *, unsigned int *, unsigned int *); 
  unsigned int v12; 
  int v13; 
  __int64 v14; 
  unsigned int v15; 
  _DWORD *v16; 
  INT64 result; 
  if( !a1[66] )
    return 0i64;
  v4 = a1[35];
  v5 = 0;
  v6 = a1 + 36;
  v7 = a1 + 36;
  v8 = 0;
  v9 = 0;
  for( i = v4; v9 < v4; i = v4 )
  {
    v11 = (__int64(__fastcall *)(_DWORD *, unsigned int *, unsigned int *))*((_QWORD *)v7 + 2);
    if( v11 )
    {
      v12 = *v7;
      if( *v7 == a1[66] )
      {
        v12 = v11(a1, v7 + 6, v7 + 1);
        *v7 = v12;
      }
      if( v12 )
      {
        if( v8 )
        {
          if( v8 >= v12 )
            v8 = v12;
        }
        else
        {
          v8 = v12;
        }
      }
    }
    v4 = a1[35];
    ++v9;
    v7 += 10;
  }
  if( a2 && v8 )
  {
    v13 = 0;
    if( v4 )
    {
      v14 = i;
      do
      {
        if( *v6 == v8 )
          v13 |= v6[1];
        v6 += 10;
        --v14;
      }
      while( v14 );
      v4 = i;
    }
    v15 = 0;
    if( v4 )
    {
      v16 = a1 + 32;
      do
      {
        if( (v13 & *v16) != 0 )
          v5 |= 1 << v15;
        ++v15;
        ++v16;
      }
      while( v15 < a1[35] );
    }
    *a2 = v5;
  }
  result = v8;
  a1[66] = v8;
  return result;
}

Referenced by:

RtlpCompressRvaList