//
// sub_E464D8 from 0xe464d8 to 0xe46568 (144 bytes)
//
// 2 xrefs:
// > png_image_begin_read_from_memory @ 0xe4c530
// > png_image_begin_read_from_memory @ 0xe4c538
//
// 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:05 +0000
//
void *__fastcall sub_E464D8(void *result, void *a2, size_t a3)
{
__int64 v3; // x20
__int64 *v6; // x1
__int64 v7; // x3
__int64 v8; // x20
size_t v9; // x22
__int64 v10; // x21
v3 = (__int64)result;
if ( result )
{
v6 = *(__int64 **)(v3 + 320);
v7 = v3;
if ( !v6 || (v8 = *v6) == 0 )
png_error(v7, "invalid memory read");
v9 = *(_QWORD *)(v8 + 32);
v10 = *(_QWORD *)(v8 + 24);
if ( v9 < a3 || !v10 )
png_error(v7, "read beyond end of data");
result = memcpy(a2, *(const void **)(v8 + 24), a3);
*(_QWORD *)(v8 + 24) = v10 + a3;
*(_QWORD *)(v8 + 32) = v9 - a3;
}
return result;
}