//
// png_set_filler from 0xe5b458 to 0xe5b4fc (164 bytes)
//
// 4 xrefs:
// > png_set_add_alpha @ 0xe5b510
// > png_write_png @ 0xe5f0b4
// > png_write_png @ 0xe5f184
// > ??> @ 0x623f8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:10:20 +0000
//
__int64 __fastcall png_set_filler(__int64 result, __int16 a2, int a3)
{
__int64 v3; // x3
int v4; // w0
const char *v5; // x1
v3 = result;
if ( result )
{
if ( (*(_DWORD *)(result + 356) & 0x8000) != 0 )
{
*(_WORD *)(result + 696) = a2;
goto LABEL_4;
}
if ( *(_BYTE *)(result + 687) )
{
if ( *(_BYTE *)(result + 687) == 2 )
{
*(_BYTE *)(result + 692) = 4;
*(_DWORD *)(result + 364) |= 0x8000u;
v4 = *(_DWORD *)(result + 360);
if ( a3 != 1 )
goto LABEL_5;
goto LABEL_10;
}
v5 = "png_set_filler: inappropriate color type";
}
else
{
if ( *(unsigned __int8 *)(result + 688) > 7u )
{
*(_BYTE *)(result + 692) = 2;
LABEL_4:
*(_DWORD *)(result + 364) |= 0x8000u;
v4 = *(_DWORD *)(result + 360);
if ( a3 != 1 )
{
LABEL_5:
result = v4 & 0xFFFFFF7F;
*(_DWORD *)(v3 + 360) = result;
return result;
}
LABEL_10:
result = v4 | 0x80u;
*(_DWORD *)(v3 + 360) = result;
return result;
}
v5 = "png_set_filler is invalid for low bit depth gray output";
}
return png_app_error(result, v5);
}
return result;
}