//
// GameLevelManager::resetAccountComments from 0x803018 to 0x8031a0 (392 bytes)
//
// 2 xrefs:
// > ProfilePage::onUpdate @ 0xa549d8
// > ??> @ 0xd57d8
//
// 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 12:54:44 +0000
//
__int64 __fastcall GameLevelManager::resetAccountComments(GameLevelManager *this, unsigned int a2)
{
int v4; // w21
const char *AccountCommentKey; // x0
const char *v6; // x26
size_t v7; // x0
size_t v8; // x20
char *v9; // x3
const char *v10; // x1
int v11; // w20
unsigned __int64 v13; // x0
__int64 v14; // x22
char *v15; // x0
__int64 v16; // [xsp+50h] [xbp+50h] BYREF
size_t v17; // [xsp+58h] [xbp+58h]
void *v18; // [xsp+60h] [xbp+60h]
v4 = 0;
while ( 1 )
{
AccountCommentKey = (const char *)GameLevelManager::getAccountCommentKey(this, (const char *)a2);
v16 = 0;
v17 = 0;
v6 = AccountCommentKey;
v18 = nullptr;
v7 = strlen(AccountCommentKey);
v8 = v7;
if ( v7 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v7 > 0x16 )
{
v13 = (v7 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v14 = v13 | 1;
v15 = (char *)operator new(v13);
v16 = v14;
v9 = v15;
v18 = v15;
v17 = v8;
}
else
{
LOBYTE(v16) = 2 * v7;
v9 = (char *)&v16 + 1;
if ( !v7 )
goto LABEL_5;
}
v9 = (char *)memcpy(v9, v6, v8);
LABEL_5:
v9[v8] = 0;
v10 = (char *)&v16 + 1;
if ( (v16 & 1) != 0 )
v10 = (const char *)v18;
if ( !GameLevelManager::getStoredOnlineLevels(this, v10) )
break;
cocos2d::CCDictionary::removeObjectForKey(*((_QWORD *)this + 130), &v16);
++v4;
v11 = 1;
if ( v4 == 101 )
goto LABEL_17;
LABEL_9:
if ( (v16 & 1) != 0 )
{
operator delete(v18);
if ( !v11 )
return _stack_chk_guard;
}
else if ( !v11 )
{
return _stack_chk_guard;
}
}
++v4;
v11 = 0;
if ( v4 != 101 )
goto LABEL_9;
LABEL_17:
if ( (v16 & 1) != 0 )
operator delete(v18);
return _stack_chk_guard;
}