//
// GameManager::getIntGameVariable from 0x5ed06c to 0x5ed18c (288 bytes)
//
// 46 xrefs:
// > GameManager::firstLoad @ 0x5f091c
// > GameManager::dataLoaded @ 0x5fb180
// > GameManager::dataLoaded @ 0x5fb19c
// > GameManager::dataLoaded @ 0x5fb5f8
// > EditorUI::onColorFilter @ 0x685ecc
// > EditorUI::onGroupIDFilter @ 0x686d74
// > EditorUI::recreateButtonTabs @ 0x687904
// > EditorUI::recreateButtonTabs @ 0x687918
// > EditorUI::setupDeleteMenu @ 0x688180
// > EditorUI::setupDeleteMenu @ 0x688250
// > EditorUI::shouldDeleteObject @ 0x68849c
// > EditorUI::shouldDeleteObject @ 0x688508
// > EditorUI::updateDeleteButtons @ 0x688754
// > EditorUI::updateDeleteButtons @ 0x688bac
// > EditorUI::canSelectObject @ 0x68907c
// > EditorUI::canSelectObject @ 0x689094
// > EditorUI::canSelectObject @ 0x6890bc
// > EditorUI::canSelectObject @ 0x689114
// > EditorUI::createMoveMenu @ 0x68b7f0
// > EditorUI::createMoveMenu @ 0x68b808
// > EditorUI::reloadCustomItems @ 0x697900
// > EditorUI::reloadCustomItems @ 0x697918
// > EditorUI::setupCreateMenu @ 0x697b14
// > EditorUI::setupCreateMenu @ 0x697b24
// > EditorUI::selectObjects @ 0x6be948
// > EditorUI::selectObjects @ 0x6be9c0
// > EditorUI::selectObjects @ 0x6becb0
// > EditorUI::selectObjects @ 0x6beccc
// > CreatorLayer::onMyLevels @ 0x6ca4c4
// > CreatorLayer::onMyLevels @ 0x6ca4dc
// > CreatorLayer::onMyLevels @ 0x6ca534
// > CreatorLayer::onMyLevels @ 0x6ca554
// > CreatorLayer::onSavedLevels @ 0x6ca59c
// > CreatorLayer::onSavedLevels @ 0x6ca5b0
// > CreatorLayer::onSavedLevels @ 0x6ca5c8
// > CreatorLayer::onSavedLevels @ 0x6ca614
// > LevelInfoLayer::onLevelLeaderboard @ 0x6d5700
// > LevelInfoLayer::onLevelLeaderboard @ 0x6d5714
// > EditLevelLayer::onLevelLeaderboard @ 0x6dde94
// > EndLevelLayer::onLevelLeaderboard @ 0x7d3110
// > EndLevelLayer::onLevelLeaderboard @ 0x7d3124
// > EditorOptionsLayer::onClose @ 0x8c2960
// > EditorOptionsLayer::onClose @ 0x8c2970
// > EditorOptionsLayer::setupOptions @ 0x8db6a8
// > EditorOptionsLayer::setupOptions @ 0x8db6bc
// > ??> @ 0x98dc0
//
// 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
//
int GameManager::getIntGameVariable(GameManager *a1, const char *a2)
{
cocos2d::CCString *v3; // x0
char *CString; // x0
cocos2d::CCDictionary *m_valueKeeper; // x21
cocos2d::CCString *v6; // x0
int v7; // w20
char *v8; // x0
unsigned int *v10; // x2
int v11; // w1
std::string v12; // [xsp+40h] [xbp+40h] BYREF
v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s%s", "gv_", a2);
CString = (char *)cocos2d::CCString::getCString(v3);
m_valueKeeper = a1->m_valueKeeper;
sub_D153B8((int)&v12, CString);
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_valueKeeper, &v12);
v7 = cocos2d::CCString::intValue(v6);
v8 = (char *)v12.m_data.m_data - 24;
if ( (__int64 *)v12.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)((char *)v12.m_data.m_data - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *((_DWORD *)v12.m_data.m_data - 2);
*((_DWORD *)v12.m_data.m_data - 2) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v8);
}
return v7;
}