//
// FMODAudioEngine::setup from 0x1003dce30 to 0x1003dd168 (824 bytes)
//
// 1 xrefs:
// > LoadingLayer::init @ 0x1003a26e2
//
// 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 FMODAudioEngine::setup(FMODAudioEngine *a1)
{
int v1; // r14d
int v2; // r15d
int v3; // r12d
int v4; // ebx
int v5; // r13d
int v6; // eax
__int64 v7; // r14
unsigned int v8; // r15d
cocos2d::CCString *v9; // rax
const char *CString; // rbx
size_t v11; // rax
size_t v12; // r13
char *v13; // r12
__int64 v14; // rax
size_t v15; // r14
__int64 v16; // rbx
__int64 v17; // [rsp+18h] [rbp-D8h]
void *v18[3]; // [rsp+20h] [rbp-D0h] BYREF
void *v19[3]; // [rsp+38h] [rbp-B8h] BYREF
void *v20[3]; // [rsp+50h] [rbp-A0h] BYREF
char v21; // [rsp+68h] [rbp-88h] BYREF
_BYTE v22[23]; // [rsp+69h] [rbp-87h] BYREF
char v23; // [rsp+80h] [rbp-70h] BYREF
_BYTE v24[23]; // [rsp+81h] [rbp-6Fh] BYREF
void *v25[3]; // [rsp+98h] [rbp-58h] BYREF
_QWORD __dst[2]; // [rsp+B0h] [rbp-40h] BYREF
void *v27; // [rsp+C0h] [rbp-30h]
FMODAudioEngine::setupAudioEngine(a1);
*(_QWORD *)&a1->m_musicVolume = 0x3F8000003F800000LL;
strcpy((char *)v20, "$achievement_01.ogg");
v1 = sub_1007AB360(v20);
strcpy((char *)v18, " playSound_01.ogg");
v2 = sub_1007AB360(v18);
strcpy((char *)v19, " quitSound_01.ogg");
v3 = sub_1007AB360(v19);
v21 = 28;
strcpy(v22, "explode_11.ogg");
v4 = sub_1007AB360(&v21);
v23 = 30;
strcpy(v24, "endStart_02.ogg");
v5 = sub_1007AB360(&v23);
strcpy((char *)v25, "$highscoreGet02.ogg");
v6 = sub_1007AB360(v25);
v7 = sub_10071FB90(v1, v2, v3, v4, v5, v6, 0);
if ( ((__int64)v25[0] & 1) != 0 )
{
operator delete(v25[2]);
if ( (v23 & 1) == 0 )
{
LABEL_3:
if ( (v21 & 1) == 0 )
goto LABEL_4;
goto LABEL_11;
}
}
else if ( (v23 & 1) == 0 )
{
goto LABEL_3;
}
operator delete(*(void **)&v24[15]);
if ( (v21 & 1) == 0 )
{
LABEL_4:
if ( ((__int64)v19[0] & 1) == 0 )
goto LABEL_5;
goto LABEL_12;
}
LABEL_11:
operator delete(*(void **)&v22[15]);
if ( ((__int64)v19[0] & 1) == 0 )
{
LABEL_5:
if ( ((__int64)v18[0] & 1) == 0 )
goto LABEL_6;
goto LABEL_13;
}
LABEL_12:
operator delete(v19[2]);
if ( ((__int64)v18[0] & 1) == 0 )
{
LABEL_6:
if ( ((__int64)v20[0] & 1) == 0 )
goto LABEL_7;
goto LABEL_14;
}
LABEL_13:
operator delete(v18[2]);
if ( ((__int64)v20[0] & 1) == 0 )
{
LABEL_7:
if ( !(unsigned int)sub_100720070(v7) )
return;
goto LABEL_15;
}
LABEL_14:
operator delete(v20[2]);
if ( (unsigned int)sub_100720070(v7) )
{
LABEL_15:
v8 = 0;
v17 = v7;
do
{
v9 = (cocos2d::CCString *)sub_1007200C0(v7, v8);
CString = cocos2d::CCString::getCString(v9);
v11 = strlen(CString);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(1.674390687123889e243);
v12 = v11;
if ( v11 >= 0x17 )
{
v14 = v11 | 7;
v15 = 26;
if ( (v12 | 7) != 0x17 )
v15 = v14 + 1;
v13 = (char *)operator new(v15);
v27 = v13;
__dst[0] = v15 + 1;
__dst[1] = v12;
v7 = v17;
}
else
{
LOBYTE(__dst[0]) = 2 * v11;
v13 = (char *)__dst + 1;
if ( !v11 )
goto LABEL_25;
}
memmove(v13, CString, v12);
LABEL_25:
v13[v12] = 0;
v16 = FMODAudioEngine::preloadEffect(a1, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(v27);
if ( v16 )
*(_BYTE *)(v16 + 44) = 1;
++v8;
}
while ( v8 < (unsigned int)sub_100720070(v7) );
}
}