//
// png_push_read_sig from 0xbceaa8 to 0xbceb68 (192 bytes)
//
// 2 xrefs:
// > png_process_some_data @ 0xbd0278
// > ??> @ 0x62280
//
// 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
//
__int64 __fastcall png_push_read_sig(unsigned __int64 a1, __int64 a2)
{
unsigned __int64 v2; // x21
__int64 v3; // x22
size_t v5; // x19
char *v6; // x1
__int64 result; // x0
v2 = *(unsigned __int8 *)(a1 + 693);
v3 = a2 + 44;
v5 = 8 - v2;
v6 = (char *)(a2 + v2 + 44);
if ( 8 - v2 > *(_QWORD *)(a1 + 936) )
v5 = *(_QWORD *)(a1 + 936);
png_push_fill_buffer(a1, v6, v5);
*(_BYTE *)(a1 + 693) += v5;
if ( (unsigned int)png_sig_cmp(v3, v2, v5) )
{
if ( v2 <= 3 )
{
if ( (unsigned int)png_sig_cmp(v3, v2, v5 - 4) )
png_error(a1, "Not a PNG file");
}
png_error(a1, "PNG file corrupted by ASCII conversion");
}
result = *(unsigned __int8 *)(a1 + 693);
if ( (unsigned int)result > 7 )
{
result = 1;
*(_DWORD *)(a1 + 952) = 1;
}
return result;
}