//
// ProfilePage::commentDeleteFailed from 0x1007c0dd0 to 0x1007c0f18 (328 bytes)
//
// 2 xrefs:
// > sub_1007C0F40 @ 0x1007c0f4c
// > ??> @ 0x1009942f0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall ProfilePage::commentDeleteFailed(ProfilePage *a1, int a2, int a3)
{
GJAccountManager *v4; // rax
__int64 v5; // r15
GameLevelManager *v6; // rax
cocos2d::CCArray *StoredOnlineLevels; // rax
__int64 v8; // r15
unsigned int v9; // r12d
__int64 v10; // rax
__int128 v11; // [rsp+8h] [rbp-38h] BYREF
void *__p; // [rsp+18h] [rbp-28h]
v4 = GJAccountManager::sharedState();
if ( v4->m_accountID - v4->m_unkInt1 == a2 )
{
__p = operator new(0x30u);
*(_QWORD *)&v11 = 49;
*((_QWORD *)&v11 + 1) = 46;
strcpy((char *)__p, "Comment delete failed. Please try again later.");
v5 = sub_10049B0F0(0, (__int64)"Failed", &v11, (__int64)"OK", 0, 2.438129814130629e-152);
if ( (v11 & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 1288LL))(v5);
v6 = GameLevelManager::sharedState();
if ( (a1->m_profileKey.m_data.m_short.sizex2 & 1) != 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v6, a1->m_profileKey.m_data.m_long.longStorage);
if ( !StoredOnlineLevels )
return;
}
else
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(
v6,
a1->m_profileKey.m_data.m_short.shortStorage.__elems_);
if ( !StoredOnlineLevels )
return;
}
v8 = (__int64)StoredOnlineLevels;
if ( (unsigned int)sub_100720070((__int64)StoredOnlineLevels) )
{
v9 = 0;
while ( 1 )
{
v10 = sub_1007200C0(v8, v9);
if ( *(_DWORD *)(v10 + 368) == a3 )
break;
if ( ++v9 >= (unsigned int)sub_100720070(v8) )
return;
}
*(_BYTE *)(v10 + 416) = 0;
ProfilePage::loadPage(a1, a1->m_page);
}
}
}