//
// GameLevelManager::resetCommentTimersForLevelID from 0x6f982c to 0x6f99fc (464 bytes)
//
// 3 xrefs:
// > InfoLayer::onRefreshComments @ 0x7e36d4
// > InfoLayer::toggleSmallCommentMode @ 0x7e5cec
// > ??> @ 0x84f30
//
// 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 GameLevelManager::resetCommentTimersForLevelID(GameLevelManager *a1, int a2, CommentKeyType a3)
{
int v4; // w22
int v6; // w19
bool HasTimer; // w0
int v8; // w2
char *v9; // x0
unsigned int *v10; // x1
int v11; // w3
char *v12; // x0
unsigned int *v13; // x19
int v14; // w1
int v15; // [xsp+68h] [xbp+68h]
const char *v16; // [xsp+80h] [xbp+80h] BYREF
v4 = 0;
LABEL_2:
v6 = 0;
while ( 1 )
{
GameLevelManager::sharedState();
GameLevelManager::getCommentKey((const char *)(unsigned int)a2, (__int64)&v16);
HasTimer = GameLevelManager::keyHasTimer(a1, v16);
v8 = 0;
if ( !HasTimer )
{
if ( ++v6 == 101 )
break;
goto LABEL_5;
}
GameLevelManager::resetTimerForKey(a1, v16);
++v6;
v8 = 1;
if ( v6 == 101 )
break;
LABEL_5:
v9 = (char *)(v16 - 24);
if ( v16 - 24 == (const char *)&qword_124B6B0 )
goto LABEL_6;
if ( &pthread_create )
{
v10 = (unsigned int *)(v16 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *((_DWORD *)v16 - 2);
*((_DWORD *)v16 - 2) = v11 - 1;
}
if ( v11 > 0 )
{
LABEL_6:
if ( !v8 )
goto LABEL_7;
}
else
{
v15 = v8;
operator delete(v9);
if ( !v15 )
{
LABEL_7:
if ( v4 )
return;
v4 = 1;
goto LABEL_2;
}
}
}
v12 = (char *)(v16 - 24);
if ( v16 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v16 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *((_DWORD *)v16 - 2);
*((_DWORD *)v16 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v12);
}
}