//
// MusicDownloadManager::getSFXFolderPathForID from 0x140343880 to 0x140343a2b (427 bytes)
//
// 2 xrefs:
// > SFXBrowser::setupList @ 0x14047fea8
// > ??> @ 0x1406d5828
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall MusicDownloadManager::getSFXFolderPathForID(__int64 a1, __int64 a2, int a3)
{
__int64 v3; // rbx
int v5; // edi
cocos2d::CCDictionary *m_sfxObjects; // rcx
struct cocos2d::CCObject *v7; // rax
__int64 v8; // rbx
cocos2d::CCDictionary *v9; // rcx
__int64 v10; // rbx
cocos2d::CCDictionary *v11; // rcx
struct cocos2d::CCObject *v12; // rax
__int64 v13; // rdx
struct cocos2d::CCObject *v14; // rbx
__int64 v15; // rbx
cocos2d::CCDictionary *v16; // rcx
struct cocos2d::CCObject *v17; // rax
__int64 v18; // rdx
char *p_m_uAutoReleaseCount; // r8
__int64 v20; // rbx
cocos2d::CCDictionary *v21; // rcx
struct cocos2d::CCObject *v22; // rax
__int64 v23; // rbx
cocos2d::CCDictionary *v24; // rcx
struct cocos2d::CCObject *v25; // rax
v3 = a3;
v5 = 0;
*(_OWORD *)a2 = 0;
*(_QWORD *)(a2 + 16) = 0;
*(_QWORD *)(a2 + 24) = 15;
*(_BYTE *)a2 = 0;
m_sfxObjects = MusicDownloadManager::sharedState()->m_sfxObjects;
if ( !m_sfxObjects
|| (v7 = cocos2d::CCDictionary::objectForKey(m_sfxObjects, v3)) == nullptr
|| !LOBYTE(v7[1].m_nTag)
&& ((v8 = SHIDWORD(v7[1].__vftable), (v9 = MusicDownloadManager::sharedState()->m_sfxObjects) == nullptr)
|| (v7 = cocos2d::CCDictionary::objectForKey(v9, v8)) == nullptr
|| !LOBYTE(v7[1].m_nTag)) )
{
v7 = nullptr;
}
v10 = SHIDWORD(v7[1].__vftable);
v11 = MusicDownloadManager::sharedState()->m_sfxObjects;
if ( v11 )
{
v12 = cocos2d::CCDictionary::objectForKey(v11, v10);
v14 = v12;
if ( v12 )
{
if ( LOBYTE(v12[1].m_nTag)
|| (v15 = SHIDWORD(v12[1].__vftable), (v16 = MusicDownloadManager::sharedState()->m_sfxObjects) != nullptr)
&& (v17 = cocos2d::CCDictionary::objectForKey(v16, v15), (v14 = v17) != nullptr)
&& LOBYTE(v17[1].m_nTag) )
{
while ( v5 < 10 )
{
++v5;
sub_140137610((char **)a2, v13, " \\ ", 3u);
p_m_uAutoReleaseCount = (char *)&v14[1].m_uAutoReleaseCount;
if ( *(_QWORD *)&v14[1].m_uOrderOfArrival > 0xFu )
p_m_uAutoReleaseCount = *(char **)&v14[1].m_uAutoReleaseCount;
sub_140137610((char **)a2, v18, p_m_uAutoReleaseCount, *(_QWORD *)&v14[1].m_unknown2);
v20 = SHIDWORD(v14[1].__vftable);
v21 = MusicDownloadManager::sharedState()->m_sfxObjects;
if ( !v21 )
break;
v22 = cocos2d::CCDictionary::objectForKey(v21, v20);
v14 = v22;
if ( !v22 )
break;
if ( !LOBYTE(v22[1].m_nTag) )
{
v23 = SHIDWORD(v22[1].__vftable);
v24 = MusicDownloadManager::sharedState()->m_sfxObjects;
if ( !v24 )
break;
v25 = cocos2d::CCDictionary::objectForKey(v24, v23);
v14 = v25;
if ( !v25 || !LOBYTE(v25[1].m_nTag) )
break;
}
}
}
}
}
return a2;
}