//
// sub_CF0B1C from 0xcf0b1c to 0xcf0cdc (448 bytes)
//
// 2 xrefs:
// > sub_CF0E8C @ 0xcf0ec8
// > sub_CF0EDC @ 0xcf0ee0
//
// 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_CF0B1C(__int64 *a1, unsigned int a2)
{
_QWORD *v4; // x0
unsigned int *v5; // x1
char *v6; // x20
__int64 v7; // x0
_BYTE v9[8]; // [xsp+40h] [xbp+40h] BYREF
_QWORD *v10; // [xsp+48h] [xbp+48h]
sub_CF0874((__int64)v9, a1);
if ( v9[0] )
{
v4 = *(_QWORD **)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v5 = (unsigned int *)v4[5];
if ( (unsigned __int64)v5 >= v4[6] )
{
a2 = (*(__int64 (__fastcall **)(_QWORD *, _QWORD))(*v4 + 104LL))(v4, a2);
}
else
{
*v5 = a2;
v4[5] = v5 + 1;
}
if ( a2 == -1 )
sub_CCF1DC((__int64)a1 + *(_QWORD *)(*a1 - 24), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32) | 1);
}
v6 = (char *)v10 + *(_QWORD *)(*v10 - 24LL);
if ( (*((_DWORD *)v6 + 6) & 0x2000) == 0 )
return a1;
if ( std::uncaught_exception() )
return a1;
v7 = *((_QWORD *)v6 + 29);
if ( !v7 || (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v7 + 48LL))(v7) != -1 )
return a1;
sub_CCF1DC((__int64)v10 + *(_QWORD *)(*v10 - 24LL), *(_DWORD *)((char *)v10 + *(_QWORD *)(*v10 - 24LL) + 32) | 1);
return a1;
}