//
// MusicDownloadManager::customSFXPathDisplay from 0x100652b50 to 0x100652cfa (426 bytes)
//
// 2 xrefs:
// > sub_1006527D0 @ 0x10065296a
// > MusicDownloadManager::getCustomSFXLocationText @ 0x1006531f1
//
// This function is hookable on this platform (idp: pc, 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:34:50 +0000
//
std::string *__fastcall MusicDownloadManager::customSFXPathDisplay(std::string *this, unsigned __int8 *a2)
{
void **v3; // r14
__int64 v4; // r13
__int64 v5; // r12
unsigned int v6; // eax
const std::string::value_type *data; // rsi
std::string::size_type size; // rdx
void **v9; // r15
void **v10; // rdi
std::string v12; // [rsp+0h] [rbp-70h] BYREF
std::string v13; // [rsp+18h] [rbp-58h] BYREF
void *v14[2]; // [rsp+30h] [rbp-40h] BYREF
__int64 v15; // [rsp+40h] [rbp-30h]
*(_OWORD *)v14 = 0;
v15 = 0;
sub_10064E0E0(a2, "/", (__int64)v14);
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
v3 = (void **)v14[0];
if ( v14[1] != v14[0] )
{
v4 = (0xAAAAAAAAAAAAAAABLL * (((char *)v14[1] - (char *)v14[0]) >> 3) == 0)
- 0x5555555555555555LL * (((char *)v14[1] - (char *)v14[0]) >> 3);
v5 = 0;
while ( 1 )
{
v6 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v6 & 1) == 0 )
break;
if ( this->__r_.__value_.__l.__size_ )
goto LABEL_8;
LABEL_9:
if ( (*((_BYTE *)v14[0] + v5) & 1) != 0 )
sub_10001AD30(&v12, *(const void **)((char *)v14[0] + v5 + 16), *(_QWORD *)((char *)v14[0] + v5 + 8));
else
v12 = *(std::string *)((char *)v14[0] + v5);
LevelTools::base64DecodeString(&v13, &v12);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
{
data = v13.__r_.__value_.__l.__data_;
size = v13.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v13.__r_.__value_.__l.0 >> 1;
data = v13.__r_.__value_.__s.__data_;
}
std::string::append(this, data, size);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v13.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
LABEL_19:
operator delete(v12.__r_.__value_.__l.__data_);
}
else if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
{
goto LABEL_19;
}
v5 += 24;
if ( !--v4 )
{
v3 = (void **)v14[0];
goto LABEL_21;
}
}
if ( !(v6 >> 1) )
goto LABEL_9;
LABEL_8:
std::string::append(this, " / ");
goto LABEL_9;
}
LABEL_21:
if ( v3 )
{
v9 = (void **)v14[1];
v10 = v3;
if ( v14[1] != v3 )
{
do
{
if ( (*(_BYTE *)(v9 - 3) & 1) != 0 )
operator delete(*(v9 - 1));
v9 -= 3;
}
while ( v9 != v3 );
v10 = (void **)v14[0];
}
v14[1] = v3;
operator delete(v10);
}
return this;
}