//
// jpeg_finish_decompress from 0xe7a9c0 to 0xe7aab4 (244 bytes)
//
// 1 xrefs:
// > ??> @ 0xace40
//
// 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:42 +0000
//
__int64 __fastcall jpeg_finish_decompress(__int64 a1)
{
int v1; // w1
__int64 v3; // x1
unsigned int v4; // w20
void (__fastcall **v6)(__int64); // x2
void (__fastcall *v7)(__int64); // x2
v1 = *(_DWORD *)(a1 + 36);
if ( (unsigned int)(v1 - 205) > 1 )
{
if ( v1 == 207 )
{
*(_DWORD *)(a1 + 36) = 210;
goto LABEL_6;
}
if ( v1 == 210 )
goto LABEL_6;
goto LABEL_11;
}
if ( *(_DWORD *)(a1 + 88) )
{
LABEL_11:
v6 = *(void (__fastcall ***)(__int64))a1;
*((_DWORD *)v6 + 11) = v1;
*((_DWORD *)v6 + 10) = 21;
(**(void (__fastcall ***)(__int64))a1)(a1);
goto LABEL_6;
}
if ( *(_DWORD *)(a1 + 168) < *(_DWORD *)(a1 + 140) )
{
v7 = **(void (__fastcall ***)(__int64))a1;
*(_DWORD *)(*(_QWORD *)a1 + 40LL) = 69;
v7(a1);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)(a1 + 576) + 8LL))(a1);
*(_DWORD *)(a1 + 36) = 210;
LABEL_6:
while ( 1 )
{
v3 = *(_QWORD *)(a1 + 608);
v4 = *(_DWORD *)(v3 + 36);
if ( v4 )
break;
if ( !(*(unsigned int (__fastcall **)(__int64))v3)(a1) )
return v4;
}
v4 = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)(a1 + 40) + 48LL))(a1);
jpeg_abort(a1);
return v4;
}