//
// png_handle_as_unknown from 0x64da98 to 0x64dada (66 bytes)
//
// 4 xrefs:
// > png_chunk_unknown_handling @ 0x64db00
// > png_write_info_before_PLTE @ 0x6618f0
// > png_write_info @ 0x661bce
// > png_write_end @ 0x661d88
//
// 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_handle_as_unknown(int a1, void *a2)
{
bool v2; // zf
int v3; // r4
unsigned int v4; // r6
unsigned __int8 *v6; // r4
v2 = a2 == nullptr;
if ( a2 )
v2 = a1 == 0;
if ( v2 )
return 0;
v3 = *(_DWORD *)(a1 + 792);
if ( !v3 )
return 0;
v4 = *(_DWORD *)(a1 + 796);
v6 = (unsigned __int8 *)(5 * v3 + v4);
do
{
v6 -= 5;
if ( !memcmp(a2, v6, 4u) )
return v6[4];
}
while ( v4 < (unsigned int)v6 );
return 0;
}