//
// GameStatsManager::completedDemonLevel from 0x100330e90 to 0x100330f40 (176 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::init @ 0x100025868
// > GameLevelManager::updateLevelRewards @ 0x100093a50
// > GameManager::dataLoaded @ 0x10031c0f8
// > GameStatsManager::completedLevel @ 0x100330e30
//
// 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 __fastcall GameStatsManager::completedDemonLevel(GameStatsManager *a1, GJGameLevel *a2)
{
_BOOL8 hasCompletedDemonLevel; // x0
char *DemonLevelKey; // x0
cocos2d::CCDictionary *m_completedLevels; // x21
cocos2d::CCString *m_trueString; // x22
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v9; // [xsp+1Fh] [xbp-21h]
hasCompletedDemonLevel = GameStatsManager::hasCompletedDemonLevel(a1, a2);
if ( !hasCompletedDemonLevel && a2->m_demon.random - a2->m_demon.seed == 1 )
{
DemonLevelKey = (char *)GameStatsManager::getDemonLevelKey((GameStatsManager *)hasCompletedDemonLevel, a2);
m_completedLevels = a1->m_completedLevels;
m_trueString = a1->m_trueString;
sub_100009900(__p, DemonLevelKey);
cocos2d::CCDictionary::setObject_1(m_completedLevels, m_trueString, __p);
if ( v9 < 0 )
operator delete(__p[0]);
if ( a2->m_stars.random - a2->m_stars.seed >= 10 )
GameStatsManager::incrementStat(a1, "5", 1);
}
}