//
// MusicDownloadManager::getCustomSFXLocationText from 0x1006530d0 to 0x10065325b (395 bytes)
//
// 2 xrefs:
// > SFXBrowser::cellPerformedAction @ 0x100435022
// > CustomSFXWidget::onShowInfo @ 0x1006b6eac
//
// 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::getCustomSFXLocationText(std::string *this, __int64 a2, __int64 a3)
{
size_t v3; // r14
__int64 CustomSFXRoot; // rax
std::string *v5; // r15
unsigned __int128 v6; // kr00_16
char *v7; // r13
size_t v8; // r15
const std::string::value_type *data; // rsi
std::string::size_type size; // rdx
std::string *v12; // [rsp+8h] [rbp-78h]
std::string v13; // [rsp+10h] [rbp-70h] BYREF
std::string v14; // [rsp+28h] [rbp-58h] BYREF
_QWORD __dst[2]; // [rsp+40h] [rbp-40h] BYREF
void *v16; // [rsp+50h] [rbp-30h]
MusicDownloadManager::getCustomSFXRawPath(&v13, a2, a3);
v3 = std::string::rfind(&v13, 47, 0xFFFFFFFFFFFFFFFFLL);
CustomSFXRoot = MusicDownloadManager::getCustomSFXRoot(a2);
if ( (*(_BYTE *)(CustomSFXRoot + 80) & 1) != 0 )
sub_10001AD30(this, *(const void **)(CustomSFXRoot + 96), *(_QWORD *)(CustomSFXRoot + 88));
else
*this = *(std::string *)(CustomSFXRoot + 80);
if ( v3 == -1 )
goto LABEL_25;
v5 = std::string::append(this, " / ");
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
v6 = *(_OWORD *)&v13.__r_.__value_.__r.__words[1];
else
v6 = __PAIR128__((std::string *)((char *)&v13.__r_.__value_.__l.0 + 1), *(_BYTE *)&v13.__r_.__value_.__l.0 >> 1);
if ( (unsigned __int64)v6 < v3 )
v3 = v6;
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
if ( v3 >= 0x17 )
{
v12 = v5;
v8 = 26;
if ( (v3 | 7) != 0x17 )
v8 = (v3 | 7) + 1;
v7 = (char *)operator new(v8);
v16 = v7;
__dst[0] = v8 | 1;
__dst[1] = v3;
v5 = v12;
}
else
{
LOBYTE(__dst[0]) = 2 * v3;
v7 = (char *)__dst + 1;
if ( !v3 )
goto LABEL_18;
}
memmove(v7, *((const void **)&v6 + 1), v3);
LABEL_18:
v7[v3] = 0;
MusicDownloadManager::customSFXPathDisplay(&v14, (unsigned __int8 *)__dst);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
{
data = v14.__r_.__value_.__l.__data_;
size = v14.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v14.__r_.__value_.__l.0 >> 1;
data = v14.__r_.__value_.__s.__data_;
}
std::string::append(v5, data, size);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
if ( (__dst[0] & 1) != 0 )
operator delete(v16);
LABEL_25:
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v13.__r_.__value_.__l.__data_);
return this;
}