//
// png_push_read_sig from 0x6522f8 to 0x652368 (112 bytes)
//
// 1 xrefs:
// > png_process_some_data @ 0x653202
//
// 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_push_read_sig(int a1, int a2)
{
unsigned int v3; // r6
int v4; // r7
size_t v5; // r4
char *v6; // r1
int result; // r0
v3 = *(unsigned __int8 *)(a1 + 541);
v4 = a2 + 32;
v5 = 8 - v3;
v6 = (char *)(a2 + v3 + 32);
if ( 8 - v3 >= *(_DWORD *)(a1 + 696) )
v5 = *(_DWORD *)(a1 + 696);
png_push_fill_buffer((void *)a1, v6, v5);
*(_BYTE *)(a1 + 541) += v5;
result = png_sig_cmp(v4, v3, v5);
if ( result )
{
if ( v3 <= 3 )
{
if ( png_sig_cmp(v4, v3, v5 - 4) )
png_error(a1, "Not a PNG file");
}
png_error(a1, "PNG file corrupted by ASCII conversion");
}
if ( *(unsigned __int8 *)(a1 + 541) > 7u )
*(_DWORD *)(a1 + 704) = 1;
return result;
}