//
// MusicDownloadManager::decodeCustomSFX from 0x1001d9a2c to 0x1001d9b68 (316 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::dataLoaded @ 0x1001da780
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:00:26 +0000
//
void __fastcall MusicDownloadManager::decodeCustomSFX(__int64 a1, __int64 a2)
{
__int64 v2; // x8
const char *v5; // x0
__int64 v6; // x21
const char *v7; // x0
int v8; // w0
void *__p[2]; // [xsp+8h] [xbp-58h] BYREF
char v10; // [xsp+1Fh] [xbp-41h]
__int64 v11; // [xsp+20h] [xbp-40h] BYREF
__int64 v12; // [xsp+28h] [xbp-38h] BYREF
__int64 v13; // [xsp+30h] [xbp-30h]
__int64 v14; // [xsp+38h] [xbp-28h]
v2 = *(unsigned __int8 *)(a2 + 23);
if ( (v2 & 0x80u) != 0LL )
v2 = *(_QWORD *)(a2 + 8);
if ( v2 )
{
v12 = 0;
v13 = 0;
v14 = 0;
sub_1001D45F0((std::string *)a2, "|", (__int64)&v12);
v5 = (const char *)v12;
if ( 0xAAAAAAAAAAAAAAABLL * ((v13 - v12) >> 3) >= 3 )
{
if ( *(char *)(v12 + 23) < 0 )
v5 = *(const char **)v12;
if ( atoi(v5) <= 1 )
{
v6 = *(_QWORD *)(a1 + 824);
v11 = 0;
sub_100009900(__p, "");
MusicDownloadManager::importCustomSFXSetup(a1, a2, (__int64)__p, 0, (_DWORD *)&v11 + 1, &v11);
if ( v10 < 0 )
operator delete(__p[0]);
MusicDownloadManager::getCustomSFXRoot(a1);
v7 = (const char *)(v12 + 24);
if ( *(char *)(v12 + 47) < 0 )
v7 = *(const char **)v7;
v8 = atoi(v7);
if ( (unsigned int)(v8 - 3) <= 0xFFFFFC && (!v6 || v8 > *(_DWORD *)(a1 + 832)) )
*(_DWORD *)(a1 + 832) = v8;
sub_1001D99C8(a1);
}
}
__p[0] = &v12;
sub_100018250((void ***)__p);
}
}