//
// SFXBrowser::sfxFolderPicked from 0x6c5148 to 0x6c53ae (614 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'SFXBrowser::sfxFolderPicked @ 0x6c53d8
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:56:54 +0000
//
int __fastcall SFXBrowser::sfxFolderPicked(_DWORD *a1, int a2, int a3, int a4)
{
FLAlertLayer *v5; // r4
int v7; // r0
const char *v8; // r6
cocos2d::CCDictionary **v9; // r8
SFXInfoObject *CustomSFXPlacement; // r6
MusicDownloadManager *v11; // r0
MusicDownloadManager *v12; // r0
int v13; // r0
int v14; // r3
int v15; // r2
cocos2d::CCString *v16; // r0
const char *v17; // r9
size_t v18; // r0
void (__fastcall *v19)(FLAlertLayer *, cocos2d::CCNode *, int); // r10
cocos2d::CCNode *v20; // r0
int v21; // r3
_DWORD *v22; // r5
int v23; // r9
_DWORD *v24; // r11
int v25; // r8
const char *v26; // r6
MusicDownloadManager *v27; // r0
MusicDownloadManager *CustomSFXObject; // r0
MusicDownloadManager *v29; // r0
MusicDownloadManager *v30; // r0
MusicDownloadManager *v31; // r0
int CustomSFXFolderForID; // r0
const char *v33; // r2
cocos2d::CCString *v34; // r0
char *CString; // r0
void (__fastcall *v36)(FLAlertLayer *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v37; // r0
int v39; // [sp+8h] [bp-2Ch] BYREF
int v40; // [sp+Ch] [bp-28h]
int v41; // [sp+10h] [bp-24h]
int v42[3]; // [sp+14h] [bp-20h] BYREF
int v43; // [sp+20h] [bp-14h] BYREF
int v44; // [sp+24h] [bp-10h]
int v45; // [sp+28h] [bp-Ch]
v5 = (FLAlertLayer *)a1;
if ( (int)a1[176] <= 0 )
{
v22 = (_DWORD *)a1[172];
v23 = 0;
v24 = a1 + 173;
v25 = 0;
v26 = nullptr;
while ( v22 != v24 )
{
v27 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)a1);
CustomSFXObject = (MusicDownloadManager *)MusicDownloadManager::getCustomSFXObject(v27, v22[4]);
if ( CustomSFXObject )
{
if ( *((_DWORD *)CustomSFXObject + 14) == a3 )
{
++v23;
}
else
{
v29 = (MusicDownloadManager *)MusicDownloadManager::sharedState(CustomSFXObject);
if ( MusicDownloadManager::moveCustomSFXObject(v29, v22[4], a3) )
++v26;
else
++v25;
}
}
a1 = std::__tree_next *>(v22);
v22 = a1;
}
std::__tree::clear((int)v5 + 688);
v31 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v30);
CustomSFXFolderForID = MusicDownloadManager::getCustomSFXFolderForID(v31, a3);
if ( CustomSFXFolderForID )
{
if ( (*(_BYTE *)(CustomSFXFolderForID + 76) & 1) != 0 )
v33 = *(const char **)(CustomSFXFolderForID + 84);
else
v33 = (const char *)(CustomSFXFolderForID + 77);
}
else
{
v33 = "folder";
}
v39 = 0;
v40 = 0;
v41 = 0;
if ( v26 )
{
if ( !v25 )
goto LABEL_33;
}
else if ( !v25 )
{
if ( v23 )
{
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Already in %s", v33);
LABEL_30:
CString = (char *)cocos2d::CCString::getCString(v34);
std::string::assign(&v39, CString);
v36 = *(void (__fastcall **)(FLAlertLayer *, cocos2d::CCNode *, int))(*(_DWORD *)v5 + 232);
std::string::basic_string(v42, (int)&v39);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, &unk_B6B226, 0);
v37 = TextAlertPopup::create((int)v42, (cocos2d::CCDelayTime *)0x3F400000, 0.5, 150, (int)&v43);
v36(v5, v37, 100);
std::string::~string((int)&v43);
std::string::~string((int)v42);
FLAlertLayer::requestRebuild(v5);
return std::string::~string((int)&v39);
}
LABEL_33:
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Moved %i to %s", v26, v33);
goto LABEL_30;
}
v34 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Moved %i to %s, skipped %i",
v26,
v33,
v25);
goto LABEL_30;
}
v7 = MusicDownloadManager::sharedState((MusicDownloadManager *)a1);
v8 = *((const char **)v5 + 176);
v9 = (cocos2d::CCDictionary **)v7;
std::string::basic_string(&v43, a4);
CustomSFXPlacement = MusicDownloadManager::createCustomSFXPlacement(
v9,
v8,
a3,
(unsigned __int8 *)&v43,
*((_DWORD *)v5 + 177));
v11 = (MusicDownloadManager *)std::string::~string((int)&v43);
*((_DWORD *)v5 + 176) = 0;
*((_DWORD *)v5 + 177) = 0;
v12 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v11);
v13 = MusicDownloadManager::getCustomSFXFolderForID(v12, *((_DWORD *)CustomSFXPlacement + 14));
if ( v13 )
{
v14 = *(unsigned __int8 *)(v13 + 76);
v15 = v14 << 31;
if ( (v14 & 1) != 0 )
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Added to %s",
*(const char **)(v13 + 84),
v15);
else
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Added to %s",
(const char *)(v13 + 77),
v15);
v17 = (const char *)cocos2d::CCString::getCString(v16);
}
else
{
v17 = "Sound added";
}
v39 = 0;
v40 = 0;
v41 = 0;
v18 = strlen(v17);
std::string::__init(&v39, v17, v18);
v19 = *(void (__fastcall **)(FLAlertLayer *, cocos2d::CCNode *, int))(*(_DWORD *)v5 + 232);
std::string::basic_string(v42, (int)&v39);
v43 = 0;
v44 = 0;
v45 = 0;
std::string::__init(&v43, &unk_B6B226, 0);
v20 = TextAlertPopup::create((int)v42, (cocos2d::CCDelayTime *)0x3F400000, 0.5, 150, (int)&v43);
v19(v5, v20, 100);
std::string::~string((int)&v43);
std::string::~string((int)v42);
v21 = *((_DWORD *)v5 + 136);
if ( v21 && (unsigned int)(*(_DWORD *)(v21 + 104) - 3) <= 1 )
FLAlertLayer::requestRebuild(v5);
return std::string::~string((int)&v39);
}