//
// GameLevelManager::resetAccountComments from 0x1005511e0 to 0x100551341 (353 bytes)
//
// 1 xrefs:
// > ProfilePage::onUpdate @ 0x1007b97da
//
// 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::resetAccountComments(GameLevelManager *a1, int a2)
{
double v2; // xmm0_8
bool v3; // bl
int v4; // r13d
cocos2d::CCString *v5; // rax
const char *CString; // r15
size_t v7; // rax
size_t v8; // r12
char *v9; // rbx
const char *v10; // rsi
cocos2d::CCArray *StoredOnlineLevels; // rax
__int64 v12; // rax
size_t v13; // r14
__int64 v14; // [rsp+0h] [rbp-50h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
LOBYTE(v14) = (_BYTE)a1;
v3 = 1;
v4 = 0;
while ( v3 )
{
v5 = (cocos2d::CCString *)sub_1007AB580("a_%i_%i", v14);
CString = cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v8 = v7;
if ( v7 >= 0x17 )
{
v12 = v7 | 7;
v13 = 26;
if ( (v8 | 7) != 0x17 )
v13 = v12 + 1;
v9 = (char *)operator new(v13);
__p = v9;
__dst[0] = v13 + 1;
__dst[1] = v8;
LABEL_16:
memmove(v9, CString, v8);
v9[v8] = 0;
v10 = (char *)__dst + 1;
if ( (__dst[0] & 1) == 0 )
goto LABEL_9;
LABEL_8:
v10 = (const char *)__p;
goto LABEL_9;
}
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( v7 )
goto LABEL_16;
BYTE1(__dst[0]) = 0;
v10 = (char *)__dst + 1;
if ( (__dst[0] & 1) != 0 )
goto LABEL_8;
LABEL_9:
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels((GameLevelManager *)v14, v10);
v3 = StoredOnlineLevels != nullptr;
if ( StoredOnlineLevels )
cocos2d::CCDictionary::removeObjectForKey_1(*(_QWORD *)(v14 + 560), (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( ++v4 == 101 )
return;
}
}