//
// FMODAudioEngine::setup from 0x140053bf0 to 0x1400540cb (1243 bytes)
//
// 3 xrefs:
// > LoadingLayer::init @ 0x14032e56e
// > ??> @ 0x1406c4f50
// > ??> @ 0x1406c4f5c
//
// 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
//
// Hidden C++ exception states: #wind=6
void FMODAudioEngine::setup(FMODAudioEngine *a1)
{
__int64 v2; // r15
__int64 v3; // r14
__int64 v4; // rsi
__int64 v5; // rdi
__int64 v6; // rbx
struct cocos2d::CCObject *v7; // rax
cocos2d::CCArray *v8; // rdi
void *v9; // rcx
void *v10; // rcx
void *v11; // rcx
void *v12; // rcx
void *v13; // rcx
void *v14; // rcx
unsigned int i; // ebx
cocos2d::CCString *v16; // rax
const char *CString; // rax
size_t v18; // r8
__int64 v19; // rax
__int128 v20; // [rsp+40h] [rbp-C0h] BYREF
__int64 v21; // [rsp+50h] [rbp-B0h]
__int64 v22; // [rsp+58h] [rbp-A8h]
void *v23[2]; // [rsp+68h] [rbp-98h] BYREF
__int64 v24; // [rsp+78h] [rbp-88h]
unsigned __int64 v25; // [rsp+80h] [rbp-80h]
void *v26[2]; // [rsp+88h] [rbp-78h] BYREF
__int64 v27; // [rsp+98h] [rbp-68h]
unsigned __int64 v28; // [rsp+A0h] [rbp-60h]
void *Block[2]; // [rsp+A8h] [rbp-58h] BYREF
__int64 v30; // [rsp+B8h] [rbp-48h]
unsigned __int64 v31; // [rsp+C0h] [rbp-40h]
void *v32[2]; // [rsp+C8h] [rbp-38h] BYREF
__int64 v33; // [rsp+D8h] [rbp-28h]
unsigned __int64 v34; // [rsp+E0h] [rbp-20h]
void *v35[2]; // [rsp+E8h] [rbp-18h] BYREF
__int64 v36; // [rsp+F8h] [rbp-8h]
unsigned __int64 v37; // [rsp+100h] [rbp+0h]
void *v38[2]; // [rsp+108h] [rbp+8h] BYREF
__int64 v39; // [rsp+118h] [rbp+18h]
unsigned __int64 v40; // [rsp+120h] [rbp+20h]
FMODAudioEngine::setupAudioEngine(a1);
a1->m_sfxVolume = 1.0;
a1->m_musicVolume = 1.0;
*(_OWORD *)v38 = 0;
v39 = 0;
v40 = 15;
v38[0] = sub_14003AA10(0x20u);
v39 = 18;
v40 = 31;
strcpy((char *)v38[0], "highscoreGet02.ogg");
v24 = 15;
v25 = 15;
strcpy((char *)v23, "endStart_02.ogg");
v27 = 14;
v28 = 15;
strcpy((char *)v26, "explode_11.ogg");
HIBYTE(v26[1]) = 0;
*(_OWORD *)v35 = 0;
v37 = 15;
v35[0] = sub_14003AA10(0x20u);
v36 = 16;
v37 = 31;
strcpy((char *)v35[0], "quitSound_01.ogg");
*(_OWORD *)v32 = 0;
v32[0] = sub_14003AA10(0x20u);
v33 = 16;
v34 = 31;
strcpy((char *)v32[0], "playSound_01.ogg");
*(_OWORD *)Block = 0;
Block[0] = sub_14003AA10(0x20u);
v30 = 18;
v31 = 31;
strcpy((char *)Block[0], "achievement_01.ogg");
v2 = cocos2d::CCString::create(v38);
v3 = cocos2d::CCString::create(v23);
v4 = cocos2d::CCString::create(v26);
v5 = cocos2d::CCString::create(v35);
v6 = cocos2d::CCString::create(v32);
v7 = (struct cocos2d::CCObject *)cocos2d::CCString::create(Block);
v8 = cocos2d::CCArray::create(v7, v6, v5, v4, v3, v2, 0);
if ( v31 > 0xF )
{
v9 = Block[0];
if ( v31 + 1 >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
v30 = 0;
v31 = 15;
LOBYTE(Block[0]) = 0;
if ( v34 > 0xF )
{
v10 = v32[0];
if ( v34 + 1 >= 0x1000 )
{
v10 = *((void **)v32[0] - 1);
if ( (unsigned __int64)((char *)v32[0] - (char *)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
v33 = 0;
v34 = 15;
LOBYTE(v32[0]) = 0;
if ( v37 > 0xF )
{
v11 = v35[0];
if ( v37 + 1 >= 0x1000 )
{
v11 = *((void **)v35[0] - 1);
if ( (unsigned __int64)((char *)v35[0] - (char *)v11 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v11);
}
v36 = 0;
v37 = 15;
LOBYTE(v35[0]) = 0;
if ( v28 > 0xF )
{
v12 = v26[0];
if ( v28 + 1 >= 0x1000 )
{
v12 = *((void **)v26[0] - 1);
if ( (unsigned __int64)((char *)v26[0] - (char *)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
v27 = 0;
v28 = 15;
LOBYTE(v26[0]) = 0;
if ( v25 > 0xF )
{
v13 = v23[0];
if ( v25 + 1 >= 0x1000 )
{
v13 = *((void **)v23[0] - 1);
if ( (unsigned __int64)((char *)v23[0] - (char *)v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v13);
}
v24 = 0;
v25 = 15;
LOBYTE(v23[0]) = 0;
if ( v40 > 0xF )
{
v14 = v38[0];
if ( v40 + 1 >= 0x1000 )
{
v14 = *((void **)v38[0] - 1);
if ( (unsigned __int64)((char *)v38[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
v39 = 0;
v40 = 15;
LOBYTE(v38[0]) = 0;
for ( i = 0; i < cocos2d::CCArray::count(v8); ++i )
{
v16 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v8, i);
CString = cocos2d::CCString::getCString(v16);
v20 = 0;
v21 = 0;
v22 = 0;
v18 = -1;
do
++v18;
while ( CString[v18] );
sub_14003A930(&v20, CString, v18);
v19 = FMODAudioEngine::preloadEffect(a1, &v20);
if ( v19 )
*(_BYTE *)(v19 + 52) = 1;
}
}