//
// MoreOptionsLayer::onFMODDebug from 0x7c7544 to 0x7c76f0 (428 bytes)
//
// 3 xrefs:
// > ??> @ 0x842a0
// > MoreOptionsLayer::init @ 0x7cb820
// > ??> @ 0x122c740
//
// 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 MoreOptionsLayer::onFMODDebug(MoreOptionsLayer *a1, cocos2d::CCObject *a2)
{
FMODAudioEngine *v2; // x0
FLAlertLayer *v3; // x22
void *v4; // x0
char *v5; // x0
unsigned int *v6; // x1
int v7; // w2
unsigned int *v8; // x1
int v9; // w2
char *v10; // [xsp+48h] [xbp+48h] BYREF
__int64 v11; // [xsp+50h] [xbp+50h] BYREF
v2 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::getFMODStatus(v2, (__int64)&v10);
sub_D153B8((int)&v11, v10);
v3 = FLAlertLayer::create(0, (__int64)"FMOD Debug", (__int64)&v11);
v4 = (void *)(v11 - 24);
if ( (__int64 *)(v11 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v11 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v11 - 8);
*(_DWORD *)(v11 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v4);
}
v5 = v10 - 24;
if ( v10 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v10 - 2);
*((_DWORD *)v10 - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v5);
}
v3->show(v3);
}