//
// sub_E7C4D0 from 0xe7c4d0 to 0xe7c57c (172 bytes)
//
// 2 xrefs:
// > jpeg_mem_dest @ 0xe7c6c0
// > jpeg_mem_dest @ 0xe7c6c8
//
// 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_E7C4D0(_QWORD *a1)
{
__int64 v1; // x19
char *v3; // x20
size_t v4; // x2
void *v5; // x0
__int64 v6; // x1
void (__fastcall **v8)(_QWORD); // x1
size_t v9; // [xsp+38h] [xbp+38h]
v1 = a1[5];
v9 = *(_QWORD *)(v1 + 72);
v3 = (char *)malloc(2 * v9);
v4 = v9;
if ( !v3 )
{
v8 = (void (__fastcall **)(_QWORD))*a1;
*((_DWORD *)v8 + 11) = 10;
*((_DWORD *)v8 + 10) = 56;
(*(void (__fastcall **)(_QWORD *))*a1)(a1);
v4 = *(_QWORD *)(v1 + 72);
}
memcpy(v3, *(const void **)(v1 + 64), v4);
v5 = *(void **)(v1 + 56);
if ( v5 )
free(v5);
v6 = *(_QWORD *)(v1 + 72);
*(_QWORD *)(v1 + 72) = 2 * v9;
*(_QWORD *)(v1 + 56) = v3;
*(_QWORD *)(v1 + 8) = v6;
*(_QWORD *)v1 = &v3[v6];
*(_QWORD *)(v1 + 64) = v3;
return 1;
}