//
// __cxa_current_primary_exception from 0xf88800 to 0xf88880 (128 bytes)
//
// 3 xrefs:
// > std::nested_exception::nested_exception @ 0xf41f54
// > std::current_exception @ 0xf41f78
// > ??> @ 0x84b80
//
// 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:54 +0000
//
unsigned __int64 **_cxa_current_primary_exception()
{
unsigned __int64 **result; // x0
unsigned __int64 *v1; // x8
unsigned __int64 v2; // x9
result = (unsigned __int64 **)_cxa_get_globals_fast();
if ( result )
{
v1 = *result;
if ( *result )
{
if ( v1[11] >> 8 == 0x434C4E47432B2BLL )
{
if ( (unsigned __int8)v1[11] == 1 )
v1 = (unsigned __int64 *)(*v1 - 120);
result = (unsigned __int64 **)(v1 + 15);
do
v2 = __ldaxr(v1);
while ( __stlxr(v2 + 1, v1) );
}
else
{
return nullptr;
}
}
else
{
return nullptr;
}
}
return result;
}