//
// png_set_bKGD from 0x65f6bc to 0x65f6f6 (58 bytes)
//
// 1 xrefs:
// > png_handle_bKGD @ 0x65d92c
//
// 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_set_bKGD(int a1, int a2, int a3)
{
bool v3; // zf
int v4; // r3
int result; // r0
int v6; // r3
__int16 v7; // r2
v3 = a3 == 0;
if ( a3 )
v3 = a2 == 0;
v4 = v3;
if ( a1 )
result = v4;
else
result = v4 | 1;
if ( !result )
{
result = *(_DWORD *)(a3 + 4);
v6 = *(_DWORD *)(a2 + 8);
*(_DWORD *)(a2 + 170) = *(_DWORD *)a3;
*(_DWORD *)(a2 + 174) = result;
v7 = *(_WORD *)(a3 + 8);
*(_DWORD *)(a2 + 8) = v6 | 0x20;
*(_WORD *)(a2 + 178) = v7;
}
return result;
}