RtlCopyMemoryNonTemporal
VOID *__stdcall RtlCopyMemoryNonTemporal(VOID *Destination, const VOID *Source, _SIZE_T Length){
VOID *result;
signed __int64 v4;
char *v5;
char *v6;
__int64 v7;
signed __int64 v8;
__m128i v9;
__m128i v10;
bool v11;
unsigned __int64 v12;
bool v13;
int *v14;
v4 = (_BYTE *)Source - (_BYTE *)Destination;
if( *(_QWORD *)&Length >= 0x4Fui64 )
{
if( ((unsigned __int8)Destination & 0xF) != 0 )
{
v5 = (char *)Destination + *(_QWORD *)&Length;
_mm_stream_si32((int *)Destination, *(_QWORD *)((char *)Destination + v4));
if( ((unsigned __int8)Destination & 8) == 0 )
_mm_stream_si32((int *)Destination + 2, *(_QWORD *)((char *)Destination + v4 + 8));
Destination = (VOID *)(((unsigned __int64)Destination + 16) & 0xFFFFFFFFFFFFFFF0ui64);
*(_QWORD *)&Length = v5 - (_BYTE *)Destination;
}
do
{
v6 = (char *)Destination;
v7 = 16i64;
v11 = *(_QWORD *)&Length < 0x400ui64;
*(_QWORD *)&Length -= 1024i64;
if( v11 )
{
v12 = *(_QWORD *)&Length + 1024i64;
v7 = v12 >> 6;
*(_QWORD *)&Length = v12 & 0x3F;
}
do
{
_mm_prefetchnta(&v6[v4]);
v6 += 64;
--v7;
}
while( v7 );
v8 = v6 - (_BYTE *)Destination;
do
{
v9 = _mm_loadu_si128((const __m128i *)((char *)Destination + v4 + 16));
_mm_stream_si128((__m128i *)Destination, _mm_loadu_si128((const __m128i *)((char *)Destination + v4)));
_mm_stream_si128((__m128i *)Destination + 1, v9);
Destination = (char *)Destination + 64;
v10 = _mm_loadu_si128((const __m128i *)((char *)Destination + v4 - 16));
_mm_stream_si128((__m128i *)Destination - 2, _mm_loadu_si128((const __m128i *)((char *)Destination + v4 - 32)));
_mm_stream_si128((__m128i *)Destination - 1, v10);
v8 -= 64i64;
}
while( v8 );
}
while( *(_QWORD *)&Length >= 0x40ui64 );
}
else if( *(_QWORD *)&Length < 8ui64 )
{
for( ; *(_QWORD *)&Length; --*(_QWORD *)&Length )
{
LOBYTE(result) = *((_BYTE *)Destination + v4);
*(_BYTE *)Destination = (_BYTE)result;
Destination = (char *)Destination + 1;
}
return result;
}
while( 1 )
{
v13 = *(_QWORD *)&Length <= 8ui64;
*(_QWORD *)&Length -= 8i64;
if( v13 )
break;
_mm_stream_si32((int *)Destination, *(_QWORD *)((char *)Destination + v4));
Destination = (char *)Destination + 8;
}
v14 = (int *)((char *)Destination + *(_QWORD *)&Length);
result = *(VOID **)((char *)v14 + v4);
_mm_stream_si32(v14, (int)result);
_mm_sfence();
return result;
}Referenced by:
HviCopyMemoryNonTemporal
MmCopyToCachedPage
RtlWriteNonVolatileMemory