//
// png_set_unknown_chunk_location from 0xe5ae60 to 0xe5af20 (192 bytes)
//
// 1 xrefs:
// > ??> @ 0xca8a0
//
// 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_unknown_chunk_location(__int64 result, __int64 a2, int a3, char a4)
{
int v4; // w4
__int64 i; // x2
char v9; // w4
if ( a2 != 0 && a3 >= 0 && result && a3 < *(_DWORD *)(a2 + 296) )
{
v4 = a4 & 0xB;
if ( (a4 & 0xB) != 0 )
{
result = -v4 & (unsigned int)v4;
for ( i = *(_QWORD *)(a2 + 288) + 32LL * a3; (_DWORD)result != v4; result = -v4 & (unsigned int)v4 )
v4 &= ~(_DWORD)result;
*(_BYTE *)(i + 24) = v4;
}
else
{
png_app_error(result, "invalid unknown chunk location");
result = a4 & 4;
if ( (a4 & 4) != 0 )
v9 = 8;
else
v9 = 1;
*(_BYTE *)(*(_QWORD *)(a2 + 288) + 32LL * a3 + 24) = v9;
}
}
return result;
}