//
// AutoBackupPopup::onDeleteSelected from 0xc52d2c to 0xc52f84 (600 bytes)
//
// 3 xrefs:
// > ??> @ 0x7e418
// > AutoBackupPopup::init @ 0xc5d6e8
// > ??> @ 0x1543448
//
// 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:05:09 +0000
//
__int64 __fastcall AutoBackupPopup::onDeleteSelected(AutoBackupPopup *this, cocos2d::CCObject *a2)
{
unsigned int v3; // w25
__int64 v4; // x19
__int64 v5; // x21
__int64 v6; // x20
__int64 v7; // x22
int v8; // w0
char *v9; // x2
char *v10; // x3
cocos2d::CCString *v11; // x0
size_t v12; // x0
char *v13; // x24
__int64 v14; // x19
char *v16; // [xsp+58h] [xbp+58h]
char *CString; // [xsp+58h] [xbp+58h]
__int64 v18; // [xsp+68h] [xbp+68h] BYREF
size_t v19; // [xsp+70h] [xbp+70h]
void *v20; // [xsp+78h] [xbp+78h]
__int64 v21; // [xsp+80h] [xbp+80h] BYREF
size_t v22; // [xsp+88h] [xbp+88h]
void *v23; // [xsp+90h] [xbp+90h]
v3 = AutoBackupPopup::selectedCount(this);
if ( v3 )
{
v4 = *((_QWORD *)this + 106);
v5 = (*((_QWORD *)this + 107) - v4) >> 7;
if ( v5 )
{
v6 = 0;
v7 = 0;
do
{
if ( std::__tree::__count_unique((__int64)this + 944, v4) )
v7 += *(_QWORD *)(v4 + 120);
++v6;
v4 += 128;
}
while ( v6 != v5 );
v8 = v7;
}
else
{
v8 = 0;
}
if ( v3 == 1 )
v9 = &byte_11B8890;
else
v9 = "s";
v16 = v9;
formatBytes(&v21, v8);
v10 = (char *)&v21 + 1;
if ( (v21 & 1) != 0 )
v10 = (char *)v23;
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Delete %i selected backup%s (%s)?\n"
"This cannot be undone.",
(const char *)v3,
v16,
v10);
CString = (char *)cocos2d::CCString::getCString(v11);
v18 = 0;
v19 = 0;
v20 = nullptr;
v12 = strlen(CString);
std::string::__init(&v18, CString, v12);
if ( (v21 & 1) != 0 )
operator delete(v23);
v13 = (char *)this + 776;
v21 = 0;
v22 = 0;
v23 = nullptr;
if ( (v18 & 1) != 0 )
{
std::string::__init(&v21, v20, v19);
}
else
{
v23 = v20;
v21 = v18;
v22 = v19;
}
v14 = FLAlertLayer::create(
(__int64)v13,
(cocos2d::CCLabelBMFont *)"Delete Backups",
(char *)&v21,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Delete",
0,
380.0,
0.0,
1.0);
if ( (v21 & 1) != 0 )
operator delete(v23);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v14 + 72LL))(v14, 3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 1312LL))(v14);
if ( (v18 & 1) != 0 )
operator delete(v20);
}
return _stack_chk_guard;
}