//
// SFXBrowser::onBatchDelete from 0xb91f74 to 0xb9214c (472 bytes)
//
// 3 xrefs:
// > ??> @ 0xa7560
// > sub_B947C8 @ 0xb9609c
// > ??> @ 0x1544b40
//
// 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 13:02:39 +0000
//
__int64 __fastcall SFXBrowser::onBatchDelete(SFXBrowser *this, cocos2d::CCObject *a2)
{
MusicDownloadManager *v3; // x0
MusicDownloadManager *v4; // x19
char *v5; // x21
int v6; // w23
int v7; // w20
MusicDownloadManager *v8; // x0
__int64 CustomSFXObject; // x0
MusicDownloadManager *v11; // x1
MusicDownloadManager *v12; // x1
cocos2d::CCString *v13; // x0
const char *CString; // x0
size_t v15; // x0
__int64 v16; // x19
char *v17; // [xsp+48h] [xbp+48h]
__int64 v18[2]; // [xsp+50h] [xbp+50h] BYREF
void *v19; // [xsp+60h] [xbp+60h]
v3 = *((MusicDownloadManager **)this + 127);
if ( v3 )
{
v4 = *((MusicDownloadManager **)this + 125);
v5 = (char *)this + 1008;
v6 = 0;
v7 = 0;
while ( v4 != (MusicDownloadManager *)v5 )
{
while ( 1 )
{
v8 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v3);
CustomSFXObject = MusicDownloadManager::getCustomSFXObject(v8, *((_DWORD *)v4 + 7));
if ( CustomSFXObject )
{
++v7;
if ( *(_BYTE *)(CustomSFXObject + 72) )
{
if ( (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(CustomSFXObject + 152)) )
v6 = 1;
}
}
v3 = *((MusicDownloadManager **)v4 + 1);
if ( !v3 )
break;
do
{
v4 = v3;
v3 = *(MusicDownloadManager **)v3;
}
while ( v3 );
if ( v4 == (MusicDownloadManager *)v5 )
goto LABEL_9;
}
do
{
v11 = v4;
v4 = *((MusicDownloadManager **)v4 + 2);
v3 = *(MusicDownloadManager **)v4;
if ( v11 == *(MusicDownloadManager **)v4 )
break;
v12 = v4;
v4 = *((MusicDownloadManager **)v4 + 2);
v3 = *(MusicDownloadManager **)v4;
}
while ( v12 != *(MusicDownloadManager **)v4 );
}
LABEL_9:
if ( v7 )
{
if ( v7 > 1 || v6 )
{
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Delete %i selected?",
(const char *)(unsigned int)v7);
CString = (const char *)cocos2d::CCString::getCString(v13);
v18[0] = 0;
v17 = (char *)CString;
v18[1] = 0;
v19 = nullptr;
v15 = strlen(CString);
std::string::__init(v18, v17, v15);
v16 = FLAlertLayer::create(
(__int64)this + 696,
(cocos2d::CCLabelBMFont *)"Delete SFX",
(char *)v18,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Delete",
300.0);
if ( (v18[0] & 1) != 0 )
operator delete(v19);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 72LL))(v16, 10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v16 + 1312LL))(v16);
}
else
{
SFXBrowser::executeBatchDelete(this);
}
}
else
{
std::__tree::clear((_QWORD *)this + 125);
SFXBrowser::updateSelectionUI(this);
}
}
return _stack_chk_guard;
}