//
// __cxa_free_dependent_exception_0 from 0xf8a0a0 to 0xf8a1d0 (304 bytes)
//
// 9 xrefs:
// > __cxa_free_exception @ 0xf88398
// > __cxa_free_dependent_exception @ 0xf883e8
// > __cxa_throw @ 0xf884b4
// > __cxa_end_catch @ 0xf885e8
// > __cxa_end_catch @ 0xf88618
// > __cxa_decrement_exception_refcount @ 0xf8868c
// > sub_F889A0 @ 0xf889e8
// > sub_F889A0 @ 0xf889f8
// > sub_F88B54 @ 0xf88b5c
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:13:55 +0000
//
void __fastcall _cxa_free_dependent_exception_0(int *p)
{
int *v2; // x20
int *v3; // x11
int *v4; // x10
__int64 v5; // x12
__int64 v6; // x13
int *v7; // x12
if ( p < dword_1565F60 || p >= &dword_1566160 )
{
free(p);
}
else
{
v2 = p - 1;
pthread_mutex_lock(&stru_1565F30);
if ( !qword_1565F58 || (int *)qword_1565F58 == &dword_1566160 )
{
LABEL_10:
*(_WORD *)v2 = ((unsigned int)qword_1565F58 - (unsigned int)dword_1565F60) >> 2;
qword_1565F58 = (__int64)(p - 1);
}
else
{
v3 = nullptr;
v4 = (int *)qword_1565F58;
while ( 1 )
{
v5 = *((unsigned __int16 *)v4 + 1);
if ( &v4[v5] == v2 )
{
*((_WORD *)v4 + 1) = *((_WORD *)p - 1) + v5;
goto LABEL_16;
}
v6 = *((unsigned __int16 *)p - 1);
if ( &v2[v6] == v4 )
break;
v7 = &dword_1565F60[*(unsigned __int16 *)v4];
if ( v7 )
{
v3 = v4;
v4 = &dword_1565F60[*(unsigned __int16 *)v4];
if ( v7 != &dword_1566160 )
continue;
}
goto LABEL_10;
}
*((_WORD *)p - 1) = v6 + v5;
if ( v3 )
{
*(_WORD *)v3 = ((unsigned int)v2 - (unsigned int)dword_1565F60) >> 2;
}
else
{
qword_1565F58 = (__int64)(p - 1);
*(_WORD *)v2 = *(_WORD *)v4;
}
}
LABEL_16:
pthread_mutex_unlock(&stru_1565F30);
}
}