//
// jpeg_start_output from 0xe7af08 to 0xe7af88 (128 bytes)
//
// 1 xrefs:
// > ??> @ 0x85c60
//
// 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_start_output(__int64 a1, int a2)
{
int v2; // w2
void (__fastcall **v5)(_QWORD); // x3
int v6; // [xsp+28h] [xbp+28h]
v2 = *(_DWORD *)(a1 + 36);
if ( v2 != 204 && v2 != 207 )
{
v5 = *(void (__fastcall ***)(_QWORD))a1;
v6 = a2;
*((_DWORD *)v5 + 11) = v2;
*((_DWORD *)v5 + 10) = 21;
(**(void (__fastcall ***)(__int64))a1)(a1);
a2 = v6;
}
if ( a2 <= 0 )
a2 = 1;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 608) + 36LL) && a2 > *(_DWORD *)(a1 + 172) )
a2 = *(_DWORD *)(a1 + 172);
*(_DWORD *)(a1 + 180) = a2;
return sub_E7AAB4(a1);
}