//
// FMODAudioEngine::preloadEffect from 0x3ec284 to 0x3ec3e4 (352 bytes)
//
// 5 xrefs:
// > FMODAudioEngine::setup @ 0x3ec536
// > FMODAudioEngine::playEffectAdvanced @ 0x3f0e38
// > GJBaseGameLayer::processSFXObjects @ 0x5a601a
// > SetupSFXPopup::onClose @ 0x6afda8
// > SetupSFXPopup::createSFXWidget @ 0x6b1602
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:47:09 +0000
//
int *__fastcall FMODAudioEngine::preloadEffect(int a1, int a2)
{
int v2; // r5
int v5; // r6
int v6; // r1
char *v7; // r6
int v8; // r2
size_t v9; // r0
_BYTE *v10; // r3
cocos2d::CCString *v12; // r0
char *CString; // r0
int v14; // [sp+Ch] [bp-ACh] BYREF
int v15; // [sp+10h] [bp-A8h]
_BYTE *v16; // [sp+14h] [bp-A4h]
char v17; // [sp+18h] [bp-A0h] BYREF
char v18; // [sp+19h] [bp-9Fh] BYREF
char *v19; // [sp+20h] [bp-98h]
_DWORD v20[36]; // [sp+24h] [bp-94h] BYREF
v2 = a1 + 284;
if ( !std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_DWORD *)(a1 + 284),
(unsigned __int8 *)a2) )
{
v6 = cocos2d::CCFileUtils::sharedFileUtils(nullptr);
v7 = *(char **)(*(_DWORD *)v6 + 24);
if ( (*(_BYTE *)a2 & 1) != 0 )
v8 = *(_DWORD *)(a2 + 8);
else
v8 = a2 + 1;
((void (__fastcall *)(char *, int, int, _DWORD))v7)(&v17, v6, v8, 0);
if ( (v17 & 1) == 0 )
v7 = &v18;
v14 = 0;
if ( (v17 & 1) != 0 )
v7 = v19;
v15 = 0;
v16 = nullptr;
v9 = strlen(v7);
std::string::__init(&v14, v7, v9);
std::string::~string((int)&v17);
if ( (v14 & 1) != 0 )
{
if ( !v15 )
{
LABEL_12:
memset(v20, 0, sizeof(v20));
v20[18] = 10;
v20[0] = 144;
*(_DWORD *)(a1 + 388) = FMOD::System::createSound();
ERRCHECK_fn();
v5 = 0;
std::string::~string((int)&v14);
return (int *)v5;
}
v10 = v16;
}
else
{
if ( !((unsigned __int8)v14 >> 1) )
goto LABEL_12;
v10 = (char *)&v14 + 1;
}
if ( *v10 != 47 )
{
if ( (*(_BYTE *)a2 & 1) != 0 )
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"file:///android_asset/%s",
*(const char **)(a2 + 8));
else
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"file:///android_asset/%s",
(const char *)(a2 + 1));
CString = (char *)cocos2d::CCString::getCString(v12);
std::string::assign(&v14, CString);
}
goto LABEL_12;
}
return std::unordered_map::operator[](v2, (unsigned __int8 *)a2);
}