RtlpFillMemoryWithInverseStride

VOID __stdcall RtlpFillMemoryWithInverseStride(UINT64 Pattern, UINT64 Offset, PVOID VirtualAddress){
  unsigned __int64 v3; 
  int v4; 
  char *v5; 
  __int64 v6; 
  unsigned __int64 v7; 
  unsigned int v8; 
  char *v9; 
  unsigned __int64 v10; 
  unsigned __int64 v11; 
  _DWORD *v12; 
  unsigned __int64 i; 
  char *v14; 
  unsigned __int64 v15; 
  unsigned __int64 v16; 
  unsigned __int64 v17; 
  char *v18; 
  unsigned __int64 j; 
  unsigned __int64 v20; 
  char *v21; 
  v4 = Pattern;
  v5 = (char *)(v3 + 4096);
  v6 = 4096i64;
  v7 = (v3 >> 2) - 12 * ((unsigned __int64)(((v3 >> 2) * (unsigned __int128)0xAAAAAAAAAAAAAAABui64) >> 64) >> 3);
  v8 = 2 * Offset - v7;
  if( (unsigned int)v7 > 2 * (int)Offset )
    v8 += 12;
  if( 4i64 * v8 + v3 <= (unsigned __int64)v5 )
    v6 = 4i64 * v8;
  v9 = (char *)(v3 + v6);
  v10 = (unsigned __int64)&v9[-v3 + 3] >> 2;
  if( v3 > (unsigned __int64)v9 )
    v10 = 0i64;
  if( v10 )
  {
    v11 = 4 * v10;
    v12 = (_DWORD *)v3;
    for( i = v11 >> 2; i; --i )
      *v12++ = v4;
    v3 += v11;
  }
  v14 = (char *)(v3 + 8);
  if( v9 < v5 )
  {
    v15 = (unsigned __int64)&v5[-4 * ((unsigned int)((v5 - v9) >> 2) % 0xC)];
    if( v9 != (char *)v15 )
    {
      while( 1 )
      {
        v9 += 48;
        if( (unsigned __int64)v14 >= v15 )
          break;
        v16 = (unsigned __int64)(v9 - v14 + 3) >> 2;
        if( v14 > v9 )
          v16 = 0i64;
        if( v16 )
        {
          v17 = 4 * v16;
          v18 = v14;
          for( j = v17 >> 2; j; --j )
          {
            *(_DWORD *)v18 = v4;
            v18 += 4;
          }
          v14 += v17;
        }
        v14 += 8;
      }
    }
  }
  v20 = (unsigned __int64)(v5 - v14 + 3) >> 2;
  if( v14 > v5 )
    v20 = 0i64;
  if( v20 )
  {
    v21 = v14;
    while( v20 )
    {
      *(_DWORD *)v21 = v4;
      v21 += 4;
      --v20;
    }
  }
}

Referenced by:

RtlpGenericStrideWorker