//
// MusicDownloadManager::decodeCustomSFX from 0x57688c to 0x576980 (244 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::dataLoaded @ 0x57a232
//
// 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:52:42 +0000
//
int __fastcall MusicDownloadManager::decodeCustomSFX(int a1, unsigned __int8 *a2)
{
int result; // r0
int v5; // r3
const char *v6; // r0
int v7; // r8
const char *v8; // r0
int v9; // r0
int v10; // [sp+Ch] [bp-28h] BYREF
int v11; // [sp+10h] [bp-24h] BYREF
int v12; // [sp+14h] [bp-20h] BYREF
int v13; // [sp+18h] [bp-1Ch]
int v14; // [sp+1Ch] [bp-18h]
int v15[3]; // [sp+20h] [bp-14h] BYREF
result = *a2;
if ( (result & 1) != 0 )
v5 = *((_DWORD *)a2 + 1);
else
v5 = result >> 1;
if ( v5 )
{
v12 = 0;
v13 = 0;
v14 = 0;
sub_56DAB4(a2, "|", &v12);
if ( (unsigned int)(-1431655765 * ((v13 - v12) >> 2)) > 2 )
{
v6 = (*(_BYTE *)v12 & 1) != 0 ? *(const char **)(v12 + 8) : (const char *)(v12 + 1);
if ( atoi(v6) <= 1 )
{
v7 = *(_DWORD *)(a1 + 532);
v10 = 0;
v11 = 0;
memset(v15, 0, sizeof(v15));
std::string::__init(v15, &unk_B6B226, 0);
MusicDownloadManager::importCustomSFXSetup((cocos2d::CCDictionary **)a1, a2, (int)v15, 0, &v10, &v11);
std::string::~string((int)v15);
MusicDownloadManager::getCustomSFXRoot((cocos2d::CCDictionary **)a1);
if ( (byte_9[v12 + 3] & 1) != 0 )
v8 = *(const char **)(v12 + 20);
else
v8 = (const char *)(v12 + 13);
v9 = atoi(v8);
if ( (unsigned int)(v9 - 3) <= 0xFFFFFC && (!v7 || v9 > *(_DWORD *)(a1 + 536)) )
*(_DWORD *)(a1 + 536) = v9;
MusicDownloadManager::syncCustomSFXPlacements((cocos2d::CCDictionary *)a1);
}
}
return std::__vector_base::~__vector_base((int)&v12);
}
return result;
}