//
// MusicDownloadManager::customSFXPathLeaf from 0x95e868 to 0x95e9d8 (368 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::resolveSFXPlacement @ 0x9660c8
// > ??> @ 0x54eb0
//
// 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 12:57:30 +0000
//
_QWORD *__usercall MusicDownloadManager::customSFXPathLeaf@(unsigned __int8 *a1@, _QWORD *a2@)
{
int v3; // w1
int v4; // w5
size_t v5; // x2
unsigned __int8 *v6; // x1
unsigned __int8 *v7; // x4
int v8; // w1
__int64 v9; // x2
__int64 v10; // x3
__int64 v12; // x3
__int64 v13; // x2
int v14; // t1
__int64 v15; // x2
__int64 v16; // [xsp+30h] [xbp+30h] BYREF
__int64 v17; // [xsp+38h] [xbp+38h]
void *v18; // [xsp+40h] [xbp+40h]
v3 = *a1;
v4 = v3 & 1;
if ( (v3 & 1) != 0 )
{
v5 = *((_QWORD *)a1 + 1);
v6 = *((unsigned __int8 **)a1 + 2);
v7 = v6;
if ( !v5 || (v12 = (__int64)&v6[v5], v6 == &v6[v5]) )
{
v16 = 0;
v17 = 0;
v18 = nullptr;
LABEL_16:
std::string::__init(&v16, v6, v5);
goto LABEL_6;
}
}
else
{
v8 = v3 >> 1;
if ( !v8 )
goto LABEL_5;
v7 = a1 + 1;
v12 = (__int64)&a1[v8 + 1];
if ( a1 + 1 == (unsigned __int8 *)v12 )
goto LABEL_5;
}
v13 = v12 - 1;
if ( *(_BYTE *)(v12 - 1) != 47 )
{
while ( (unsigned __int8 *)v13 != v7 )
{
v14 = *(unsigned __int8 *)--v13;
if ( v14 == 47 )
goto LABEL_19;
}
LABEL_14:
v16 = 0;
v17 = 0;
v18 = nullptr;
if ( v4 )
{
v6 = *((unsigned __int8 **)a1 + 2);
v5 = *((_QWORD *)a1 + 1);
goto LABEL_16;
}
LABEL_5:
v9 = *(_QWORD *)a1;
v10 = *((_QWORD *)a1 + 1);
v18 = *((void **)a1 + 2);
v16 = v9;
v17 = v10;
goto LABEL_6;
}
LABEL_19:
v15 = v13 - (_QWORD)v7;
if ( v15 == -1 )
goto LABEL_14;
std::string::basic_string(&v16, (__int64)a1, v15 + 1, 0xFFFFFFFFFFFFFFFFLL);
LABEL_6:
LevelTools::base64DecodeString((__int64)&v16, a2);
if ( (v16 & 1) != 0 )
operator delete(v18);
return a2;
}