//
// MusicDownloadManager::pathForSongFolder from 0x100156bd4 to 0x100156cd0 (252 bytes)
//
// 3 xrefs:
// > MusicDownloadManager::pathForSong @ 0x100156154
// > MusicDownloadManager::onDownloadMusicLibraryCompleted @ 0x100157f08
// > MusicDownloadManager::parseMusicLibrary @ 0x10015802c
//
// 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
//
double __usercall MusicDownloadManager::pathForSongFolder@(__int64 a1@, int a2@, __int64 a3@)
{
double result; // d0
GameManager *v7; // x0
cocos2d::CCFileUtils *v8; // x0
cocos2d::CCFileUtils *v9; // x0
__int128 v10; // [xsp+8h] [xbp-38h] BYREF
__int64 v11; // [xsp+18h] [xbp-28h]
sub_100009900((_QWORD *)a3, "");
LODWORD(v10) = a2;
if ( sub_100018814((_QWORD *)(a1 + 520), (int *)&v10) )
{
std::string::append((std::string *)a3, "songs/");
}
else
{
v7 = GameManager::sharedState();
if ( GameManager::getGameVariable(v7, "0033") )
{
v8 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(__int128 *__return_ptr))v8->isAbsolutePath)(&v10);
if ( *(char *)(a3 + 23) < 0 )
operator delete(*(void **)a3);
*(_OWORD *)a3 = v10;
*(_QWORD *)(a3 + 16) = v11;
std::string::append((std::string *)a3, "Resources\\");
}
else
{
v9 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(__int128 *__return_ptr))v9->init)(&v10);
if ( *(char *)(a3 + 23) < 0 )
operator delete(*(void **)a3);
result = *(double *)&v10;
*(_OWORD *)a3 = v10;
*(_QWORD *)(a3 + 16) = v11;
}
}
return result;
}