//
// sub_1004F296C from 0x1004f296c to 0x1004f2d34 (968 bytes)
//
// 1 xrefs:
// > LevelStatsInfoPopup::init @ 0x1004f26b8
//
// 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 11:06:46 +0000
//
void __usercall sub_1004F296C(__int64 a1@, std::string *a2@)
{
__int64 v4; // x8
__int64 v5; // x8
std::string *p_p; // x9
void *v7; // x0
char *CString; // x0
_DWORD *v9; // x8
void *v10; // x0
const std::string::value_type *v11; // x0
void *v12; // x0
const std::string::value_type *v13; // x0
int NormalPercent; // w0
void *v15; // x0
const std::string::value_type *v16; // x0
__int64 v17; // x8
int v18; // w0
std::string *v19; // x8
void *v20; // x0
const std::string::value_type *v21; // x0
__int64 v22; // x0
std::string *v23; // x8
void *v24; // x0
const std::string::value_type *v25; // x0
std::string *v26; // x9
void *v27; // x0
char *v28; // x0
_DWORD *v29; // x0
void *v30; // x0
const std::string::value_type *v31; // x0
int v32; // w21
int v33; // w22
int v34; // w0
void *v35; // x0
const std::string::value_type *v36; // x0
int v37; // w0
_DWORD *v38; // x8
void *v39; // x0
const std::string::value_type *v40; // x0
int v41; // w10
void *v42; // x0
const std::string::value_type *v43; // x0
int v44; // w8
void *v45; // x0
const std::string::value_type *v46; // x0
std::string __p; // [xsp+20h] [xbp-40h] BYREF
if ( GJGameLevel::isPlatformer(*(_QWORD *)(a1 + 664)) )
{
v4 = *(_QWORD *)(a1 + 664);
if ( *(char *)(v4 + 367) < 0 )
{
sub_1000097D0(&__p, *(void **)(v4 + 344), *(_QWORD *)(v4 + 352));
v4 = *(_QWORD *)(a1 + 664);
}
else
{
__p = *(std::string *)(v4 + 344);
}
p_p = &__p;
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v7 = sub_1003065B0(
"%s\nTotal Attempts: %i",
(const char *)p_p,
*(_DWORD *)(v4 + 796) - *(_DWORD *)(v4 + 800));
CString = (char *)cocos2d::CCString::getCString((__int64)v7);
sub_100009900(a2, CString);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v9 = *(_DWORD **)(a1 + 664);
if ( (int)v9[383] >= 1 )
{
v10 = sub_1003065B0("\nPractice Attempts: %i", v9[383]);
v11 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v10);
std::string::append(a2, v11);
v9 = *(_DWORD **)(a1 + 664);
}
v12 = sub_1003065B0("\nTotal Jumps: %i", v9[202] - v9[203]);
v13 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v12);
std::string::append(a2, v13);
if ( (int)GJGameLevel::getNormalPercent(*(_QWORD *)(a1 + 664)) >= 1
&& (int)GJGameLevel::getNormalPercent(*(_QWORD *)(a1 + 664)) <= 99 )
{
NormalPercent = GJGameLevel::getNormalPercent(*(_QWORD *)(a1 + 664));
v15 = sub_1003065B0("\nBest: %i%%", NormalPercent);
v16 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v15);
std::string::append(a2, v16);
}
v17 = *(_QWORD *)(a1 + 664);
v18 = *(_DWORD *)(v17 + 1296);
if ( v18 >= 1 )
{
GameToolbox::msToTimeString(v18, 0, &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v19 = &__p;
else
v19 = (std::string *)__p.__r_.__value_.__r.__words[0];
v20 = sub_1003065B0("\nBest Time: %s", (const char *)v19);
v21 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v20);
std::string::append(a2, v21);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v17 = *(_QWORD *)(a1 + 664);
}
v22 = *(unsigned int *)(v17 + 1336);
if ( (_DWORD)v22 )
{
GameToolbox::pointsToString(v22, (__int64)&__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v23 = &__p;
else
v23 = (std::string *)__p.__r_.__value_.__r.__words[0];
v24 = sub_1003065B0("\nBest Points: %s", (const char *)v23);
v25 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v24);
std::string::append(a2, v25);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}
}
else
{
v5 = *(_QWORD *)(a1 + 664);
if ( *(char *)(v5 + 367) < 0 )
{
sub_1000097D0(&__p, *(void **)(v5 + 344), *(_QWORD *)(v5 + 352));
v5 = *(_QWORD *)(a1 + 664);
}
else
{
__p = *(std::string *)(v5 + 344);
}
v26 = &__p;
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v26 = (std::string *)__p.__r_.__value_.__r.__words[0];
v27 = sub_1003065B0(
"%s\nTotal Attempts: %i",
(const char *)v26,
*(_DWORD *)(v5 + 796) - *(_DWORD *)(v5 + 800));
v28 = (char *)cocos2d::CCString::getCString((__int64)v27);
sub_100009900(a2, v28);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v29 = *(_DWORD **)(a1 + 664);
if ( (int)v29[383] >= 1 )
{
v30 = sub_1003065B0("\nPractice Attempts: %i", v29[383]);
v31 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v30);
std::string::append(a2, v31);
v29 = *(_DWORD **)(a1 + 664);
}
v32 = v29[202];
v33 = v29[203];
v34 = GJGameLevel::getNormalPercent((__int64)v29);
v35 = sub_1003065B0(
"\nTotal Jumps: %i\nNormal: %i%%\nPractice: %i%%",
v32 - v33,
v34,
*(_DWORD *)(*(_QWORD *)(a1 + 664) + 888LL));
v36 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v35);
std::string::append(a2, v36);
v37 = GJGameLevel::getNormalPercent(*(_QWORD *)(a1 + 664));
v38 = *(_DWORD **)(a1 + 664);
if ( v37 != v38[219] - v38[220] )
{
v39 = sub_1003065B0("\nLeaderboard: %i%%", v38[219] - v38[220]);
v40 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v39);
std::string::append(a2, v40);
v38 = *(_DWORD **)(a1 + 664);
}
v41 = v38[206];
if ( v38[205] - v41 >= 1 )
{
v42 = sub_1003065B0("\nClicks (best att.): %i", v38[205] - v41);
v43 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v42);
std::string::append(a2, v43);
v38 = *(_DWORD **)(a1 + 664);
}
v44 = v38[208] - v38[209];
if ( v44 >= 1 )
{
v45 = sub_1003065B0("\nTime (best att.): %is", v44);
v46 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v45);
std::string::append(a2, v46);
}
}
}