//
// sub_100660D50 from 0x100660d50 to 0x100660ee5 (405 bytes)
//
// 2 xrefs:
// > SFXBrowser::setupList @ 0x100430bac
// > CustomSFXWidget::onShowInfo @ 0x1006b6e25
//
// 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:56 +0000
//
std::string *__fastcall sub_100660D50(std::string *this, __int64 a2, int a3, char a4)
{
__int64 v7; // rdi
__int64 v8; // rax
__int64 v9; // r14
__int64 v10; // rdi
__int64 v11; // rax
__int64 v12; // r14
__int64 v13; // rdi
__int64 v14; // rax
__int64 v15; // rdi
__int64 v16; // rax
unsigned int v17; // r12d
unsigned int v18; // ecx
const std::string::value_type *v19; // rdx
std::string::size_type v20; // rcx
__int64 v21; // r14
__int64 v22; // rdi
__int64 v23; // rax
__int64 v24; // rdi
__int64 v25; // rax
*(_WORD *)&this->__r_.__value_.__l.0 = 0;
v7 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400);
if ( !v7
|| (v8 = cocos2d::CCDictionary::objectForKey_1(v7, a3)) == 0
|| (v9 = v8, !*(_BYTE *)(v8 + 72))
&& ((v10 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400)) == 0
|| (v11 = cocos2d::CCDictionary::objectForKey_1(v10, *(int *)(v9 + 60))) == 0
|| (v9 = v11, !*(_BYTE *)(v11 + 72))) )
{
v9 = 0;
}
if ( a4 )
{
v12 = *(int *)(v9 + 60);
v13 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400);
if ( !v13 )
return this;
v14 = cocos2d::CCDictionary::objectForKey_1(v13, v12);
if ( !v14 )
return this;
v9 = v14;
if ( !*(_BYTE *)(v14 + 72) )
{
v15 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400);
if ( !v15 )
return this;
v16 = cocos2d::CCDictionary::objectForKey_1(v15, *(int *)(v9 + 60));
if ( !v16 )
return this;
v9 = v16;
if ( !*(_BYTE *)(v16 + 72) )
return this;
}
}
else if ( !v9 )
{
return this;
}
v17 = -1;
do
{
std::string::insert(this, 0, " \\ ");
v18 = *(unsigned __int8 *)(v9 + 80);
if ( (v18 & 1) != 0 )
{
v19 = *(const std::string::value_type **)(v9 + 96);
v20 = *(_QWORD *)(v9 + 88);
}
else
{
v19 = (const std::string::value_type *)(v9 + 81);
v20 = v18 >> 1;
}
std::string::insert(this, 0, v19, v20);
v21 = *(int *)(v9 + 60);
v22 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400);
if ( !v22 )
break;
v23 = cocos2d::CCDictionary::objectForKey_1(v22, v21);
v9 = v23;
if ( !v23 )
break;
if ( !*(_BYTE *)(v23 + 72) )
{
v24 = *(_QWORD *)(MusicDownloadManager::sharedState() + 400);
if ( !v24 )
break;
v25 = cocos2d::CCDictionary::objectForKey_1(v24, *(int *)(v9 + 60));
v9 = v25;
if ( !v25 || *(_BYTE *)(v25 + 72) != 1 )
break;
}
++v17;
}
while ( v17 < 9 );
return this;
}