//
// GameManager::lockIcon from 0x5f2a8c to 0x5f2b78 (236 bytes)
//
// 2 xrefs:
// > GameManager::resetAchievement @ 0x5f43cc
// > ??> @ 0x4e948
//
// 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 GameManager::lockIcon(GameManager *a1, int a2, IconType a3)
{
cocos2d::CCDictionary *m_valueKeeper; // x21
char *v4; // x0
unsigned int *v5; // x2
int v6; // w1
std::string v7; // [xsp+40h] [xbp+40h] BYREF
m_valueKeeper = a1->m_valueKeeper;
GameManager::iconKey(a2, a3, (__int64)&v7);
cocos2d::CCDictionary::removeObjectForKey(m_valueKeeper, &v7);
v4 = (char *)v7.m_data.m_data - 24;
if ( (__int64 *)v7.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)((char *)v7.m_data.m_data - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *((_DWORD *)v7.m_data.m_data - 2);
*((_DWORD *)v7.m_data.m_data - 2) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
}