//
// LevelInfoLayer::setupPlatformerStats from 0x1002c0d10 to 0x1002c0ff7 (743 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::init @ 0x1002be157
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall LevelInfoLayer::setupPlatformerStats(LevelInfoLayer *a1)
{
const char *data; // r14
unsigned int m_bestTime; // eax
cocos2d::CCString *v4; // rax
int v5; // xmm0_4
const char *CString; // rax
cocos2d::CCString *v7; // rax
const char *v8; // rax
cocos2d::CCLabelBMFont *v9; // r14
std::string *v10; // rax
const char *v11; // rdi
cocos2d::CCLabelBMFont *v12; // r15
unsigned __int64 *v13; // rbx
char v14; // [rsp+0h] [rbp-80h]
char v15; // [rsp+0h] [rbp-80h]
float v16; // [rsp+8h] [rbp-78h] BYREF
unsigned __int64 v17; // [rsp+10h] [rbp-70h] BYREF
std::string v18; // [rsp+18h] [rbp-68h] BYREF
__int128 v19; // [rsp+30h] [rbp-50h] BYREF
void *__p; // [rsp+40h] [rbp-40h]
std::string v21; // [rsp+48h] [rbp-38h] BYREF
float v22; // [rsp+64h] [rbp-1Ch]
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v16);
v21.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)24;
data = v21.__r_.__value_.__s.__data_;
strcpy(v21.__r_.__value_.__s.__data_, "No Best Time");
m_bestTime = a1->m_level->m_bestTime;
if ( (int)m_bestTime <= 0 )
{
v5 = 1124532224;
}
else
{
if ( (unsigned __int16)(m_bestTime / 0xEA60) % 0x3Cu != 0 || m_bestTime >= 0x36EE80 )
{
if ( m_bestTime > 0x36EE7F )
v4 = (cocos2d::CCString *)sub_1007AB580("%02d:%02d:%02d.%03d", v14);
else
v4 = (cocos2d::CCString *)sub_1007AB580("%02d:%02d.%03d", v14);
}
else
{
v4 = (cocos2d::CCString *)sub_1007AB580("%i.%03d", v14);
}
CString = cocos2d::CCString::getCString(v4);
std::string::assign(&v21, CString);
v7 = (cocos2d::CCString *)sub_1007AB580("Best Time: %s", v15);
v8 = cocos2d::CCString::getCString(v7);
std::string::assign(&v21, v8);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
data = v21.__r_.__value_.__l.__data_;
v5 = 1125187584;
}
v22 = *(float *)&v5;
v9 = cocos2d::CCLabelBMFont::create_3(data, "goldFont.fnt");
((void (__fastcall *)(LevelInfoLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v9, 3);
sub_10028CBE0((float *)&v19, v16 * 0.5, v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int128 *))v9->setPosition)(v9, &v19);
cocos2d::CCLabelBMFont::limitLabelWidth(v9, 200.0, 0.60000002, 0.0);
if ( a1->m_level->m_bestPoints )
{
GameToolbox::pointsToString(&v18);
v10 = std::string::insert(&v18, 0, "Best Points: ");
__p = v10->__r_.__value_.__l.__data_;
v19 = *(_OWORD *)&v10->__r_.__value_.__l.0;
*(_OWORD *)&v10->__r_.__value_.__l.0 = 0;
v10->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v18.__r_.__value_.__l.__data_);
if ( (v19 & 1) != 0 )
v11 = (const char *)__p;
else
v11 = (char *)&v19 + 1;
v12 = cocos2d::CCLabelBMFont::create_3(v11, "goldFont.fnt");
((void (__fastcall *)(LevelInfoLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v12, 3);
v13 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v9->getPosition)(v9);
sub_10028CBE0((float *)&v17, 0.0, -28.0);
sub_10028CCE0((double *)&v18, v13, &v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v12->setPosition)(v12, &v18);
cocos2d::CCLabelBMFont::limitLabelWidth(v12, 200.0, 0.60000002, 0.0);
if ( (v19 & 1) != 0 )
operator delete(__p);
}
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v21.__r_.__value_.__l.__data_);
}