//
// jpeg_start_output from 0xc04d48 to 0xc04dc8 (128 bytes)
//
// 1 xrefs:
// > ??> @ 0x620b8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__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_C048F4(a1);
}