//
// LevelStatsInfoPopup::buildStatsText from 0x79b818 to 0x79bb14 (764 bytes)
//
// 1 xrefs:
// > LevelStatsInfoPopup::init @ 0x79c414
//
// 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:59:49 +0000
//
LevelStatsInfoPopup *__fastcall LevelStatsInfoPopup::buildStatsText(LevelStatsInfoPopup *this, int a2)
{
_BOOL4 isPlatformer; // r0
int v5; // r1
int v6; // r3
cocos2d::CCString *v7; // r0
const char *CString; // r9
int *v9; // r5
size_t v10; // r0
const char *v11; // r1
cocos2d::CCString *v12; // r0
char *v13; // r0
cocos2d::CCString *v14; // r0
char *v15; // r0
const char *NormalPercent; // r0
cocos2d::CCString *v17; // r0
char *v18; // r0
int v19; // r1
char *v20; // r1
cocos2d::CCString *v21; // r0
char *v22; // r0
unsigned int v23; // r1
char *v24; // r1
cocos2d::CCString *v25; // r0
char *v26; // r0
int v27; // r0
int v28; // r1
int v29; // r2
char *v30; // r1
cocos2d::CCString *v31; // r0
const char *v32; // r9
size_t v33; // r0
const char *v34; // r1
GJGameLevel *v35; // r0
const char *v36; // r6
int v37; // r0
cocos2d::CCString *v38; // r0
cocos2d::CCString *v39; // r0
char *v40; // r0
char *v41; // r0
int v42; // r0
const char *v43; // r1
const char *v44; // r1
cocos2d::CCString *v45; // r0
char *v46; // r0
cocos2d::CCString *v47; // r0
char *v48; // r0
const char *v49; // r1
cocos2d::CCString *v50; // r0
char *v51; // r0
int v52; // r0
int v53; // r1
char *v54; // r2
int v56; // [sp+0h] [bp-2Ch] BYREF
int v57; // [sp+4h] [bp-28h]
int v58; // [sp+8h] [bp-24h]
int v59; // [sp+Ch] [bp-20h] BYREF
int v60; // [sp+10h] [bp-1Ch]
char *v61; // [sp+14h] [bp-18h]
int v62[2]; // [sp+18h] [bp-14h] BYREF
char *v63; // [sp+20h] [bp-Ch]
isPlatformer = GJGameLevel::isPlatformer(*(GJGameLevel **)(a2 + 520));
v5 = *(_DWORD *)(a2 + 520);
if ( isPlatformer )
{
std::string::basic_string(v62, v5 + 280);
v6 = *(_DWORD *)(a2 + 520);
if ( (v62[0] & 1) != 0 )
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s\nTotal Attempts: %i",
v63,
*(_DWORD *)(v6 + 620) - *(_DWORD *)(v6 + 624));
else
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s\nTotal Attempts: %i",
(const char *)v62 + 1,
*(_DWORD *)(v6 + 620) - *(_DWORD *)(v6 + 624));
CString = (const char *)cocos2d::CCString::getCString(v7);
v56 = 0;
v9 = &v56;
v57 = 0;
v58 = 0;
v10 = strlen(CString);
std::string::__init(&v56, CString, v10);
std::string::~string((int)v62);
v11 = *(const char **)(*(_DWORD *)(a2 + 520) + 1184);
if ( (int)v11 > 0 )
{
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nPractice Attempts: %i",
v11);
v15 = (char *)cocos2d::CCString::getCString(v14);
std::string::append(&v56, v15);
}
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nTotal Jumps: %i",
(const char *)(*(_DWORD *)(*(_DWORD *)(a2 + 520) + 632)
- *(_DWORD *)(*(_DWORD *)(a2 + 520) + 636)));
v13 = (char *)cocos2d::CCString::getCString(v12);
std::string::append(&v56, v13);
if ( GJGameLevel::getNormalPercent(*(GJGameLevel **)(a2 + 520)) > 0
&& GJGameLevel::getNormalPercent(*(GJGameLevel **)(a2 + 520)) <= 99 )
{
NormalPercent = (const char *)GJGameLevel::getNormalPercent(*(GJGameLevel **)(a2 + 520));
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nBest: %i%%",
NormalPercent);
v18 = (char *)cocos2d::CCString::getCString(v17);
std::string::append(&v56, v18);
}
v19 = *(_DWORD *)(*(_DWORD *)(a2 + 520) + 1040);
if ( v19 > 0 )
{
GameToolbox::msToTimeString((GameToolbox *)&v59, v19, 0);
if ( (v59 & 1) != 0 )
v20 = v61;
else
v20 = (char *)&v59 + 1;
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nBest Time: %s",
v20);
v22 = (char *)cocos2d::CCString::getCString(v21);
std::string::append(&v56, v22);
std::string::~string((int)&v59);
}
v23 = *(_DWORD *)(*(_DWORD *)(a2 + 520) + 1068);
if ( v23 )
{
GameToolbox::pointsToString((GameToolbox *)v62, v23);
if ( (v62[0] & 1) != 0 )
v24 = v63;
else
v24 = (char *)v62 + 1;
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nBest Points: %s",
v24,
LOBYTE(v62[0]) << 31,
LOBYTE(v62[0]),
v56,
v57,
v58);
v26 = (char *)cocos2d::CCString::getCString(v25);
std::string::append(&v56, v26);
std::string::~string((int)v62);
}
v27 = v56;
v28 = v57;
v29 = v58;
v56 = 0;
v57 = 0;
v58 = 0;
*(_DWORD *)this = v27;
*((_DWORD *)this + 1) = v28;
*((_DWORD *)this + 2) = v29;
}
else
{
std::string::basic_string(v62, v5 + 280);
if ( (v62[0] & 1) != 0 )
v30 = v63;
else
v30 = (char *)v62 + 1;
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s\nTotal Attempts: %i",
v30,
*(_DWORD *)(*(_DWORD *)(a2 + 520) + 620) - *(_DWORD *)(*(_DWORD *)(a2 + 520) + 624));
v32 = (const char *)cocos2d::CCString::getCString(v31);
v59 = 0;
v9 = &v59;
v60 = 0;
v61 = nullptr;
v33 = strlen(v32);
std::string::__init(&v59, v32, v33);
std::string::~string((int)v62);
v34 = *(const char **)(*(_DWORD *)(a2 + 520) + 1184);
if ( (int)v34 > 0 )
{
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nPractice Attempts: %i",
v34);
v40 = (char *)cocos2d::CCString::getCString(v39);
std::string::append(&v59, v40);
}
v35 = *(GJGameLevel **)(a2 + 520);
v36 = (const char *)(*((_DWORD *)v35 + 158) - *((_DWORD *)v35 + 159));
v37 = GJGameLevel::getNormalPercent(v35);
v38 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\n"
"Total Jumps: %i\n"
"Normal: %i%%\n"
"Practice: %i%%",
v36,
v37,
*(_DWORD *)(*(_DWORD *)(a2 + 520) + 712));
v41 = (char *)cocos2d::CCString::getCString(v38);
std::string::append(&v59, v41);
v42 = GJGameLevel::getNormalPercent(*(GJGameLevel **)(a2 + 520));
v43 = (const char *)(*(_DWORD *)(*(_DWORD *)(a2 + 520) + 700) - *(_DWORD *)(*(_DWORD *)(a2 + 520) + 704));
if ( (const char *)v42 != v43 )
{
v45 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nLeaderboard: %i%%",
v43);
v46 = (char *)cocos2d::CCString::getCString(v45);
std::string::append(&v59, v46);
}
v44 = (const char *)(*(_DWORD *)(*(_DWORD *)(a2 + 520) + 644) - *(_DWORD *)(*(_DWORD *)(a2 + 520) + 648));
if ( (int)v44 > 0 )
{
v47 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nClicks (best att.): %i",
v44);
v48 = (char *)cocos2d::CCString::getCString(v47);
std::string::append(&v59, v48);
}
v49 = (const char *)(*(_DWORD *)(*(_DWORD *)(a2 + 520) + 656) - *(_DWORD *)(*(_DWORD *)(a2 + 520) + 660));
if ( (int)v49 > 0 )
{
v50 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"\nTime (best att.): %is",
v49);
v51 = (char *)cocos2d::CCString::getCString(v50);
std::string::append(&v59, v51);
}
v52 = v59;
v53 = v60;
v54 = v61;
v59 = 0;
v60 = 0;
v61 = nullptr;
*(_DWORD *)this = v52;
*((_DWORD *)this + 1) = v53;
*((_DWORD *)this + 2) = v54;
}
std::string::~string((int)v9);
return this;
}