//
// GameLevelManager::resetCommentTimersForLevelID from 0x14023ff00 to 0x1402400db (475 bytes)
//
// 5 xrefs:
// > InfoLayer::onRefreshComments @ 0x1403d0472
// > InfoLayer::toggleSmallCommentMode @ 0x1403d264c
// > InfoLayer::toggleSmallCommentMode @ 0x1403d26ae
// > InfoLayer::toggleSmallCommentMode @ 0x1403d2724
// > ??> @ 0x14091c178
//
// 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:36 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GameLevelManager::resetCommentTimersForLevelID(__int64 a1, int a2, int a3)
{
int v6; // r14d
int v7; // esi
char v8; // di
int v9; // ebx
cocos2d::CCString *v10; // rax
const char *CString; // rax
size_t v12; // r8
void **v13; // rdx
void **v14; // rdx
void *v15; // rcx
void *v16; // rcx
void *v17; // [rsp+30h] [rbp-68h]
void *Block[2]; // [rsp+38h] [rbp-60h] BYREF
__int64 v19; // [rsp+48h] [rbp-50h]
unsigned __int64 v20; // [rsp+50h] [rbp-48h]
v6 = 0;
v7 = 0;
while ( 2 )
{
v8 = 1;
v9 = 0;
do
{
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v17 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v17);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
}
v10 = cocos2d::CCString::createWithFormat("comment_%i_%i_%i_%i", a2, v9, v7, a3);
CString = cocos2d::CCString::getCString(v10);
*(_OWORD *)Block = 0;
v19 = 0;
v20 = 0;
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003D230(Block, CString, v12);
v6 |= 1u;
v13 = Block;
if ( v20 > 0xF )
v13 = (void **)Block[0];
if ( GameLevelManager::keyHasTimer(a1, v13) )
{
v14 = Block;
if ( v20 > 0xF )
v14 = (void **)Block[0];
GameLevelManager::resetTimerForKey(a1, v14);
}
else
{
v8 = 0;
}
if ( ++v9 > 100 )
{
if ( v20 > 0xF )
{
v16 = Block[0];
if ( v20 + 1 >= 0x1000 )
{
v16 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v16 - 8) > 0x1F )
LABEL_25:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
return;
}
if ( v20 > 0xF )
{
v15 = Block[0];
if ( v20 + 1 >= 0x1000 )
{
v15 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )
goto LABEL_25;
}
j_j_free(v15);
}
}
while ( v8 );
if ( ++v7 < 2 )
continue;
break;
}
}