//
// png_set_filler from 0x870c0c to 0x870c80 (116 bytes)
//
// 3 xrefs:
// > png_set_add_alpha @ 0x870c8e
// > png_write_png @ 0x873308
// > png_write_png @ 0x873360
//
// 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:58 +0000
//
int __fastcall png_set_filler(int result, __int16 a2, int a3)
{
bool v3; // zf
int v4; // r2
unsigned int v5; // r2
int v6; // r1
const char *v7; // r1
if ( !result )
return result;
if ( (*(_DWORD *)(result + 308) & 0x8000) == 0 )
{
if ( *(_BYTE *)(result + 535) )
{
if ( *(_BYTE *)(result + 535) == 2 )
{
*(_BYTE *)(result + 540) = 4;
goto LABEL_8;
}
v7 = "png_set_filler: inappropriate color type";
}
else
{
if ( *(unsigned __int8 *)(result + 536) > 7u )
{
*(_BYTE *)(result + 540) = 2;
goto LABEL_8;
}
v7 = "png_set_filler is invalid for low bit depth gray output";
}
return png_app_error(result, v7);
}
*(_WORD *)(result + 544) = a2;
LABEL_8:
v3 = a3 == 1;
v4 = *(_DWORD *)(result + 312);
if ( v3 )
v5 = v4 | 0x80;
else
v5 = v4 & 0xFFFFFF7F;
v6 = *(_DWORD *)(result + 316) | 0x8000;
*(_DWORD *)(result + 312) = v5;
*(_DWORD *)(result + 316) = v6;
return result;
}