//
// MusicDownloadManager::encodeCustomSFXMappingEntries from 0x1001d7964 to 0x1001d7a84 (288 bytes)
//
// 2 xrefs:
// > sub_1003FC928 @ 0x1003fde38
// > sub_1004C97AC @ 0x1004c9a84
//
// 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
//
std::string *__usercall MusicDownloadManager::encodeCustomSFXMappingEntries@(
std::string *result@,
__int64 a2@)
{
std::string::size_type *p_size; // x20
std::string::size_type *v4; // x22
__int64 v5; // x8
int v6; // w11
const std::string::value_type *v7; // x1
std::string::size_type v8; // x2
std::string::size_type *v9; // x9
std::string::size_type *v10; // x8
bool v11; // zf
char __str[32]; // [xsp+18h] [xbp-48h] BYREF
*(_QWORD *)a2 = 0;
*(_QWORD *)(a2 + 8) = 0;
*(_QWORD *)(a2 + 16) = 0;
p_size = &result->__r_.__value_.__l.__size_;
v4 = (std::string::size_type *)result->__r_.__value_.__r.__words[0];
if ( (std::string::size_type *)result->__r_.__value_.__l.__data_ != &result->__r_.__value_.__r.__words[1] )
{
do
{
v5 = *(unsigned __int8 *)(a2 + 23);
if ( (v5 & 0x80u) != 0LL )
v5 = *(_QWORD *)(a2 + 8);
if ( v5 )
std::string::push_back((std::string *)a2, 124);
snprintf(__str, 0x20u, "%d:%d:", *((_DWORD *)v4 + 8), *((_DWORD *)v4 + 9));
std::string::append((std::string *)a2, __str);
v6 = *((char *)v4 + 63);
if ( v6 >= 0 )
v7 = (const std::string::value_type *)(v4 + 5);
else
v7 = (const std::string::value_type *)v4[5];
if ( v6 >= 0 )
v8 = *((unsigned __int8 *)v4 + 63);
else
v8 = v4[6];
result = std::string::append((std::string *)a2, v7, v8);
v9 = (std::string::size_type *)v4[1];
if ( v9 )
{
do
{
v10 = v9;
v9 = (std::string::size_type *)*v9;
}
while ( v9 );
}
else
{
do
{
v10 = (std::string::size_type *)v4[2];
v11 = *v10 == (_QWORD)v4;
v4 = v10;
}
while ( !v11 );
}
v4 = v10;
}
while ( v10 != p_size );
}
return result;
}