//
// __cxa_free_dependent_exception_0 from 0x980f24 to 0x981020 (252 bytes)
//
// 5 xrefs:
// > __cxa_free_exception @ 0x97fa2e
// > __cxa_free_dependent_exception @ 0x97fa56
// > __cxa_end_catch @ 0x97fc62
// > sub_97FE5C @ 0x97fe74
// > sub_97FF58 @ 0x97ff5c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:06:07 +0000
//
void __fastcall _cxa_free_dependent_exception_0(int *p)
{
int *v2; // r0
int *v3; // r3
int v4; // r12
int *v5; // r6
int *v6; // r2
int v7; // r1
int *v8; // r1
void *v9; // [sp+4h] [bp-14h] BYREF
if ( p < dword_D33D00 || p >= &dword_D33F00 )
{
j_free(p);
}
else
{
v9 = &unk_D33CF0;
pthread_mutex_lock((pthread_mutex_t *)&unk_D33CF0);
v2 = p - 1;
if ( !dword_D33CF4 || (int *)dword_D33CF4 == &dword_D33F00 )
{
LABEL_10:
*(_WORD *)v2 = (unsigned int)(dword_D33CF4 - (_DWORD)dword_D33D00) >> 2;
dword_D33CF4 = (int)(p - 1);
}
else
{
v3 = nullptr;
v4 = *((unsigned __int16 *)p - 1);
v5 = (int *)dword_D33CF4;
v6 = &v2[v4];
while ( 1 )
{
v7 = *((unsigned __int16 *)v5 + 1);
if ( &v5[v7] == v2 )
{
*((_WORD *)v5 + 1) = v7 + v4;
goto LABEL_16;
}
if ( v6 == v5 )
break;
v8 = &dword_D33D00[*(unsigned __int16 *)v5];
if ( v8 )
{
v3 = v5;
v5 = &dword_D33D00[*(unsigned __int16 *)v5];
if ( v8 != &dword_D33F00 )
continue;
}
goto LABEL_10;
}
*((_WORD *)p - 1) = v7 + v4;
if ( v3 )
{
*(_WORD *)v3 = (unsigned int)((char *)v2 - (char *)dword_D33D00) >> 2;
}
else
{
dword_D33CF4 = (int)(p - 1);
*(_WORD *)v2 = *(_WORD *)v6;
}
}
LABEL_16:
sub_981058(&v9);
}
}