//
// LevelInfoLayer::updateLabelValues from 0x1002af830 to 0x1002b031d (2797 bytes)
//
// 6 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x1002adbd8
// > LevelInfoLayer::levelDownloadFinished @ 0x1002b0414
// > LevelInfoLayer::likedItem @ 0x1002b199d
// > LevelInfoLayer::incrementLikes @ 0x1002b19c2
// > LevelInfoLayer::incrementDislikes @ 0x1002b19e2
// > sub_1002B19F0 @ 0x1002b1a50
//
// This function is hookable on this platform (idp: pc, 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 12:28:01 +0000
//
__int64 __fastcall LevelInfoLayer::updateLabelValues(__int64 a1, __m128 a2, __m128 a3)
{
__int64 v4; // rsi
const std::string::value_type *v5; // rsi
__int64 v6; // rdi
std::string::pointer data; // rsi
__int64 v8; // r14
std::string::pointer v9; // rsi
__int64 v10; // r14
std::string::pointer v11; // rsi
__int64 v12; // r14
_DWORD *v13; // r15
int v14; // r12d
__int64 v15; // rax
char v16; // dl
__int64 v17; // r14
__int64 v18; // rax
__int64 CString; // rax
__int64 v20; // r14
__int64 v21; // r15
int v22; // r14d
std::string::pointer v23; // rsi
__int64 v24; // r15
__int64 v25; // rax
const char *v26; // rsi
__int64 v27; // rdi
const char *v28; // rsi
__int64 v29; // rdx
__int64 v30; // rax
__int64 v31; // rdx
__int64 v32; // rax
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rax
__int64 v36; // rax
__int64 v37; // rax
double v38; // xmm0_8
int AverageDifficulty; // r14d
__int64 v40; // rax
int v41; // esi
__int64 v42; // r14
__int64 v43; // rax
__int64 v44; // rax
__int64 v45; // rax
__int64 v46; // rdi
__int64 v47; // rax
__int64 v48; // rdi
__int64 v49; // r15
int v50; // ebx
int v51; // r12d
__int64 v52; // rax
__int64 v53; // r14
int v54; // xmm0_4
float *v55; // rax
__int64 v56; // r13
__int64 v57; // r14
float *v58; // rax
char v59; // r14
unsigned __int8 v60; // al
_QWORD *v61; // rbx
unsigned int v62; // r15d
char v63; // al
__m128 v64; // xmm0
unsigned int v65; // r14d
__int64 v66; // r13
__int64 v67; // rbx
unsigned __int64 *v68; // rsi
unsigned int v69; // r14d
__int64 v70; // rax
_DWORD *v71; // rdi
__int64 result; // rax
float v73; // xmm0_4
char *v74; // r14
int v75; // r15d
__int64 v76; // xmm0_8
const char *CoinKey_1; // r13
size_t v78; // rax
std::string::size_type v79; // r12
size_t v80; // rbx
__int64 v81; // rax
const char *v82; // rsi
bool hasPendingUserCoin; // r13
__int64 v84; // rax
const char *v85; // rsi
char *v86; // r12
int v87; // eax
char v88; // [rsp+0h] [rbp-A0h]
char v89; // [rsp+0h] [rbp-A0h]
unsigned __int64 v90; // [rsp+8h] [rbp-98h] BYREF
unsigned __int64 *v91; // [rsp+10h] [rbp-90h]
std::string::value_type __s[8]; // [rsp+18h] [rbp-88h] BYREF
char v93; // [rsp+20h] [rbp-80h]
void *__p; // [rsp+28h] [rbp-78h]
__int64 v95; // [rsp+30h] [rbp-70h] BYREF
__int64 v96; // [rsp+38h] [rbp-68h]
__m128 v97; // [rsp+40h] [rbp-60h]
int v98; // [rsp+50h] [rbp-50h]
unsigned __int64 v99; // [rsp+54h] [rbp-4Ch] BYREF
float v100; // [rsp+5Ch] [rbp-44h]
std::string __dst; // [rsp+60h] [rbp-40h] BYREF
*(double *)a2.i64 = (*(double (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 568) + 344LL))(
*(_QWORD *)(a1 + 568),
0);
if ( (unsigned __int8)GJGameLevel::isPlatformer(*(_QWORD *)(a1 + 504), *(double *)a2.i64) )
{
a2.f32[0] = (float)*(int *)(*(_QWORD *)(a1 + 504) + 1232LL) / 240.0;
a2.i64[0] = _mm_round_ss(a2, a2, 9).u64[0];
v4 = (unsigned int)(int)a2.f32[0];
strcpy((char *)&__dst, "\n<1min");
if ( (int)v4 < 61 )
{
if ( !(_DWORD)v4 )
std::string::assign(&__dst, "Dur.");
}
else
{
GameToolbox::getTimeString(__s, v4, 1);
if ( (__s[0] & 1) != 0 )
v5 = (const std::string::value_type *)__p;
else
v5 = &__s[1];
std::string::assign(&__dst, v5);
if ( (__s[0] & 1) != 0 )
operator delete(__p);
}
v6 = *(_QWORD *)(a1 + 568);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
data = __dst.__r_.__value_.__l.__data_;
else
data = __dst.__r_.__value_.__s.__data_;
(*(void (__fastcall **)(__int64, std::string::pointer))(*(_QWORD *)v6 + 928LL))(v6, data);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 568) + 344LL))(*(_QWORD *)(a1 + 568), 1);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
}
v8 = *(_QWORD *)(a1 + 560);
GJGameLevel::lengthKeyToString(&__dst, *(unsigned int *)(*(_QWORD *)(a1 + 504) + 900LL));
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v9 = __dst.__r_.__value_.__l.__data_;
else
v9 = __dst.__r_.__value_.__s.__data_;
(*(void (__fastcall **)(__int64, std::string::pointer))(*(_QWORD *)v8 + 928LL))(v8, v9);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v10 = *(_QWORD *)(a1 + 576);
GameToolbox::pointsToString(&__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v11 = __dst.__r_.__value_.__l.__data_;
else
v11 = __dst.__r_.__value_.__s.__data_;
(*(void (__fastcall **)(__int64, std::string::pointer))(*(_QWORD *)v10 + 928LL))(v10, v11);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v12 = GameStatsManager::sharedState();
v13 = *(_DWORD **)(a1 + 504);
v14 = v13[230] - v13[231];
v15 = GameStatsManager::sharedState();
GameStatsManager::isDailyRecall(
v15,
*(_DWORD *)(*(_QWORD *)(a1 + 504) + 920LL) - *(_DWORD *)(*(_QWORD *)(a1 + 504) + 924LL));
*(_QWORD *)__s = GameStatsManager::orbInfoForLevel(v12, v13, v14, *(double *)a2.i64, a3);
v93 = v16;
v17 = *(_QWORD *)(a1 + 592);
v18 = sub_10088E820("%i/%i", v88);
CString = cocos2d::CCString::getCString(v18);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 928LL))(v17, CString);
v20 = *(_QWORD *)(a1 + 592);
if ( sub_1000369F0((__int64)__s) )
{
__dst.__r_.__value_.__s.__data_[1] = -106;
*(_WORD *)&__dst.__r_.__value_.__l.0 = -26986;
}
else
{
__dst.__r_.__value_.__s.__data_[1] = -1;
*(_WORD *)&__dst.__r_.__value_.__l.0 = -1;
}
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v20 + 1072LL))(v20, &__dst);
v21 = *(_QWORD *)(a1 + 584);
v22 = *(_DWORD *)(*(_QWORD *)(a1 + 504) + 892LL) - *(_DWORD *)(*(_QWORD *)(a1 + 504) + 896LL);
GameToolbox::pointsToString(&__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v23 = __dst.__r_.__value_.__l.__data_;
else
v23 = __dst.__r_.__value_.__s.__data_;
(*(void (__fastcall **)(__int64, std::string::pointer))(*(_QWORD *)v21 + 928LL))(v21, v23);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v24 = *(_QWORD *)(a1 + 624);
v25 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*(double *)a2.i64);
v26 = "GJ_dislikesIcon_001.png";
if ( v22 >= 0 )
v26 = "GJ_likesIcon_001.png";
v27 = v24;
v28 = (const char *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v25, v26);
(*(void (__fastcall **)(__int64, const char *))(*(_QWORD *)v24 + 1160LL))(v24, v28);
GameManager::sharedState(v24, v28, v29);
v31 = (unsigned int)(*(_DWORD *)(*(_QWORD *)(a1 + 504) + 576LL) - *(_DWORD *)(*(_QWORD *)(a1 + 504) + 580LL));
if ( *(_DWORD *)(v30 + 660) - *(_DWORD *)(v30 + 664) == (_DWORD)v31 )
{
if ( v22 >= 50 )
{
GameManager::sharedState(v24, v28, v31);
v28 = "geometry.ach.creator03";
v27 = v32;
GameManager::reportAchievementWithID(v32, "geometry.ach.creator03", 100, 0);
if ( (unsigned int)v22 >= 0x64 )
{
GameManager::sharedState(v27, "geometry.ach.creator03", v31);
v28 = "geometry.ach.creator01";
v27 = v33;
GameManager::reportAchievementWithID(v33, "geometry.ach.creator01", 100, 0);
if ( (unsigned int)v22 >= 0xFA )
{
GameManager::sharedState(v27, "geometry.ach.creator01", v31);
v28 = "geometry.ach.creator04";
v27 = v34;
GameManager::reportAchievementWithID(v34, "geometry.ach.creator04", 100, 0);
if ( (unsigned int)v22 >= 0x1F4 )
{
GameManager::sharedState(v27, "geometry.ach.creator04", v31);
v28 = "geometry.ach.creator05";
v27 = v35;
GameManager::reportAchievementWithID(v35, "geometry.ach.creator05", 100, 0);
if ( (unsigned int)v22 >= 0x3E8 )
{
GameManager::sharedState(v27, "geometry.ach.creator05", v31);
v28 = "geometry.ach.creator06";
v27 = v36;
GameManager::reportAchievementWithID(v36, "geometry.ach.creator06", 100, 0);
}
}
}
}
}
if ( *(_DWORD *)(*(_QWORD *)(a1 + 504) + 948LL) > *(_DWORD *)(*(_QWORD *)(a1 + 504) + 952LL) )
{
GameManager::sharedState(v27, v28, v31);
GameManager::reportAchievementWithID(v37, "geometry.ach.creator02", 100, 0);
}
}
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 560), 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 568), 42.0, 0.34999999, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 576), 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 584), 60.0, 0.5, 0.0);
*(_QWORD *)&v38 = 1114636288;
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 592), 60.0, 0.5, 0.0);
AverageDifficulty = GJGameLevel::getAverageDifficulty(*(_QWORD *)(a1 + 504));
v91 = (unsigned __int64 *)(a1 + 692);
sub_1002782D0(&v95, (_QWORD *)(a1 + 692));
v40 = *(_QWORD *)(a1 + 504);
if ( *(_DWORD *)(v40 + 932) - *(_DWORD *)(v40 + 936) == 1 )
{
AverageDifficulty = GJGameLevel::demonIconForDifficulty(*(unsigned int *)(v40 + 944));
*(_QWORD *)&v38 = HIDWORD(v95);
*(float *)&v38 = *((float *)&v95 + 1) + 5.0;
*((float *)&v95 + 1) = *((float *)&v95 + 1) + 5.0;
v40 = *(_QWORD *)(a1 + 504);
}
v41 = -1;
if ( !*(_BYTE *)(v40 + 960) )
v41 = AverageDifficulty;
GJDifficultySprite::updateDifficultyFrame(*(_QWORD **)(a1 + 656), v41, 1, v38);
(*(void (__fastcall **)(_QWORD, __int64 *))(**(_QWORD **)(a1 + 656) + 184LL))(*(_QWORD *)(a1 + 656), &v95);
GJDifficultySprite::updateFeatureStateFromLevel(*(_QWORD *)(a1 + 656), *(_QWORD *)(a1 + 504));
v42 = *(_QWORD *)(a1 + 672);
v43 = sub_10088E820("%i", v89);
v44 = cocos2d::CCString::getCString(v43);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v42 + 928LL))(v42, v44);
v45 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedStarLevel(v45, *(_QWORD *)(a1 + 504)) )
{
v46 = *(_QWORD *)(a1 + 672);
__dst.__r_.__value_.__s.__data_[1] = 50;
*(_WORD *)&__dst.__r_.__value_.__l.0 = -1;
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v46 + 1072LL))(v46, &__dst);
}
v47 = *(_QWORD *)(a1 + 504);
v48 = *(_QWORD *)(a1 + 672);
v49 = a1;
v50 = *(_DWORD *)(v47 + 948);
v51 = *(_DWORD *)(v47 + 952);
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v48 + 344LL))(v48, v50 > v51);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v49 + 664) + 344LL))(*(_QWORD *)(v49 + 664), v50 > v51);
v52 = *(_QWORD *)(v49 + 504);
v96 = v49;
v53 = *(_QWORD *)(v49 + 672);
if ( *(_DWORD *)(v52 + 932) - *(_DWORD *)(v52 + 936) == 1 )
*(float *)&v54 = -4.0;
else
*(float *)&v54 = 0.0;
v100 = *(float *)&v54;
v55 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v53 + 192LL))(v53);
v56 = v96;
sub_100278250((float *)&__dst, *v55, *(float *)(v96 + 700) + v100);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v53 + 184LL))(v53, &__dst);
v57 = *(_QWORD *)(v56 + 664);
v58 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v57 + 192LL))(v57);
sub_100278250((float *)&__dst, *v58, *(float *)(v56 + 700) + v100);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v57 + 184LL))(v57, &__dst);
v59 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v56 + 592) + 352LL))(*(_QWORD *)(v56 + 592));
if ( v50 <= v51 )
v60 = 0;
else
v60 = *(_BYTE *)(v56 + 704) ^ 1;
v61 = (_QWORD *)v56;
v62 = v60;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v56 + 592) + 344LL))(*(_QWORD *)(v56 + 592), v60);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v56 + 632) + 344LL))(*(_QWORD *)(v56 + 632), v62);
if ( v59 != (*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(v56 + 592) + 352LL))(*(_QWORD *)(v56 + 592)) )
{
v63 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v56 + 592) + 352LL))(*(_QWORD *)(v56 + 592));
v64 = (__m128)*(unsigned int *)(v56 + 688);
if ( !v63 )
v64 = _mm_xor_ps(v64, (__m128)xmmword_100A035F0);
v97 = v64;
if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(v56 + 680)) )
{
v65 = 0;
do
{
v66 = sub_1007FEFE0(v61[85], v65);
v67 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v66 + 192LL))(v66);
sub_100278250((float *)&v99, 0.0, v97.f32[0]);
v68 = (unsigned __int64 *)v67;
v61 = (_QWORD *)v96;
sub_100278350((double *)&__dst, v68, &v99);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v66 + 184LL))(v66, &__dst);
++v65;
}
while ( v65 < (unsigned int)sub_1007FEF90(v61[85]) );
}
}
if ( (unsigned int)sub_1007FEF90(v61[64]) )
{
v69 = 0;
do
{
v70 = sub_1007FEFE0(v61[64], v69);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v70 + 520LL))(v70);
++v69;
}
while ( v69 < (unsigned int)sub_1007FEF90(v61[64]) );
}
sub_1007FF190(v61[64]);
v71 = (_DWORD *)v61[63];
result = (unsigned int)v71[241];
if ( (int)result > 0 )
{
if ( v71[237] <= v71[238] )
{
v98 = v71[242] - v71[243];
v73 = -31.5;
LABEL_73:
v74 = __dst.__r_.__value_.__s.__data_;
v100 = v100 + v73;
v75 = 0;
while ( 1 )
{
v76 = 1092616192;
v97.i32[0] = 1092616192;
if ( v75 == 2 )
goto LABEL_81;
if ( v75 == 1 )
{
v76 = 1084227584;
v97.i32[0] = 1084227584;
if ( (_DWORD)result != 2 )
goto LABEL_80;
}
else
{
v76 = 3231711232LL;
v97.i32[0] = -1063256064;
if ( (_DWORD)result != 2 )
{
v76 = 3240099840LL;
v97.i32[0] = -1054867456;
if ( (unsigned int)result <= 2 )
{
LABEL_80:
v76 = 0;
v97.i32[0] = 0;
}
}
}
LABEL_81:
CoinKey_1 = (const char *)GJGameLevel::getCoinKey_1(v71, (unsigned int)++v75);
v78 = strlen(CoinKey_1);
if ( v78 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v79 = v78;
if ( v78 >= 0x17 )
{
v80 = (v78 | 7) + 1;
if ( (v78 | 7) == 0x17 )
v80 = 26;
v74 = (char *)operator new(v80);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v74;
__dst.__r_.__value_.__r.__words[0] = v80 + 1;
v61 = (_QWORD *)v96;
__dst.__r_.__value_.__l.__size_ = v79;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v78);
if ( !v78 )
goto LABEL_89;
}
memmove(v74, CoinKey_1, v79);
LABEL_89:
v74[v79] = 0;
v81 = GameStatsManager::sharedState();
v74 = __dst.__r_.__value_.__s.__data_;
v82 = __dst.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v82 = __dst.__r_.__value_.__l.__data_;
hasPendingUserCoin = 1;
if ( !GameStatsManager::hasUserCoin(v81, v82) )
{
v84 = GameStatsManager::sharedState();
v85 = __dst.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v85 = __dst.__r_.__value_.__l.__data_;
hasPendingUserCoin = GameStatsManager::hasPendingUserCoin(v84, v85);
}
v86 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"usercoin_small01_001.png", *(double *)&v76);
(*(void (__fastcall **)(_QWORD *, char *))(*v61 + 456LL))(v61, v86);
sub_100278250((float *)&v90, v97.f32[0], v100);
sub_100278350((double *)&v99, v91, &v90);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v86 + 184LL))(v86, &v99);
sub_1007FEBF0(v61[64], v86);
if ( v98 == 1 )
{
if ( !hasPendingUserCoin )
{
BYTE2(v99) = -91;
LOWORD(v99) = -23131;
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v86 + 960LL))(v86, &v99);
}
}
else
{
v87 = 3174821;
if ( hasPendingUserCoin )
v87 = 4960255;
LOWORD(v99) = v87;
BYTE2(v99) = BYTE2(v87);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v86 + 960LL))(v86, &v99);
}
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
result = (unsigned int)(v75 - 1);
if ( (unsigned int)result <= 1 )
{
v71 = (_DWORD *)v61[63];
result = (unsigned int)v71[241];
if ( v75 < (int)result )
continue;
}
return result;
}
}
if ( !(unsigned __int8)GJGameLevel::levelHasDiamonds(v71) )
{
v73 = -45.5;
v71 = (_DWORD *)v61[63];
result = (unsigned int)v71[241];
if ( (int)result <= 0 )
return result;
goto LABEL_72;
}
v73 = -60.0;
v71 = (_DWORD *)v61[63];
result = (unsigned int)v71[241];
if ( (int)result > 0 )
{
LABEL_72:
v98 = v71[242] - v71[243];
goto LABEL_73;
}
}
return result;
}