//
// png_set_unknown_chunk_location from 0x66078c to 0x660800 (116 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_set_unknown_chunk_location(int result, int a2, int a3, char a4)
{
char v4; // r4
int v5; // r4
int v6; // r4
int v7; // r3
int i; // r2
int v12; // r2
char v13; // r4
v4 = a2;
if ( a2 )
v4 = 1;
if ( a3 < 0 )
v4 = 0;
if ( result )
v5 = v4 & 1;
else
v5 = 0;
if ( v5 && a3 < *(_DWORD *)(a2 + 240) )
{
v6 = a4 & 0xB;
if ( (a4 & 0xB) != 0 )
{
v7 = -v6 & v6;
for ( i = *(_DWORD *)(a2 + 236) + 20 * a3; v7 != v6; v7 = -v6 & v6 )
v6 &= ~v7;
*(_BYTE *)(i + 16) = v6;
}
else
{
result = png_app_error(result, "invalid unknown chunk location");
v12 = *(_DWORD *)(a2 + 236) + 20 * a3;
if ( (a4 & 4) != 0 )
v13 = 8;
else
v13 = 1;
*(_BYTE *)(v12 + 16) = v13;
}
}
return result;
}