//
// png_build_grayscale_palette from 0x85dad4 to 0x85db12 (62 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:02:41 +0000
//
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_C20BC0[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;
}