//
// FMODAudioEngine::createStream from 0x3e965c to 0x3e97d8 (380 bytes)
//
// 1 xrefs:
// > FMODAudioEngine::preloadMusic @ 0x3ef948
//
// 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:06 +0000
//
FMOD::Sound *__fastcall FMODAudioEngine::createStream(cocos2d::CCFileUtils *a1, unsigned __int8 *a2)
{
char *v2; // r9
int v5; // r1
unsigned __int8 *v6; // r2
size_t v7; // r0
int v8; // r3
unsigned __int8 *v9; // r10
unsigned int v10; // r3
_BYTE *v11; // r3
FMOD::Sound *v12; // r5
int v13; // r3
FMOD::Sound *v14; // r4
cocos2d::CCString *v16; // r0
char *CString; // r0
FMOD::Sound *v18; // [sp+14h] [bp-B4h] BYREF
int v19; // [sp+1Ch] [bp-ACh] BYREF
int v20; // [sp+20h] [bp-A8h]
_BYTE *v21; // [sp+24h] [bp-A4h]
char v22; // [sp+28h] [bp-A0h] BYREF
char v23; // [sp+29h] [bp-9Fh] BYREF
char *v24; // [sp+30h] [bp-98h]
_DWORD v25[36]; // [sp+34h] [bp-94h] BYREF
v5 = cocos2d::CCFileUtils::sharedFileUtils(a1);
if ( (*a2 & 1) != 0 )
v6 = *((unsigned __int8 **)a2 + 2);
else
v6 = a2 + 1;
(*(void (__fastcall **)(char *, int, unsigned __int8 *, _DWORD))(*(_DWORD *)v5 + 24))(&v22, v5, v6, 0);
if ( (v22 & 1) == 0 )
v2 = &v23;
v19 = 0;
if ( (v22 & 1) != 0 )
v2 = v24;
v20 = 0;
v21 = nullptr;
v7 = strlen(v2);
std::string::__init(&v19, v2, v7);
std::string::~string((int)&v22);
if ( (v19 & 1) != 0 )
{
if ( !v20 )
goto LABEL_10;
v11 = v21;
}
else
{
if ( !((unsigned __int8)v19 >> 1) )
goto LABEL_10;
v11 = (char *)&v19 + 1;
}
if ( *v11 != 47 )
{
if ( (*a2 & 1) != 0 )
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"file:///android_asset/%s",
*((const char **)a2 + 2));
else
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"file:///android_asset/%s",
(const char *)a2 + 1);
CString = (char *)cocos2d::CCString::getCString(v16);
std::string::assign(&v19, CString);
}
LABEL_10:
memset(v25, 0, sizeof(v25));
v8 = *a2;
v25[0] = 144;
if ( (v8 & 1) != 0 )
{
v9 = *((unsigned __int8 **)a2 + 2);
v10 = *((_DWORD *)a2 + 1);
}
else
{
v9 = a2 + 1;
v10 = v8 >> 1;
}
if ( v10 <= 3
|| (v12 = (FMOD::Sound *)&v9[v10],
std::__search(
(unsigned __int8 **)&v18,
v9,
&v9[v10],
".ogg",
(unsigned __int8 *)"",
(int (__fastcall *)(int, _DWORD))std::char_traits::eq),
v18 == v12)
|| v18 - (FMOD::Sound *)v9 == -1 )
{
v13 = 22;
}
else
{
v13 = 10;
}
v25[18] = v13;
*((_DWORD *)a1 + 97) = FMOD::System::createStream();
ERRCHECK_fn();
if ( *((_DWORD *)a1 + 97) )
{
v14 = nullptr;
}
else
{
FMOD::Sound::setLoopCount(v18, 0);
v14 = v18;
}
std::string::~string((int)&v19);
return v14;
}