//
// GameStatsManager::completedDemonLevel from 0x8e8524 to 0x8e8640 (284 bytes)
//
// 5 xrefs:
// > GameManager::dataLoaded @ 0x728adc
// > LevelInfoLayer::init @ 0x7ecc50
// > GameLevelManager::updateLevelRewards @ 0x805688
// > GameStatsManager::completedLevel @ 0x8e9cc8
// > ??> @ 0x87808
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:56:53 +0000
//
__int64 __fastcall GameStatsManager::completedDemonLevel(cocos2d::CCObject **this, GJGameLevel *a2)
{
size_t v5; // x0
__int64 v6; // x24
cocos2d::CCObject *v7; // x23
char *DemonLevelKey; // [xsp+48h] [xbp+48h]
__int64 v9[2]; // [xsp+50h] [xbp+50h] BYREF
void *v10; // [xsp+60h] [xbp+60h]
if ( !GameStatsManager::hasCompletedDemonLevel((GameStatsManager *)this, a2)
&& *((_DWORD *)a2 + 233) - *((_DWORD *)a2 + 234) == 1 )
{
v9[0] = 0;
DemonLevelKey = (char *)GameStatsManager::getDemonLevelKey((GameStatsManager *)this, a2);
v9[1] = 0;
v10 = nullptr;
v5 = strlen(DemonLevelKey);
v6 = (__int64)*(this + 76);
v7 = *(this + 40);
std::string::__init(v9, DemonLevelKey, v5);
cocos2d::CCDictionary::setObject(v6, v7);
if ( (v9[0] & 1) != 0 )
operator delete(v10);
if ( *((_DWORD *)a2 + 237) - *((_DWORD *)a2 + 238) > 9 )
GameStatsManager::incrementStat((GameStatsManager *)this, "5");
}
return _stack_chk_guard;
}