//
// MessagesProfilePage::deleteSelected from 0xa4a6d4 to 0xa4a8d8 (516 bytes)
//
// 2 xrefs:
// > MessagesProfilePage::FLAlert_Clicked @ 0xa4a920
// > ??> @ 0xd5790
//
// 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:00:02 +0000
//
__int64 __fastcall MessagesProfilePage::deleteSelected(MessagesProfilePage *this)
{
GameLevelManager *v2; // x0
const char *v3; // x1
cocos2d::CCArray *StoredOnlineLevels; // x0
cocos2d::CCArray *v5; // x19
cocos2d::CCArray *v6; // x24
unsigned int *v7; // x1
int v8; // w25
GameLevelManager *v9; // x0
cocos2d::CCObject **v11; // x19
cocos2d::CCObject **v12; // x21
cocos2d::CCObject *v13; // x20
GameLevelManager *v14; // x0
GameLevelManager *v15; // x0
GameLevelManager *v16; // x0
unsigned __int64 v17; // x0
GJAccountManager *v18; // x19
__int64 v19; // x0
__int64 v20; // x0
int v21; // w1
__int64 v22; // x0
char v23; // w1
__int64 v24[2]; // [xsp+50h] [xbp+50h] BYREF
void *v25; // [xsp+60h] [xbp+60h]
v2 = (GameLevelManager *)GameLevelManager::sharedState(_stack_chk_guard);
v3 = (char *)this + 705;
if ( (*((_BYTE *)this + 704) & 1) != 0 )
v3 = *((const char **)this + 90);
StoredOnlineLevels = (cocos2d::CCArray *)GameLevelManager::getStoredOnlineLevels(v2, v3);
v5 = StoredOnlineLevels;
if ( StoredOnlineLevels )
{
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(StoredOnlineLevels);
v7 = *((unsigned int **)v5 + 7);
v8 = 0;
if ( *v7 )
{
v11 = *((cocos2d::CCObject ***)v7 + 2);
v8 = 0;
v12 = &v11[*v7 - 1];
if ( v11 <= v12 )
{
v13 = *v11;
if ( *v11 )
{
if ( *((_BYTE *)v13 + 426) )
goto LABEL_13;
while ( v12 >= ++v11 )
{
v13 = *v11;
if ( !*v11 )
break;
if ( *((_BYTE *)v13 + 426) )
{
LABEL_13:
cocos2d::CCArray::addObject(v6, v13);
if ( !*((_BYTE *)v13 + 424) )
{
*((_BYTE *)v13 + 424) = 1;
++v8;
}
}
}
}
}
}
v9 = (GameLevelManager *)cocos2d::CCArray::count(v6);
if ( (_DWORD)v9 )
{
v14 = (GameLevelManager *)GameLevelManager::sharedState(v9);
*((_QWORD *)v14 + 173) = (char *)this + 688;
v15 = (GameLevelManager *)GameLevelManager::sharedState(v14);
*((_QWORD *)v15 + 170) = (char *)this + 672;
v16 = (GameLevelManager *)GameLevelManager::sharedState(v15);
v17 = (unsigned __int8)GameLevelManager::deleteUserMessages(v16, nullptr, v6, *((_BYTE *)this + 696));
if ( (_BYTE)v17 )
{
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
std::string::__init(v24, "Deleting Messages...", 0x14u);
v22 = UploadActionPopup::create((__int64)this + 680, (char *)v24);
v23 = v24[0];
*((_QWORD *)this + 95) = v22;
if ( (v23 & 1) != 0 )
{
operator delete(v25);
v22 = *((_QWORD *)this + 95);
}
v17 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 1312LL))(v22);
if ( !v8 )
goto LABEL_21;
}
else if ( !v8 )
{
LABEL_21:
MessagesProfilePage::updateSelectUI(this);
return _stack_chk_guard;
}
v18 = (GJAccountManager *)GameLevelManager::sharedState((GameLevelManager *)v17);
v19 = GJAccountManager::sharedState(v18);
v20 = GameLevelManager::userInfoForAccountID(
(cocos2d::CCDictionary **)v18,
*(_DWORD *)(v19 + 352) - *(_DWORD *)(v19 + 356));
if ( v20 )
{
v21 = *(_DWORD *)(v20 + 692) - v8;
if ( v21 < 0 )
v21 = 0;
*(_DWORD *)(v20 + 692) = v21;
}
goto LABEL_21;
}
}
return _stack_chk_guard;
}