Newer
Older
AMI-Aptio-BIOS-Reversed / PurleyPlatPkg / Platform / Pei / EarlyVideoPei / ImageRenderProcessLine.c
@Ajax Dong Ajax Dong 2 days ago 1 KB Full restructure
int __fastcall ImageRenderProcessLine(int *Pool, int a2, unsigned __int8 *buf)
{
  unsigned int count; // edx
  int v5; // ebx
  int v6; // ebp
  int v7; // edx
  int result; // eax
  int v9; // ebx
  int v10; // ebp
  int v11; // ecx
  unsigned __int8 *buf_1; // edx
  int v13; // [esp+10h] [ebp-Ch]
  int v14; // [esp+14h] [ebp-8h]

  count = Pool[5];
  if ( count )
    SetMem(buf, count, 0);
  v5 = Pool[1];
  v6 = 0;
  v7 = Pool[5];
  v14 = 0;
  result = v5 - v7 - Pool[9];
  if ( result > 0 )
  {
    do
    {
      v13 = *(unsigned __int8 *)((*buf ^ *(unsigned __int8 *)(a2 + v6)) + Pool[3]);
      if ( v13 != v5 )
      {
        v9 = 1;
        if ( v7 > 1 )
        {
          v10 = *(unsigned __int8 *)((*buf ^ *(unsigned __int8 *)(a2 + v6)) + Pool[3]);
          do
          {
            buf[v9] ^= *(_BYTE *)(ImageRenderNextLine(Pool, v10 + *(unsigned __int8 *)(Pool[4] - v9 + v7)) + Pool[2]);
            ++v9;
            v7 = Pool[5];
          }
          while ( v9 < v7 );
          v6 = v14;
        }
      }
      v11 = 0;
      if ( Pool[5] - 1 > 0 )
      {
        buf_1 = buf;
        do
          *buf_1++ = buf[++v11];
        while ( v11 < Pool[5] - 1 );
      }
      if ( v13 == Pool[1] )
        buf[Pool[5] - 1] = 0;
      else
        buf[Pool[5] - 1] = *(_BYTE *)(ImageRenderNextLine(Pool, v13 + *(unsigned __int8 *)Pool[4]) + Pool[2]);
      v5 = Pool[1];
      ++v6;
      v7 = Pool[5];
      v14 = v6;
      result = v5 - v7 - Pool[9];
    }
    while ( v6 < result );
  }
  return result;
}