//
// sub_C15E28 from 0xc15e28 to 0xc15ea4 (124 bytes)
//
// 2 xrefs:
// > jpeg_std_error @ 0xc16054
// > jpeg_std_error @ 0xc1605c
//
// 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
//
_QWORD *__fastcall sub_C15E28(_QWORD *result, int a2)
{
_QWORD *v2; // x2
__int64 v3; // x19
__int64 v4; // x0
v2 = result;
v3 = *result;
if ( a2 < 0 )
{
v4 = *(_QWORD *)(v3 + 128);
if ( !v4 || *(int *)(v3 + 124) > 2 )
{
(*(void (__fastcall **)(_QWORD *))(v3 + 16))(v2);
v4 = *(_QWORD *)(v3 + 128);
}
result = (_QWORD *)(v4 + 1);
*(_QWORD *)(v3 + 128) = result;
}
else if ( a2 <= *(_DWORD *)(v3 + 124) )
{
return (_QWORD *)(*(__int64 (**)(void))(v3 + 16))();
}
return result;
}