//
// png_get_uint_31 from 0x65c5a4 to 0x65c5c8 (36 bytes)
//
// 5 xrefs:
// > png_push_read_chunk @ 0x6526f0
// > png_push_read_IDAT @ 0x65315c
// > png_handle_IHDR @ 0x65c8cc
// > png_handle_IHDR @ 0x65c8d6
// > png_read_chunk_header @ 0x65e9a4
//
// 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_get_uint_31(int a1, unsigned __int8 *a2)
{
int v2; // r2
int v3; // r5
int v4; // r1
v2 = a2[3];
v3 = a2[2];
v4 = (a2[1] << 16) + (*a2 << 24);
if ( v4 + v2 + (v3 << 8) < 0 )
png_error(a1, "PNG unsigned integer out of range");
return v4 + v2 + (v3 << 8);
}