//
// MusicDownloadManager::createCustomSFXFolder from 0x9641a4 to 0x96437c (472 bytes)
//
// 5 xrefs:
// > sub_96F3B0 @ 0x96f700
// > sub_96F3B0 @ 0x96fae0
// > SFXBrowser::setTextPopupClosed @ 0xb8f4c4
// > SFXFolderPickerPopup::setTextPopupClosed @ 0xc3c5dc
// > ??> @ 0x63e80
//
// This function is hookable on this platform (idp: arm, 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:57:35 +0000
//
cocos2d::CCObject *__fastcall MusicDownloadManager::createCustomSFXFolder(
cocos2d::CCDictionary **a1,
__int64 a2,
int a3,
int a4)
{
__int64 CustomSFXFolderForID; // x22
unsigned __int8 v8; // w1
void *v9; // x2
unsigned __int8 v10; // w0
__int64 v11; // x1
char v12; // w0
__int64 v13; // x0
__int64 v14; // x1
cocos2d::CCObject *v15; // x19
__int64 v17; // [xsp+40h] [xbp+40h] BYREF
__int64 v18; // [xsp+48h] [xbp+48h]
void *v19; // [xsp+50h] [xbp+50h]
CustomSFXFolderForID = MusicDownloadManager::getCustomSFXFolderForID((MusicDownloadManager *)a1, a3);
if ( !CustomSFXFolderForID )
CustomSFXFolderForID = MusicDownloadManager::getCustomSFXRoot((MusicDownloadManager *)a1);
sub_95E9D8(a2, &v17);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
**(_BYTE **)(a2 + 16) = 0;
*(_QWORD *)(a2 + 8) = 0;
}
else
{
*(_BYTE *)(a2 + 1) = 0;
*(_BYTE *)a2 = 0;
}
std::string::reserve((__int64 *)a2, 0);
v8 = v17;
*(_QWORD *)a2 = v17;
v9 = v19;
v10 = v8;
*(_QWORD *)(a2 + 8) = v18;
v11 = v8 >> 1;
*(_QWORD *)(a2 + 16) = v9;
if ( (v10 & 1) != 0 )
v11 = *(_QWORD *)(a2 + 8);
if ( v11 )
{
if ( (unsigned int)(a4 - 2) > 0xFFFFFD )
{
LABEL_9:
a4 = MusicDownloadManager::mintCustomSFXID((MusicDownloadManager *)a1);
goto LABEL_10;
}
}
else
{
std::string::assign((__int64 *)a2, "New Folder");
if ( (unsigned int)(a4 - 2) > 0xFFFFFD )
goto LABEL_9;
}
if ( MusicDownloadManager::getCustomSFXObject((MusicDownloadManager *)a1, a4) )
goto LABEL_9;
LABEL_10:
v12 = *(_BYTE *)a2;
v17 = 0;
v18 = 0;
v19 = nullptr;
if ( (v12 & 1) != 0 )
{
std::string::__init(&v17, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v13 = *(_QWORD *)a2;
v14 = *(_QWORD *)(a2 + 8);
v19 = *(void **)(a2 + 16);
v17 = v13;
v18 = v14;
}
v15 = (cocos2d::CCObject *)SFXFolderObject::create(a4, (char *)&v17, *(_DWORD *)(CustomSFXFolderForID + 76));
if ( (v17 & 1) != 0 )
operator delete(v19);
*((_DWORD *)v15 + 19) = a4;
cocos2d::CCDictionary::setObject(a1[103], v15, a4);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(CustomSFXFolderForID + 152), v15);
return v15;
}