//
// sub_CEFD3C from 0xcefd3c to 0xceff80 (580 bytes)
//
// 1 xrefs:
// > sub_CEFF80 @ 0xceff80
//
// 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_CEFD3C(_QWORD *a1, long double a2)
{
__int64 v4; // x1
__int64 v5; // x2
char *v6; // x19
__int64 v7; // x21
__int64 v8; // x22
_BYTE *v9; // x24
__int64 v10; // x4
char v11; // w1
char *v12; // x19
__int64 v13; // x0
char v15[8]; // [xsp+70h] [xbp+70h] BYREF
_QWORD *v16; // [xsp+78h] [xbp+78h]
sub_CEE150((__int64)v15, a1);
if ( v15[0] )
{
v6 = (char *)a1 + *(_QWORD *)(*a1 - 24LL);
v7 = *((_QWORD *)v6 + 31);
if ( !v7 )
sub_D13870(*a1, v4, v5);
v8 = *((_QWORD *)v6 + 29);
if ( v6[225] )
{
v10 = (unsigned __int8)v6[224];
}
else
{
v9 = *((_BYTE **)v6 + 30);
if ( !v9 )
sub_D13870((unsigned __int8)v6[225], v4, v5);
if ( v9[56] )
{
v10 = (unsigned __int8)v9[89];
}
else
{
sub_D204B0(*((_QWORD *)v6 + 30));
v10 = (*(unsigned __int8 (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)v9 + 48LL))(v9, 32);
}
v6[224] = v10;
v6[225] = 1;
}
(*(void (__fastcall **)(__int64, __int64, bool, char *, __int64, long double))(*(_QWORD *)v7 + 64LL))(
v7,
v8,
v8 == 0,
v6,
v10,
a2);
if ( v11 )
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24LL), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24LL) + 32) | 1);
}
v12 = (char *)v16 + *(_QWORD *)(*v16 - 24LL);
if ( (*((_DWORD *)v12 + 6) & 0x2000) == 0 )
return a1;
if ( std::uncaught_exception() )
return a1;
v13 = *((_QWORD *)v12 + 29);
if ( !v13 || (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v13 + 48LL))(v13) != -1 )
return a1;
sub_CCE830((__int64)v16 + *(_QWORD *)(*v16 - 24LL), *(_DWORD *)((char *)v16 + *(_QWORD *)(*v16 - 24LL) + 32) | 1);
return a1;
}