Newer
Older
AMI-Aptio-BIOS-Reversed / EarlyVideoPei / InternalCopyMem.c
@Ajax Dong Ajax Dong 2 days ago 602 bytes Init
/*
 * InternalCopyMem at 0xffe6be6c.
 * Low-level copy helper; keeps the original overlap check and qmemcpy calls.
 */
char *__cdecl InternalCopyMem(char *dst, char *src, unsigned int count)
{
  unsigned int count_1; // edx
  char *dst_1; // edi
  char *src_1; // esi

  count_1 = count;
  if ( src < dst && &src[count - 1] >= dst )
  {
    src_1 = &src[count - 1];
    dst_1 = &dst[count - 1];
  }
  else
  {
    count_1 = count & 3;
    qmemcpy(dst, src, 4 * (count >> 2));
    src_1 = &src[4 * (count >> 2)];
    dst_1 = &dst[4 * (count >> 2)];
  }
  qmemcpy(dst_1, src_1, count_1);
  return dst;
}