//
// __cxa_allocate_dependent_exception from 0xd1eca0 to 0xd1ed88 (232 bytes)
//
// 2 xrefs:
// > std::rethrow_exception @ 0xd1f2b0
// > ??> @ 0x30d98
//
// 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 *_cxa_allocate_dependent_exception()
{
_QWORD *v0; // x19
unsigned int v2; // w0
unsigned __int64 i; // x1
v0 = malloc(0x70u);
if ( !v0 )
{
if ( &pthread_create && pthread_mutex_lock((pthread_mutex_t *)&qword_124D300) )
sub_CEAFC4();
v2 = 0;
for ( i = qword_124B6F0; (i & 1) != 0; i >>= 1 )
{
if ( ++v2 == 64 )
std::terminate();
}
qword_124B6F0 |= 1LL << v2;
v0 = (_QWORD *)((char *)&unk_124B700 + 112 * v2);
if ( &pthread_create && pthread_mutex_unlock((pthread_mutex_t *)&qword_124D300) )
sub_CE9C50();
}
*v0 = 0;
v0[1] = 0;
v0[2] = 0;
v0[3] = 0;
v0[4] = 0;
v0[5] = 0;
v0[6] = 0;
v0[7] = 0;
v0[8] = 0;
v0[9] = 0;
v0[10] = 0;
v0[11] = 0;
v0[12] = 0;
v0[13] = 0;
return v0;
}