//
// sub_C03DC0 from 0xc03dc0 to 0xc03e74 (180 bytes)
//
// 1 xrefs:
// > jpeg_write_coefficients @ 0xc03f2c
//
// 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 sub_C03DC0(__int64 a1, int a2)
{
bool v2; // zf
_DWORD *v3; // x20
_DWORD *v5; // x1
void (__fastcall *v6)(__int64); // x2
int v7; // w0
__int64 result; // x0
__int64 v9; // x0
v2 = a2 == 2;
v3 = *(_DWORD **)(a1 + 520);
v5 = v3;
if ( !v2 )
{
v6 = **(void (__fastcall ***)(__int64))a1;
*(_DWORD *)(*(_QWORD *)a1 + 40LL) = 3;
v6(a1);
v5 = *(_DWORD **)(a1 + 520);
}
v7 = *(_DWORD *)(a1 + 372);
v3[4] = 0;
if ( v7 <= 1 )
{
v9 = *(_QWORD *)(a1 + 376);
if ( v5[4] >= (unsigned int)(*(_DWORD *)(a1 + 368) - 1) )
result = *(unsigned int *)(v9 + 76);
else
result = *(unsigned int *)(v9 + 12);
v5[7] = result;
v5[5] = 0;
v5[6] = 0;
}
else
{
v5[5] = 0;
v5[7] = 1;
v5[6] = 0;
return 1;
}
return result;
}