//
// sub_E86218 from 0xe86218 to 0xe86330 (280 bytes)
//
// 4 xrefs:
// > sub_E86CE0 @ 0xe87050
// > jinit_marker_reader @ 0xe88fe0
// > jinit_marker_reader @ 0xe88ff0
// > jpeg_save_markers @ 0xe8910c
//
// 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:48 +0000
//
__int64 __fastcall sub_E86218(_QWORD *a1)
{
unsigned __int8 **v1; // x23
unsigned __int8 *v2; // x1
unsigned __int8 *v4; // x22
unsigned __int8 v5; // w19
unsigned __int8 *v6; // x20
unsigned __int8 *v7; // x22
unsigned __int64 v8; // x19
__int64 v9; // x2
unsigned int v10; // t1
__int64 v11; // x19
v1 = (unsigned __int8 **)a1[5];
v2 = v1[1];
v4 = *v1;
if ( !v2 )
{
if ( !((unsigned int (*)(void))v1[3])() )
return 0;
v4 = *v1;
v2 = v1[1];
}
v5 = *v4;
v6 = v2 - 1;
v7 = v4 + 1;
v8 = (unsigned __int64)v5 << 8;
if ( v2 == (_BYTE *)&dword_0 + 1 )
{
if ( ((unsigned int (__fastcall *)(_QWORD *))v1[3])(a1) )
{
v7 = *v1;
v6 = v1[1];
goto LABEL_5;
}
return 0;
}
LABEL_5:
v9 = *a1;
v10 = *v7;
*(_DWORD *)(v9 + 44) = *((_DWORD *)a1 + 143);
*(_DWORD *)(v9 + 40) = 93;
v11 = v10 + v8 - 2;
*(_DWORD *)(*a1 + 48LL) = v11;
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 8LL))(a1, 1);
*v1 = v7 + 1;
v1[1] = v6 - 1;
if ( v11 > 0 )
(*(void (__fastcall **)(_QWORD *, __int64))(a1[5] + 32LL))(a1, v11);
return 1;
}