//
// GameLevelManager::resetCommentTimersForAccountID from 0x6f99fc to 0x6f9bb4 (440 bytes)
//
// 3 xrefs:
// > ProfilePage::onUpdate @ 0x8fdbb4
// > ProfilePage::onUpdate @ 0x8fdca8
// > ??> @ 0x92430
//
// 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::resetCommentTimersForAccountID(GameLevelManager *a1, int a2)
{
int v4; // w19
GameLevelManager *v5; // x0
char *AccountCommentKey; // x0
int v7; // w27
char *v8; // x0
unsigned int *v9; // x1
int v10; // w2
char *v11; // x0
unsigned int *v12; // x1
int v13; // w2
const char *v14; // [xsp+70h] [xbp+70h] BYREF
v4 = 0;
while ( 1 )
{
v5 = GameLevelManager::sharedState();
AccountCommentKey = (char *)GameLevelManager::getAccountCommentKey(v5, a2, v4);
sub_D153B8((int)&v14, AccountCommentKey);
v7 = 0;
if ( GameLevelManager::keyHasTimer(a1, v14) )
break;
if ( ++v4 == 101 )
goto LABEL_14;
LABEL_4:
v8 = (char *)(v14 - 24);
if ( v14 - 24 == (const char *)&qword_124B6B0 )
goto LABEL_5;
if ( &pthread_create )
{
v9 = (unsigned int *)(v14 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v10 - 1;
}
if ( v10 > 0 )
{
LABEL_5:
if ( !v7 )
return;
}
else
{
operator delete(v8);
if ( !v7 )
return;
}
}
GameLevelManager::resetTimerForKey(a1, v14);
++v4;
v7 = 1;
if ( v4 != 101 )
goto LABEL_4;
LABEL_14:
v11 = (char *)(v14 - 24);
if ( v14 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v14 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v11);
}
}