//
// sub_779AE8 from 0x779ae8 to 0x779b36 (78 bytes)
//
// 0 xrefs:
//
// 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
//
void __fastcall sub_779AE8(unsigned int a1, int a2)
{
void (**v2)(); // r4
unsigned int *v3; // r3
unsigned int v4; // r2
unsigned int v5; // r2
void (__fastcall *v6)(void (**)()); // r3
v2 = *(void (***)())(a2 - 32);
if ( a1 > 1 )
__cxxabiv1::__terminate(*(v2 - 27));
_cxa_free_dependent_exception((int *)(a2 - 32));
v3 = (unsigned int *)(v2 - 32);
__dmb(0xFu);
do
{
v4 = __ldrex(v3);
v5 = v4 - 1;
}
while ( __strex(v5, v3) );
__dmb(0xFu);
if ( !v5 )
{
v6 = (void (__fastcall *)(void (**)()))*(v2 - 29);
if ( v6 )
v6(v2);
_cxa_free_exception(v2);
}
}