//
// GameLevelManager::messageWasRemoved from 0x14023bfd0 to 0x14023c194 (452 bytes)
//
// 2 xrefs:
// > GameLevelManager::onDeleteUserMessagesCompleted @ 0x14023bf75
// > ??> @ 0x14091c0d0
//
// 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:28:34 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall GameLevelManager::messageWasRemoved(__int64 a1, int a2, unsigned __int8 a3)
{
char v5; // si
int v6; // r12d
int v7; // eax
cocos2d::CCString *v8; // rax
char *CString; // rbp
char v10; // r14
cocos2d::CCArray *StoredOnlineLevels; // rax
cocos2d::CCArray *v12; // rdi
unsigned int v13; // ebx
void (__fastcall ***v14)(_QWORD, cocos2d::CCArray *, char *); // rcx
size_t v15; // r8
void *v16; // rcx
int i; // [rsp+30h] [rbp-68h]
__int128 v18; // [rsp+38h] [rbp-60h] BYREF
__int128 v19; // [rsp+48h] [rbp-50h]
v5 = 1;
v6 = 0;
v7 = a3;
for ( i = a3; ; v7 = i )
{
v8 = cocos2d::CCString::createWithFormat("messages_%i_%i", v7, v6);
CString = (char *)cocos2d::CCString::getCString(v8);
v10 = 0;
StoredOnlineLevels = (cocos2d::CCArray *)GameLevelManager::getStoredOnlineLevels(a1, CString);
v12 = StoredOnlineLevels;
if ( !StoredOnlineLevels )
break;
v13 = 0;
if ( cocos2d::CCArray::count(StoredOnlineLevels) )
{
while ( *((_DWORD *)cocos2d::CCArray::objectAtIndex(v12, v13) + 80) != a2 )
{
if ( ++v13 >= cocos2d::CCArray::count(v12) )
goto LABEL_8;
}
v10 = 1;
v5 = 0;
cocos2d::CCArray::removeObjectAtIndex(v12, v13, 1);
}
LABEL_8:
++v6;
if ( v10 )
{
v14 = *(void (__fastcall ****)(_QWORD, cocos2d::CCArray *, char *))(a1 + 1512);
if ( v14 )
{
(**v14)(v14, v12, CString);
if ( !cocos2d::CCArray::count(v12) )
{
v18 = 0;
v19 = 0;
v15 = -1;
do
++v15;
while ( CString[v15] );
sub_14003D230(&v18, CString, v15);
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1152), &v18);
if ( *((_QWORD *)&v19 + 1) > 0xFu )
{
v16 = (void *)v18;
if ( (unsigned __int64)(*((_QWORD *)&v19 + 1) + 1LL) >= 0x1000 )
{
v16 = *(void **)(v18 - 8);
if ( (unsigned __int64)(v18 - (_QWORD)v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
}
}
}
if ( !v5 )
break;
}
}