//
// MusicDownloadManager::decodeCustomSFXMappingEntries from 0x574a74 to 0x574bca (342 bytes)
//
// 2 xrefs:
// > LevelSettingsObject::objectFromDict @ 0x474e1a
// > EditorSFXManager::deserializeAll @ 0x7809a8
//
// 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:41 +0000
//
int __fastcall MusicDownloadManager::decodeCustomSFXMappingEntries(unsigned __int8 *a1, int a2, int a3)
{
int v6; // r3
int result; // r0
int v8; // r3
int v9; // r5
int v10; // r10
const char *v11; // r0
int v12; // r1
const char *v13; // r0
int v14; // r0
int v15; // r2
int v16; // r2
unsigned __int8 *v17; // r0
int v18; // [sp+0h] [bp-3Ch]
int v19; // [sp+Ch] [bp-30h]
int v20[2]; // [sp+14h] [bp-28h] BYREF
int v21; // [sp+1Ch] [bp-20h] BYREF
int v22; // [sp+20h] [bp-1Ch]
int v23; // [sp+24h] [bp-18h]
int v24; // [sp+28h] [bp-14h] BYREF
int v25; // [sp+2Ch] [bp-10h]
int v26; // [sp+30h] [bp-Ch]
if ( !a3 )
{
std::__tree,std::string>,std::__map_value_compare,std::__value_type,std::string>,std::less>,true>,std::allocator,std::string>>>::destroy(
a2,
*(_DWORD **)(a2 + 4));
*(_DWORD *)(a2 + 8) = 0;
*(_DWORD *)a2 = a2 + 4;
*(_DWORD *)(a2 + 4) = 0;
}
v6 = *a1;
result = v6 << 31;
if ( (v6 & 1) != 0 )
v8 = *((_DWORD *)a1 + 1);
else
v8 = v6 >> 1;
if ( v8 )
{
v21 = 0;
v22 = 0;
v23 = 0;
sub_56DAB4(a1, "|", &v21);
v9 = 0;
v18 = -1431655765 * ((v22 - v21) >> 2);
while ( v9 != v18 && *(int *)(a2 + 8) < 1000 )
{
v24 = 0;
v25 = 0;
v26 = 0;
sub_56DAB4((unsigned __int8 *)(v21 + 12 * v9), ":", &v24);
v10 = v24;
if ( (unsigned int)(-1431655765 * ((v25 - v24) >> 2)) > 2 )
{
v11 = (*(_BYTE *)v24 & 1) != 0 ? *(const char **)&byte_8[v24] : (const char *)(v24 + 1);
v12 = atoi(v11);
v13 = (byte_9[v10 + 3] & 1) != 0 ? *(const char **)((char *)&dword_14 + v10) : (const char *)(v10 + 13);
v19 = v12;
v14 = atoi(v13);
if ( v19 > 0 && v14 > 0 )
{
v15 = *((unsigned __int8 *)&dword_18 + v10);
if ( (v15 & 1) != 0 )
v16 = *(int *)((char *)&dword_1C + v10);
else
v16 = v15 >> 1;
if ( v16 )
{
v20[0] = v19;
v20[1] = v14;
if ( !a3
|| !std::__tree,std::string>,std::__map_value_compare,std::__value_type,std::string>,std::less>,true>,std::allocator,std::string>>>::__count_unique>(
(_DWORD *)a2,
v20) )
{
v17 = (unsigned __int8 *)std::map,std::string>::operator[](a2, v20);
std::string::operator=(v17, (unsigned __int8 *)(v24 + 24));
}
}
}
}
++v9;
std::__vector_base::~__vector_base((int)&v24);
}
return std::__vector_base::~__vector_base((int)&v21);
}
return result;
}