//
// LevelInfoLayer::updateLabelValues from 0x1402ff420 to 0x140300251 (3633 bytes)
//
// 5 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x1402fba08
// > LevelInfoLayer::levelDownloadFinished @ 0x1402fbaf9
// > LevelInfoLayer::likedItem @ 0x1402fe9e2
// > LevelInfoLayer::likedItem @ 0x1402fe9ed
// > ??> @ 0x1406d4328
//
// 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
//
// Hidden C++ exception states: #wind=17
void LevelInfoLayer::updateLabelValues(LevelInfoLayer *a1)
{
GJGameLevel *m_level; // rax
int v3; // r15d
int v4; // ecx
unsigned __int64 v5; // rbx
_QWORD *TimeString; // rax
size_t v7; // r8
const char *v8; // rdx
_BOOL8 v9; // rdx
void *v10; // rcx
__int64 v11; // rax
const char *v12; // rdx
__m128i *v13; // rax
const char *v14; // rdx
GameStatsManager *v15; // r14
GameStatsManager *v16; // rbx
cocos2d::CCLabelProtocol_vtbl *v17; // rdi
int v18; // ebx
int AwardedCurrencyForLevel; // eax
cocos2d::CCString *v20; // rax
const char *CString; // rax
signed int v22; // ebx
__m128i *v23; // rax
const char *v24; // rdx
cocos2d::CCSprite_vtbl *v25; // rdi
__int64 v26; // rcx
cocos2d::CCSpriteFrameCache *v27; // rcx
const char *v28; // rdx
struct cocos2d::CCSpriteFrame *v29; // rax
bool v30; // r9
GameManager *v31; // rcx
int AverageDifficulty; // ebx
double v33; // xmm0_8
GJGameLevel *v34; // rdx
GJGameLevel *v35; // rdx
GJFeatureState v36; // edx
int m_isEpic; // edx
cocos2d::CCLabelProtocol_vtbl *v38; // rbx
cocos2d::CCString *v39; // rax
const char *v40; // rax
GameStatsManager *v41; // rcx
int v42; // edi
cocos2d::CCLabelBMFont *m_starsLabel; // rcx
cocos2d::CCLabelBMFont_vtbl *v44; // rbx
float *v45; // rax
double v46; // xmm0_8
const cocos2d::CCPoint *v47; // rax
cocos2d::CCSprite *m_starsIcon; // rcx
cocos2d::CCSprite_vtbl *v49; // rbx
float *v50; // rax
double v51; // xmm0_8
const cocos2d::CCPoint *v52; // rax
bool v53; // bl
cocos2d::CCLabelBMFont *m_orbsLabel; // rcx
cocos2d::CCLabelBMFont_vtbl *v55; // rdx
_BOOL8 v56; // rdx
unsigned int i; // r14d
struct cocos2d::CCObject *v58; // rdi
__int64 v59; // rax
unsigned int j; // ebx
struct cocos2d::CCObject *v61; // rax
GJGameLevel *v62; // rcx
bool v63; // r15
int v64; // ebx
float v65; // xmm6_4
int m_coins; // eax
__int64 v67; // r8
__int64 v68; // rdx
cocos2d::CCString *v69; // rax
bool v70; // zf
const char *v71; // rcx
const char *v72; // rax
size_t v73; // r8
GameStatsManager *v74; // rcx
const char *v75; // rdx
GameStatsManager *v76; // rcx
const char *v77; // rdx
char v78; // r14
struct cocos2d::CCSprite *v79; // rdi
float v80; // xmm0_4
__int16 *v81; // rdx
void *v82; // rcx
__int16 v83; // [rsp+28h] [rbp-E0h] BYREF
char v84; // [rsp+2Ah] [rbp-DEh]
void *v85; // [rsp+30h] [rbp-D8h] BYREF
__int16 v86; // [rsp+38h] [rbp-D0h] BYREF
char v87; // [rsp+3Ah] [rbp-CEh]
__int16 v88; // [rsp+3Ch] [rbp-CCh]
__int16 v89; // [rsp+40h] [rbp-C8h] BYREF
char v90; // [rsp+42h] [rbp-C6h]
__int16 v91; // [rsp+44h] [rbp-C4h]
__int16 v92; // [rsp+48h] [rbp-C0h] BYREF
char v93; // [rsp+4Ah] [rbp-BEh]
cocos2d::CCPoint v94; // [rsp+50h] [rbp-B8h] BYREF
void *v95; // [rsp+58h] [rbp-B0h]
void *v96; // [rsp+60h] [rbp-A8h]
_QWORD Block[3]; // [rsp+68h] [rbp-A0h] BYREF
__int64 v98; // [rsp+80h] [rbp-88h]
unsigned __int64 v99; // [rsp+88h] [rbp-80h]
__m128i v100[2]; // [rsp+90h] [rbp-78h] BYREF
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, 0);
m_level = a1->m_level;
v3 = 4;
if ( m_level->m_levelLength != 5 )
goto LABEL_18;
v4 = (int)floorf((float)m_level->m_timestamp / 240.0);
*(_OWORD *)&Block[1] = 0;
v98 = 5;
v5 = 15;
v99 = 15;
strcpy((char *)&Block[1], "<1min");
if ( v4 > 60 )
{
TimeString = GameToolbox::getTimeString(v100, v4, 1);
if ( TimeString[3] > 0xFu )
TimeString = (_QWORD *)*TimeString;
v7 = -1;
do
++v7;
while ( *((_BYTE *)TimeString + v7) );
sub_14003CCE0((void **)&Block[1], TimeString, v7);
sub_14003A830((__int64)v100);
goto LABEL_10;
}
if ( !v4 )
{
v98 = 4;
strcpy((char *)&Block[1], "Dur.");
LABEL_10:
v5 = v99;
}
v8 = (const char *)&Block[1];
if ( v5 > 0xF )
v8 = (const char *)Block[1];
a1->m_exactLengthLabel->setString(&a1->m_exactLengthLabel->cocos2d::CCLabelProtocol, v8);
LOBYTE(v9) = 1;
a1->m_exactLengthLabel->setVisible(a1->m_exactLengthLabel, v9);
if ( v99 > 0xF )
{
v10 = (void *)Block[1];
if ( v99 + 1 >= 0x1000 )
{
v10 = *(void **)(Block[1] - 8LL);
if ( (unsigned __int64)(Block[1] - (_QWORD)v10 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
LABEL_18:
v11 = GJGameLevel::lengthKeyToString((__int64)v100, a1->m_level->m_levelLength);
v12 = (const char *)v11;
if ( *(_QWORD *)(v11 + 24) > 0xFu )
v12 = *(const char **)v11;
a1->m_lengthLabel->setString(&a1->m_lengthLabel->cocos2d::CCLabelProtocol, v12);
sub_14003A830((__int64)v100);
v13 = GameToolbox::pointsToString(v100, a1->m_level->m_downloads);
v14 = (const char *)v13;
if ( v13[1].m128i_i64[1] > 0xFuLL )
v14 = (const char *)v13->m128i_i64[0];
a1->m_downloadsLabel->setString(&a1->m_downloadsLabel->cocos2d::CCLabelProtocol, v14);
sub_14003A830((__int64)v100);
v15 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v85 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v15 = (GameStatsManager *)qword_1406C2EE8;
}
v16 = v15;
if ( !v15 )
{
v85 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v15 = (GameStatsManager *)qword_1406C2EE8;
}
v17 = a1->m_orbsLabel->__vftable;
v18 = (int)(float)((float)GameStatsManager::getBaseCurrencyForLevel(v16, a1->m_level) * 1.25);
AwardedCurrencyForLevel = GameStatsManager::getAwardedCurrencyForLevel(v15, a1->m_level);
v20 = cocos2d::CCString::createWithFormat("%i/%i", AwardedCurrencyForLevel, v18);
CString = cocos2d::CCString::getCString(v20);
v17->setString(&a1->m_orbsLabel->cocos2d::CCLabelProtocol, CString);
v22 = a1->m_level->m_likes - a1->m_level->m_dislikes;
v23 = GameToolbox::pointsToString(v100, v22);
v24 = (const char *)v23;
if ( v23[1].m128i_i64[1] > 0xFuLL )
v24 = (const char *)v23->m128i_i64[0];
a1->m_likesLabel->setString(&a1->m_likesLabel->cocos2d::CCLabelProtocol, v24);
sub_14003A830((__int64)v100);
v25 = a1->m_likesIcon->__vftable;
v27 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v26);
v28 = "GJ_likesIcon_001.png";
if ( v22 < 0 )
v28 = "GJ_dislikesIcon_001.png";
v29 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v27, v28);
v25->setDisplayFrame(a1->m_likesIcon, v29);
v31 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( v31->m_playerUserID.random - v31->m_playerUserID.seed == a1->m_level->m_userID.random
- a1->m_level->m_userID.seed )
{
if ( v22 >= 50 )
{
GameManager::reportAchievementWithID(v31, "geometry.ach.creator03", 100, v30);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( v22 >= 100 )
{
if ( !v31 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v31, "geometry.ach.creator01", 100, v30);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( v22 >= 250 )
{
if ( !v31 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v31, "geometry.ach.creator04", 100, v30);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( v22 >= 500 )
{
if ( !v31 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v31, "geometry.ach.creator05", 100, v30);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( v22 >= 1000 )
{
if ( !v31 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v31, "geometry.ach.creator06", 100, v30);
v31 = (GameManager *)qword_1406C2ED8;
}
if ( a1->m_level->m_stars.random - a1->m_level->m_stars.seed > 0 )
{
if ( !v31 )
{
v85 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v31 = (GameManager *)qword_1406C2ED8;
}
GameManager::reportAchievementWithID(v31, "geometry.ach.creator02", 100, v30);
}
}
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_lengthLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_exactLengthLabel, 42.0, 0.34999999, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_downloadsLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_likesLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_orbsLabel, 60.0, 0.5, 0.0);
AverageDifficulty = GJGameLevel::getAverageDifficulty(a1->m_level);
v33 = cocos2d::CCPoint::CCPoint(&v94);
v34 = a1->m_level;
if ( v34->m_demon.random - v34->m_demon.seed == 1 )
{
switch ( v34->m_demonDifficulty )
{
case 3:
AverageDifficulty = 7;
break;
case 4:
AverageDifficulty = 8;
break;
case 5:
AverageDifficulty = 9;
break;
case 6:
AverageDifficulty = 10;
break;
default:
AverageDifficulty = 6;
break;
}
*(float *)&v33 = v94.y + 5.0;
v94.y = v94.y + 5.0;
}
if ( v34->m_autoLevel )
AverageDifficulty = -1;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, AverageDifficulty, Long);
a1->m_difficultySprite->setPosition_0(a1->m_difficultySprite, &v94);
v35 = a1->m_level;
if ( v35 )
{
if ( v35->m_featured > 0 || v35->m_isEpic > 0 )
{
m_isEpic = v35->m_isEpic;
if ( m_isEpic <= 0 )
{
v36 = Featured;
}
else
{
if ( m_isEpic < 3 )
{
v3 = 3;
if ( m_isEpic < 2 )
v3 = 2;
}
v36 = v3;
}
}
else
{
v36 = 0;
}
GJDifficultySprite::updateFeatureState(a1->m_difficultySprite, v36);
}
v38 = a1->m_starsLabel->__vftable;
v39 = cocos2d::CCString::createWithFormat("%i", a1->m_level->m_stars.random - a1->m_level->m_stars.seed);
v40 = cocos2d::CCString::getCString(v39);
v38->setString(&a1->m_starsLabel->cocos2d::CCLabelProtocol, v40);
v41 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v85 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v85);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v41 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::hasCompletedStarLevel(v41, a1->m_level) )
{
v83 = -1;
v84 = 50;
a1->m_starsLabel->setColor(&a1->m_starsLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v83);
}
v42 = a1->m_level->m_stars.random - a1->m_level->m_stars.seed;
a1->m_starsLabel->setVisible(a1->m_starsLabel, v42 > 0);
a1->m_starsIcon->setVisible(a1->m_starsIcon, v42 > 0);
m_starsLabel = a1->m_starsLabel;
v44 = m_starsLabel->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v45 = (float *)m_starsLabel->getPosition_0(m_starsLabel);
v46 = cocos2d::CCPoint::CCPoint(*(float *)&v33, *v45);
v44->setPosition_0(a1->m_starsLabel, v47);
m_starsIcon = a1->m_starsIcon;
v49 = m_starsIcon->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v50 = (float *)m_starsIcon->getPosition_0(m_starsIcon);
v51 = cocos2d::CCPoint::CCPoint(*(float *)&v46, *v50);
v49->setPosition_0(a1->m_starsIcon, v52);
v53 = a1->m_orbsLabel->isVisible(a1->m_orbsLabel);
if ( v42 <= 0 || a1->m_challenge )
{
a1->m_orbsLabel->setVisible(a1->m_orbsLabel, 0);
if ( v42 <= 0 )
{
LABEL_89:
v56 = 0;
goto LABEL_90;
}
}
else
{
m_orbsLabel = a1->m_orbsLabel;
v55 = m_orbsLabel->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
LOBYTE(v55) = 1;
m_orbsLabel->setVisible(m_orbsLabel, (bool)v55);
}
if ( a1->m_challenge )
goto LABEL_89;
LOBYTE(v56) = 1;
LABEL_90:
a1->m_orbsIcon->setVisible(a1->m_orbsIcon, v56);
if ( a1->m_orbsLabel->isVisible(a1->m_orbsLabel) != v53 )
{
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_orbsLabel->isVisible)(a1->m_orbsLabel);
for ( i = 0; i < cocos2d::CCArray::count(a1->m_icons); ++i )
{
v58 = cocos2d::CCArray::objectAtIndex(a1->m_icons, i);
cocos2d::CCPoint::CCPoint(*(float *)&v51, 0.0);
v59 = ((__int64 (__fastcall *)(struct cocos2d::CCObject *))v58->__vftable[2].getTag)(v58);
v51 = cocos2d::CCPoint::operator+(v59, &v92);
v58->__vftable[2].encodeWithCoder(v58, (DS_Dictionary *)&v92);
}
}
for ( j = 0; j < cocos2d::CCArray::count(a1->m_coins); ++j )
{
v61 = cocos2d::CCArray::objectAtIndex(a1->m_coins, j);
((void (__fastcall *)(struct cocos2d::CCObject *))v61->__vftable[6].setTag)(v61);
}
cocos2d::CCArray::removeAllObjects(a1->m_coins);
v62 = a1->m_level;
if ( v62->m_coins > 0 )
{
v63 = v62->m_coinsVerified.random - v62->m_coinsVerified.seed == 1;
v64 = 0;
while ( 1 )
{
if ( v64 >= 3 )
return;
v65 = 0.0;
if ( v64 )
{
if ( v64 == 1 )
{
if ( v62->m_coins == 2 )
v65 = 5.0;
}
else if ( v64 == 2 )
{
v65 = 10.0;
}
}
else
{
m_coins = v62->m_coins;
if ( m_coins == 2 )
{
v65 = -5.0;
}
else if ( m_coins >= 3 )
{
v65 = -10.0;
}
}
v67 = (unsigned int)(v64 + 1);
v68 = (unsigned int)(v62->m_levelID.random - v62->m_levelID.seed);
if ( v62->m_dailyID.random - v62->m_dailyID.seed <= 0 )
{
v70 = !v62->m_gauntletLevel;
v71 = "%i_%i_g";
if ( v70 )
v71 = "%i_%i";
v69 = cocos2d::CCString::createWithFormat(v71, v68, v67);
}
else
{
v69 = cocos2d::CCString::createWithFormat("%i_%i_%i", v68, v67, v62->m_dailyID.random - v62->m_dailyID.seed);
}
v72 = cocos2d::CCString::getCString(v69);
*(_OWORD *)&Block[1] = 0;
v98 = 0;
v99 = 0;
v73 = -1;
do
++v73;
while ( v72[v73] );
sub_14003A930(&Block[1], v72, v73);
v74 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v95 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v95);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v74 = (GameStatsManager *)qword_1406C2EE8;
}
v75 = (const char *)&Block[1];
if ( v99 > 0xF )
v75 = (const char *)Block[1];
if ( GameStatsManager::hasUserCoin(v74, v75) )
goto LABEL_126;
v76 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v96 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0((__int64)v96);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v76 = (GameStatsManager *)qword_1406C2EE8;
}
v77 = (const char *)&Block[1];
if ( v99 > 0xF )
v77 = (const char *)Block[1];
if ( GameStatsManager::hasPendingUserCoin(v76, v77) )
LABEL_126:
v78 = 1;
else
v78 = 0;
v79 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
v80 = ((float (__fastcall *)(LevelInfoLayer *, struct cocos2d::CCSprite *))a1->addChild_1)(a1, v79);
cocos2d::CCPoint::CCPoint(v80, v65);
cocos2d::CCPoint::operator+(&a1->m_basePosition, &v85);
v79->setPosition_0(v79, (const cocos2d::CCPoint *)&v85);
cocos2d::CCArray::addObject(a1->m_coins, v79);
if ( !v63 )
break;
if ( !v78 )
{
v91 = -23131;
v92 = -23131;
v93 = -91;
v81 = &v92;
LABEL_133:
v79->setColor(&v79->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v81);
}
if ( v99 > 0xF )
{
v82 = (void *)Block[1];
if ( v99 + 1 >= 0x1000 )
{
v82 = *(void **)(Block[1] - 8LL);
if ( (unsigned __int64)(Block[1] - (_QWORD)v82 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v82);
}
++v64;
v62 = a1->m_level;
if ( v64 >= v62->m_coins )
return;
}
if ( v78 )
{
v83 = -20481;
v86 = -20481;
v87 = 75;
v81 = &v86;
}
else
{
v88 = 29093;
v89 = 29093;
v90 = 48;
v81 = &v89;
}
goto LABEL_133;
}
}