//
// png_build_grayscale_palette from 0x64da54 to 0x64da92 (62 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall png_build_grayscale_palette(int result, int a2)
{
int *v2; // r3
int v3; // r4
int v4; // r2
char v5; // r3
if ( a2 )
{
if ( (unsigned int)--result <= 7 )
{
v2 = &dword_9DE628[result];
result = v2[14];
v3 = v2[22];
if ( result > 0 )
{
v4 = 0;
result = 3 * result + a2;
do
{
v5 = v4;
a2 += 3;
*(_BYTE *)(a2 - 3) = v4;
v4 += v3;
*(_BYTE *)(a2 - 2) = v5;
*(_BYTE *)(a2 - 1) = v5;
}
while ( a2 != result );
}
}
}
return result;
}