int __fastcall ImageRenderOutput(int *p_n26, int a2)
{
int Pool; // edi
int v6; // eax
int n26; // esi
int v8; // eax
int v9; // ecx
int v10; // esi
int v11; // eax
int v12; // esi
int v13; // ecx
int v14; // eax
void *buf; // eax
unsigned int count; // edx
int v17[2]; // [esp+Ch] [ebp-14h] BYREF
int v18; // [esp+14h] [ebp-Ch]
int v19; // [esp+18h] [ebp-8h]
int v20; // [esp+1Ch] [ebp-4h]
Pool = PeiAllocatePool((void *)0x24);
if ( !Pool )
return 0;
v6 = ImageRenderPrepare(p_n26, a2);
*(_DWORD *)(Pool + 12) = v6;
if ( !v6 )
return 0;
n26 = *p_n26;
ImageRenderSetPixelBlock(*p_n26, p_n26[1], v17, a2);
v8 = v17[1];
v9 = v19 * v20;
*(_DWORD *)Pool = n26;
v10 = v17[0];
v11 = v17[0] * v8;
*(_DWORD *)(Pool + 20) = v17[0];
v12 = v19 + v10;
*(_DWORD *)(Pool + 4) = v11 + v9;
v13 = v18 * v12;
*(_DWORD *)(Pool + 8) = v18 * v12;
v14 = PeiAllocatePool((void *)v13);
*(_DWORD *)(Pool + 16) = v14;
if ( !v14 )
return 0;
*(_DWORD *)(Pool + 24) = v12;
buf = (void *)PeiAllocatePool((void *)(16 * v12));
*(_DWORD *)(Pool + 28) = buf;
if ( !buf )
return 0;
count = 16 * *(_DWORD *)(Pool + 24);
if ( count )
SetMem(buf, count, 0);
if ( ImageRenderProcessFull(*(int **)(Pool + 28), v17, *(_DWORD *)(Pool + 12), *(unsigned __int8 **)(Pool + 16), a2) < 0 )
return 0;
*(_DWORD *)(Pool + 32) = 0;
return Pool;
}