//
// SFXBrowser::executeBatchDelete from 0x14061cbc0 to 0x14061cef7 (823 bytes)
//
// 3 xrefs:
// > SFXBrowser::onBatchDelete @ 0x14061ca47
// > SFXBrowser::FLAlert_Clicked @ 0x14061eb82
// > ??> @ 0x1409302b4
//
// 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 11:35:21 +0000
//
// Hidden C++ exception states: #wind=5
__int64 __fastcall SFXBrowser::executeBatchDelete(__int64 a1)
{
int **v2; // rdi
int *v3; // rbx
__int64 v4; // rcx
int *v5; // rbx
int *v6; // rcx
__int64 v7; // rdx
cocos2d::CCDictionary *v8; // rcx
__int64 v9; // rax
int *v10; // rbx
__int64 v11; // rdx
cocos2d::CCDictionary *v12; // rcx
__int64 v13; // rdi
cocos2d::CCDictionary *v14; // rcx
struct cocos2d::CCObject *v15; // rax
cocos2d::CCObject *CustomSFXRoot; // rbx
__int64 v17; // rax
cocos2d::CCDictionary *v18; // rcx
struct cocos2d::CCObject *v19; // rax
cocos2d::CCObject **v20; // rdi
cocos2d::CCObject *v21; // rcx
int *i; // [rsp+40h] [rbp+8h] BYREF
void *v24; // [rsp+48h] [rbp+10h]
v2 = *(int ***)(a1 + 1008);
v3 = *v2;
for ( i = v3; i != (int *)v2; v3 = i )
{
v4 = qword_14090C070;
if ( !qword_14090C070 )
{
v24 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v4 = qword_14090C070;
}
MusicDownloadManager::deleteCustomSFXObject(v4, v3[7]);
sub_1400BD5E0((__int64 *)&i);
v2 = *(int ***)(a1 + 1008);
}
v5 = v2[1];
while ( !*((_BYTE *)v5 + 25) )
{
sub_1400BD500(a1 + 1008, a1 + 1008, *((_QWORD *)v5 + 2));
v6 = v5;
v5 = *(int **)v5;
j_j_free(v6);
}
v2[1] = (int *)v2;
*v2 = (int *)v2;
v2[2] = (int *)v2;
*(_QWORD *)(a1 + 1016) = 0;
if ( *(int *)(a1 + 1024) > 0 )
{
if ( !qword_14090C070 )
{
i = (int *)operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)i);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
}
v7 = *(int *)(a1 + 1024);
v8 = *(cocos2d::CCDictionary **)(qword_14090C070 + 920);
if ( !v8 || (int)v7 <= 0 || !cocos2d::CCDictionary::objectForKey(v8, v7) )
*(_DWORD *)(a1 + 1024) = 0;
}
v9 = *(_QWORD *)(a1 + 712);
if ( v9 )
{
v10 = *(int **)(v9 + 184);
if ( v10 )
{
if ( *(_DWORD *)(v9 + 148) == 4 )
{
if ( !qword_14090C070 )
{
i = (int *)operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)i);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
}
v11 = v10[19];
v12 = *(cocos2d::CCDictionary **)(qword_14090C070 + 920);
if ( !v12 || (int)v11 <= 0 || cocos2d::CCDictionary::objectForKey(v12, v11) != (struct cocos2d::CCObject *)v10 )
{
if ( !qword_14090C070 )
{
i = (int *)operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)i);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
}
v13 = qword_14090C070;
v14 = *(cocos2d::CCDictionary **)(qword_14090C070 + 920);
if ( v14
&& v10[15] > 0
&& (v15 = cocos2d::CCDictionary::objectForKey(v14, v10[15]), (CustomSFXRoot = v15) != nullptr)
&& (*((_BYTE *)v15 + 72)
|| (v17 = *((int *)v15 + 15), (v18 = *(cocos2d::CCDictionary **)(v13 + 920)) != nullptr)
&& (int)v17 > 0
&& (v19 = cocos2d::CCDictionary::objectForKey(v18, v17), (CustomSFXRoot = v19) != nullptr)
&& *((_BYTE *)v19 + 72)) )
{
v20 = (cocos2d::CCObject **)(*(_QWORD *)(a1 + 712) + 184LL);
}
else
{
if ( !qword_14090C070 )
{
i = (int *)operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager((__int64)i);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
}
CustomSFXRoot = MusicDownloadManager::getCustomSFXRoot(qword_14090C070);
v20 = (cocos2d::CCObject **)(*(_QWORD *)(a1 + 712) + 184LL);
if ( !CustomSFXRoot )
{
if ( *v20 )
cocos2d::CCObject::release(*v20);
*v20 = nullptr;
goto LABEL_43;
}
}
v21 = *v20;
if ( CustomSFXRoot != *v20 )
{
if ( v21 )
cocos2d::CCObject::release(v21);
*v20 = CustomSFXRoot;
cocos2d::CCObject::retain(CustomSFXRoot);
}
LABEL_43:
*(_DWORD *)(*(_QWORD *)(a1 + 712) + 96LL) = 0;
}
}
}
}
return cocos2d::CCNode::scheduleOnce(a1, FLAlertLayer::rebuildContentDeferred);
}