//
// GameStatsManager::getDemonLevelKey from 0x5161f4 to 0x516232 (62 bytes)
//
// 4 xrefs:
// > GameStatsManager::hasCompletedDemonLevel @ 0x516fe0
// > GameStatsManager::markLevelAsCompletedAndClaimed @ 0x523ef8
// > GameStatsManager::uncompleteLevel @ 0x523fc2
// > GameStatsManager::completedDemonLevel @ 0x529364
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:51:40 +0000
//
int __fastcall GameStatsManager::getDemonLevelKey(GameStatsManager *this, GJGameLevel *a2)
{
const char *v3; // r1
char *v4; // r0
int v5; // r2
int v6; // r1
int v7; // r3
cocos2d::CCString *v8; // r0
v3 = (const char *)(*((_DWORD *)a2 + 186) - *((_DWORD *)a2 + 187));
if ( (int)v3 <= 0 )
{
v5 = *((unsigned __int8 *)a2 + 477);
v6 = *((_DWORD *)a2 + 67);
v7 = *((_DWORD *)a2 + 68);
if ( v5 )
v4 = "gdemon_%i";
else
v4 = "demon_%i";
v3 = (const char *)(v6 - v7);
}
else
{
v4 = "ddemon_%i";
}
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)v4, v3);
return cocos2d::CCString::getCString(v8);
}