//
// GameLevelManager::invalidateMessages from 0x10054f3e0 to 0x10054f551 (369 bytes)
//
// 7 xrefs:
// > MessagesProfilePage::onUpdate @ 0x10022e8e1
// > GameLevelManager::onBlockUserCompleted @ 0x100523b3a
// > GameLevelManager::onDeleteUserMessagesCompleted @ 0x10052562c
// > ProfilePage::init @ 0x1007b8825
// > ProfilePage::init @ 0x1007b8836
// > ProfilePage::onUpdate @ 0x1007b980f
// > ProfilePage::onUpdate @ 0x1007b9820
//
// 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 GameLevelManager::invalidateMessages(GameLevelManager *a1, bool a2, bool a3)
{
double v3; // xmm0_8
bool v4; // r14
int v5; // r15d
cocos2d::CCString *i; // rax
const char *CString; // r12
size_t v8; // rax
size_t v9; // r13
char *v10; // rbx
const char *v11; // rsi
cocos2d::CCArray *StoredOnlineLevels; // r12
__int64 v13; // rax
size_t v14; // r14
MessageListDelegate *m_messageListDelegate; // rdi
char v16; // [rsp+0h] [rbp-50h]
char v17; // [rsp+4h] [rbp-4Ch]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v4 = a2;
v5 = 0;
for ( i = (cocos2d::CCString *)sub_1007AB580("messages_%i_%i", a2);
;
i = (cocos2d::CCString *)sub_1007AB580("messages_%i_%i", v16) )
{
CString = cocos2d::CCString::getCString(i);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v9 = v8;
if ( v8 >= 0x17 )
{
v13 = v8 | 7;
v14 = 26;
if ( (v9 | 7) != 0x17 )
v14 = v13 + 1;
v10 = (char *)operator new(v14);
__p = v10;
__dst[0] = v14 + 1;
__dst[1] = v9;
v4 = v16;
}
else
{
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( !v8 )
{
BYTE1(__dst[0]) = 0;
v11 = (char *)__dst + 1;
if ( (__dst[0] & 1) == 0 )
goto LABEL_9;
LABEL_8:
v11 = (const char *)__p;
goto LABEL_9;
}
}
memmove(v10, CString, v9);
v10[v9] = 0;
v11 = (char *)__dst + 1;
if ( (__dst[0] & 1) != 0 )
goto LABEL_8;
LABEL_9:
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(a1, v11);
if ( StoredOnlineLevels )
cocos2d::CCDictionary::removeObjectForKey_1((__int64)a1->m_storedLevels, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
++v5;
if ( !StoredOnlineLevels )
break;
}
if ( v17 )
{
m_messageListDelegate = a1->m_messageListDelegate;
if ( m_messageListDelegate )
((void (__fastcall *)(MessageListDelegate *, bool))m_messageListDelegate->forceReloadMessages)(
m_messageListDelegate,
v4);
}
}