//
// LevelInfoLayer::setupPlatformerStats from 0x10002b21c to 0x10002b5a0 (900 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::init @ 0x1000285a4
//
// 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 10:57:28 +0000
//
void __fastcall LevelInfoLayer::setupPlatformerStats(_QWORD *a1)
{
__int64 v2; // x0
unsigned int v3; // w21
__int64 NormalPercent; // x0
__int64 v5; // x20
__int64 v6; // x0
__int64 v7; // x21
float v8; // s8
__int64 v9; // x0
float v10; // s0
bool v11; // cc
int v12; // w8
__int64 v13; // x0
const std::string::value_type *CString; // x0
std::string *v15; // x8
__int64 v16; // x0
const std::string::value_type *v17; // x0
float v18; // s8
std::string *v19; // x0
__int64 v20; // x20
std::string *v21; // x0
__int128 v22; // q0
void **v23; // x0
__int64 v24; // x21
float32x2_t *v25; // x19
double v26; // d0
float32x2_t v27; // [xsp+20h] [xbp-90h] BYREF
std::string v28; // [xsp+28h] [xbp-88h] BYREF
void *__p[2]; // [xsp+40h] [xbp-70h] BYREF
signed __int64 v30; // [xsp+50h] [xbp-60h]
std::string v31; // [xsp+60h] [xbp-50h] BYREF
__int64 v32; // [xsp+78h] [xbp-38h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(&v32, v2);
sub_100009900(&v31, "No Best Time");
v3 = *(_DWORD *)(a1[63] + 1296LL);
NormalPercent = GJGameLevel::getNormalPercent();
if ( (int)v3 > 0 || (v5 = NormalPercent, (unsigned int)(NormalPercent - 1) > 0x62) )
{
if ( (int)v3 < 1 )
{
v12 = 1124532224;
}
else
{
if ( (unsigned __int16)(v3 / 0xEA60) % 0x3Cu )
v11 = 1;
else
v11 = v3 > 0x36EE7F;
if ( v11 )
{
if ( v3 > 0x36EE7F )
v13 = sub_1003065B0(
"%02d:%02d:%02d.%03d",
v3 / 0x36EE80,
(unsigned __int16)(v3 / 0xEA60) % 0x3Cu,
v3 / 0x3E8 - 60 * ((71582789 * (unsigned __int64)(v3 / 0x3E8)) >> 32),
v3 % 0x3E8);
else
v13 = sub_1003065B0(
"%02d:%02d.%03d",
(unsigned __int16)(v3 / 0xEA60) % 0x3Cu,
v3 / 0x3E8 - 60 * ((71582789 * (unsigned __int64)(v3 / 0x3E8)) >> 32),
v3 % 0x3E8);
}
else
{
v13 = sub_1003065B0(
"%i.%03d",
v3 / 0x3E8 - 60 * ((71582789 * (unsigned __int64)(v3 / 0x3E8)) >> 32),
v3 % 0x3E8);
}
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v13);
std::string::assign(&v31, CString);
if ( (v31.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v15 = &v31;
else
v15 = (std::string *)v31.__r_.__value_.__r.__words[0];
v16 = sub_1003065B0("Best Time: %s", (const char *)v15);
v17 = (const std::string::value_type *)cocos2d::CCString::getCString(v16);
std::string::assign(&v31, v17);
v12 = 1125187584;
}
v18 = *(float *)&v12;
if ( (v31.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v19 = &v31;
else
v19 = (std::string *)v31.__r_.__value_.__r.__words[0];
v20 = cocos2d::CCLabelBMFont::create_1(v19, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*a1 + 464LL))(a1, v20, 3);
sub_1000262BC((float *)__p, *(float *)&v32 * 0.5, v18);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v20 + 184LL))(v20, __p);
cocos2d::CCLabelBMFont::limitLabelWidth(v20, 200.0, 0.6, 0.0);
if ( *(_DWORD *)(a1[63] + 1336LL) )
{
GameToolbox::pointsToString(&v28);
v21 = std::string::insert(&v28, 0, "Best Points: ");
v22 = *(_OWORD *)&v21->__r_.__value_.__l.__data_;
v30 = v21->__r_.__value_.__r.__words[2];
*(_OWORD *)__p = v22;
v21->__r_.__value_.__l.__size_ = 0;
v21->__r_.__value_.__r.__words[2] = 0;
v21->__r_.__value_.__r.__words[0] = 0;
if ( SHIBYTE(v28.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v28.__r_.__value_.__l.__data_);
if ( v30 >= 0 )
v23 = __p;
else
v23 = (void **)__p[0];
v24 = cocos2d::CCLabelBMFont::create_1(v23, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*a1 + 464LL))(a1, v24, 3);
v25 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20);
sub_1000262BC((float *)&v27, 0.0, -28.0);
*(float32x2_t *)&v26 = sub_100026318(v25, &v27, (float32x2_t *)&v28);
(*(void (__fastcall **)(__int64, std::string *, double))(*(_QWORD *)v24 + 184LL))(v24, &v28, v26);
cocos2d::CCLabelBMFont::limitLabelWidth(v24, 200.0, 0.6, 0.0);
if ( SHIBYTE(v30) < 0 )
operator delete(__p[0]);
}
}
else
{
v6 = sub_1003065B0("%i%%", NormalPercent);
v7 = cocos2d::CCString::getCString(v6);
v8 = *(float *)&v32;
v9 = cocos2d::CCDirector::sharedDirector(v7);
v10 = sub_100207EA0(v9);
sub_1000262BC((float *)__p, v8 * 0.5, v10 + 120.0);
LevelInfoLayer::addProgressBar(a1, __p, v5, 65280, "Best", v7);
}
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
}