//
// GameLevelManager::getDemonLevelsString from 0x85158c to 0x8517c0 (564 bytes)
//
// 2 xrefs:
// > GameLevelManager::updateUserScore @ 0x852900
// > ??> @ 0x5e858
//
// 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:55:26 +0000
//
__int64 *__usercall GameLevelManager::getDemonLevelsString@(GameLevelManager *this@, __int64 *a2@)
{
__int64 v2; // x0
__int64 v4; // x19
__int64 v5; // x20
int v6; // w25
const void *v7; // x0
GJGameLevel *v8; // x0
GJGameLevel *v9; // x19
GameStatsManager *NormalPercent; // x0
GameStatsManager *v11; // x0
size_t v12; // x26
size_t v13; // x25
size_t v14; // x19
const char *v15; // x1
size_t v16; // x0
char *v18; // [xsp+68h] [xbp+68h]
size_t v19; // [xsp+78h] [xbp+78h] BYREF
unsigned __int64 v20; // [xsp+80h] [xbp+80h]
char *v21; // [xsp+88h] [xbp+88h]
_BYTE v22[504]; // [xsp+90h] [xbp+90h] BYREF
v19 = 0;
v2 = *((_QWORD *)this + 95);
v20 = 500;
v21 = v22;
if ( !v2 )
goto LABEL_24;
v4 = *(_QWORD *)(v2 + 56);
if ( !v4 )
goto LABEL_24;
v5 = *(_QWORD *)(v4 + 288);
v6 = 1;
while ( 1 )
{
v7 = *(const void **)(v4 + 264);
if ( v7 )
{
v8 = (GJGameLevel *)_dynamic_cast(
v7,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
v9 = v8;
if ( v8 )
{
if ( *((_DWORD *)v8 + 237) - *((_DWORD *)v8 + 238) == 10 )
{
NormalPercent = (GameStatsManager *)GJGameLevel::getNormalPercent(v8);
if ( (_DWORD)NormalPercent == 100 )
{
v11 = (GameStatsManager *)GameStatsManager::sharedState(NormalPercent);
if ( (unsigned __int8)GameStatsManager::hasCompletedLevel(v11, v9) )
break;
}
}
}
}
if ( !v5 )
goto LABEL_16;
LABEL_8:
v4 = v5;
v5 = *(_QWORD *)(v5 + 288);
}
if ( !v6 )
{
v12 = v19;
v13 = v19 + 1;
if ( v19 + 1 > v20 )
fmt::internal::Array::grow(&v19, v19 + 1);
v19 = v13;
v21[v12] = 44;
}
fmt::BasicWriter::FormatInt,char>>(
&v19,
*((_DWORD *)v9 + 82) - *((_DWORD *)v9 + 83));
v6 = 0;
if ( v5 )
goto LABEL_8;
LABEL_16:
if ( v6 )
{
LABEL_24:
*a2 = 0;
a2[1] = 0;
a2[2] = 0;
std::string::__init(a2, &byte_11B8890, 0);
goto LABEL_20;
}
v14 = v19;
if ( v19 + 1 > v20 )
fmt::internal::Array::grow(&v19, v19 + 1);
v21[v14] = 0;
*a2 = 0;
v15 = v21;
a2[1] = 0;
a2[2] = 0;
v18 = (char *)v15;
v16 = strlen(v15);
std::string::__init(a2, v18, v16);
LABEL_20:
if ( v21 != v22 && v21 )
operator delete[](v21);
return a2;
}