//
// sub_E7C7FC from 0xe7c7fc to 0xe7c86c (112 bytes)
//
// 2 xrefs:
// > jpeg_stdio_src @ 0xe7c958
// > jpeg_mem_src @ 0xe7ca14
//
// 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:43 +0000
//
__int64 __fastcall sub_E7C7FC(__int64 result, __int64 a2)
{
__int64 v2; // x19
__int64 v3; // x21
__int64 *v4; // x20
__int64 i; // x1
v2 = a2;
v3 = result;
v4 = *(__int64 **)(result + 40);
if ( a2 > 0 )
{
for ( i = v4[1]; i < v2; i = v4[1] )
{
v2 -= i;
((void (__fastcall *)(__int64))v4[3])(v3);
}
result = *v4;
v4[1] = i - v2;
*v4 = result + v2;
}
return result;
}