//
// GJLevelScoreCell::loadFromScore from 0x140157080 to 0x140157b71 (2801 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x140145e03
// > ??> @ 0x14091799c
//
// 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 11:27:21 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall GJLevelScoreCell::loadFromScore(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
__int64 v4; // r14
__int64 v5; // rbx
__int64 v6; // rax
__int64 v7; // rcx
void (__fastcall **v8)(__int64, __int64); // rbx
__int64 v9; // rax
__int64 v10; // rcx
__int64 v11; // rax
__int64 v12; // rax
bool v13; // al
struct cocos2d::CCMenu *v14; // r12
int v15; // eax
cocos2d::CCString *v16; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v18; // rbx
char *v19; // rdx
__m128i *v20; // rcx
struct cocos2d::CCSprite *v21; // rbx
__m128i *v22; // rcx
cocos2d::CCLabelBMFont *v23; // r15
float v24; // xmm2_4
float v25; // xmm1_4
cocos2d::CCObject *v26; // rdi
float v27; // xmm6_4
double v28; // xmm0_8
float v29; // xmm9_4
__int64 v30; // rax
__int64 v31; // rbx
__int64 v32; // rax
float v33; // xmm6_4
double v34; // xmm0_8
__int64 v35; // rax
__int64 v36; // rbx
__int64 v37; // rax
_DWORD *v38; // rax
signed int v39; // edx
void **v40; // rbx
void *v41; // rcx
cocos2d::CCString *v42; // rax
char *v43; // rax
size_t v44; // r8
const char *v45; // rcx
struct cocos2d::CCLabelBMFont *v46; // r14
__int64 v47; // rbx
__int64 v48; // rax
__int64 v49; // rbx
__int64 v50; // rax
__int64 v51; // rax
__int64 v52; // rax
int v53; // ecx
int v54; // r15d
__int64 v55; // r12
struct cocos2d::CCSprite *v56; // rdi
__int64 v57; // rax
__int64 v58; // rbx
__int64 v59; // rax
const char *v60; // rdx
cocos2d::CCString *v61; // rax
const char *v62; // rax
cocos2d::CCLabelBMFont *v63; // rdi
__int64 v64; // rbx
__int64 v65; // rax
__int64 v66; // rdx
__int64 v67; // rbx
__int64 v68; // rax
__int16 v69; // [rsp+38h] [rbp-D0h] BYREF
char v70; // [rsp+3Ah] [rbp-CEh]
_BYTE v71[8]; // [rsp+3Ch] [rbp-CCh] BYREF
_BYTE v72[12]; // [rsp+44h] [rbp-C4h] BYREF
void *v73; // [rsp+50h] [rbp-B8h] BYREF
_BYTE v74[8]; // [rsp+58h] [rbp-B0h] BYREF
void *Block[2]; // [rsp+60h] [rbp-A8h] BYREF
void *Block_8[2]; // [rsp+68h] [rbp-A0h] BYREF
__int128 v77; // [rsp+78h] [rbp-90h]
__m128i v78; // [rsp+88h] [rbp-80h] BYREF
__int64 v79; // [rsp+98h] [rbp-70h]
unsigned __int64 v80; // [rsp+A0h] [rbp-68h]
_QWORD v81[4]; // [rsp+A8h] [rbp-60h] BYREF
v2 = a2;
LOBYTE(a2) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 544) + 576LL))(*(_QWORD *)(a1 + 544), a2);
*(_QWORD *)(a1 + 560) = v2;
v4 = SimplePlayer::create(1);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(*(_QWORD *)(a1 + 544), v4, 1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 160LL))(v4);
v5 = *(_QWORD *)v4;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, 60.0, (float)(*(float *)(a1 + 532) * 0.5) + 0.0);
(*(void (__fastcall **)(__int64, __int64))(v5 + 184))(v4, v6);
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v73 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v73);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
v8 = *(void (__fastcall ***)(__int64, __int64))(v4 + 320);
v9 = GameManager::colorForIdx(v7, &v69, *(unsigned int *)(*(_QWORD *)(a1 + 560) + 432LL));
(*v8)(v4 + 320, v9);
v10 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v73 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v73);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v10 = qword_14090BFD0;
}
v11 = GameManager::colorForIdx(v10, v71, *(unsigned int *)(*(_QWORD *)(a1 + 560) + 436LL));
(**(void (__fastcall ***)(__int64, __int64))(*(_QWORD *)(v4 + 608) + 320LL))(*(_QWORD *)(v4 + 608) + 320LL, v11);
SimplePlayer::updateColors(v4);
SimplePlayer::tryEnableCustomGlowColor(v4, *(unsigned int *)(*(_QWORD *)(a1 + 560) + 440LL));
v12 = *(_QWORD *)(a1 + 560);
v13 = *(_DWORD *)(v12 + 444) == 2 || *(_BYTE *)(v12 + 744);
*(_BYTE *)(v4 + 660) = v13;
SimplePlayer::updatePlayerFrame(
v4,
*(unsigned int *)(*(_QWORD *)(a1 + 560) + 428LL),
*(unsigned int *)(*(_QWORD *)(a1 + 560) + 448LL));
SimplePlayer::updateColors(v4);
v14 = cocos2d::CCMenu::create(nullptr);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCMenu *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v14);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, 22.0, *(float *)(a1 + 532) * 0.5);
v15 = *(_DWORD *)(*(_QWORD *)(a1 + 560) + 412LL);
if ( v15 <= 3 )
{
v78 = 0;
v79 = 0;
v80 = 15;
v78.m128i_i8[0] = 0;
if ( v15 == 1 )
{
v19 = (char *)sub_14003D460(0x20u);
v79 = 22;
v80 = 31;
strcpy(v19, "rankIcon_top10_001.png");
v78.m128i_i64[0] = (__int64)v19;
}
else
{
if ( v15 == 2 )
{
v19 = (char *)sub_14003D460(0x20u);
v79 = 22;
v80 = 31;
strcpy(v19, "rankIcon_top50_001.png");
}
else
{
v19 = (char *)sub_14003D460(0x20u);
v79 = 23;
v80 = 31;
strcpy(v19, "rankIcon_top100_001.png");
}
v78.m128i_i64[0] = (__int64)v19;
}
v20 = &v78;
if ( v80 > 0xF )
v20 = (__m128i *)v19;
v21 = cocos2d::CCSprite::createWithSpriteFrameName(v20->m128i_i8);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v21);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v21 + 184LL))(v21, v74);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v21 + 160LL))(v21);
sub_14003D310((__int64)&v78);
}
else
{
v16 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v15);
CString = cocos2d::CCString::getCString(v16);
v18 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v18);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v18 + 184LL))(v18, v74);
cocos2d::CCLabelBMFont::limitLabelWidth(v18, 20.0, 0.75, 0.0);
}
sub_14003F4F0((__int64)&v78, *(_QWORD *)(a1 + 560) + 320LL);
v22 = &v78;
if ( v80 > 0xF )
v22 = (__m128i *)v78.m128i_i64[0];
v23 = cocos2d::CCLabelBMFont::create(v22->m128i_i8, "goldFont.fnt");
sub_14003D310((__int64)&v78);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 560) + 936LL) == 1 )
{
v24 = 0.69999999;
v25 = 100.0;
}
else
{
v24 = 0.80000001;
v25 = 130.0;
}
cocos2d::CCLabelBMFont::limitLabelWidth(v23, v25, v24, 0.0);
v26 = CCMenuItemSpriteExtra::create((int)v23, 0, a1, (__int64)GJCompactUserCell::onViewProfile);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v14 + 464LL))(v14, v26);
v27 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v23 + 320LL))(v23);
v28 = (*(double (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v23 + 168LL))(v23);
v29 = *(float *)&v28 * v27;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v73, 30.0, 0.0);
v31 = v30;
v32 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 200LL))(v4);
cocos2d::CCPoint::operator+(v32, Block, v31);
v33 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v23 + 320LL))(v23) * 0.5;
v34 = (*(double (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v23 + 168LL))(v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v73, *(float *)&v34 * v33, 0.0);
cocos2d::CCPoint::operator+(Block, v71, v35);
v36 = *(_QWORD *)v26;
cocos2d::CCNode::convertToNodeSpace(v14, v72, v71);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v36 + 184))(v26, v37);
if ( (unsigned __int8)GJUserScore::isCurrentUser(*(_QWORD *)(a1 + 560)) )
{
v69 = -26906;
v70 = 10;
(**(void (__fastcall ***)(__int64, __int16 *))(*(_QWORD *)(a1 + 536) + 408LL))(*(_QWORD *)(a1 + 536) + 408LL, &v69);
}
v38 = *(_DWORD **)(a1 + 560);
v39 = v38[99];
*(_OWORD *)Block_8 = 0;
*(_QWORD *)&v77 = 0;
*((_QWORD *)&v77 + 1) = 15;
LOBYTE(Block_8[0]) = 0;
if ( v38[234] == 1 )
{
if ( v38[235] )
{
v40 = (void **)GameToolbox::pointsToString(&v78, v39);
if ( Block_8 != v40 )
{
if ( *((_QWORD *)&v77 + 1) > 0xFu )
{
v41 = Block_8[0];
if ( (unsigned __int64)(*((_QWORD *)&v77 + 1) + 1LL) >= 0x1000 )
{
v41 = *((void **)Block_8[0] - 1);
if ( (unsigned __int64)((char *)Block_8[0] - (char *)v41 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
goto LABEL_39;
}
LABEL_40:
*(_QWORD *)&v77 = 0;
*((_QWORD *)&v77 + 1) = 15;
LOBYTE(Block_8[0]) = 0;
*(_OWORD *)Block_8 = *(_OWORD *)v40;
v77 = *((_OWORD *)v40 + 1);
v40[2] = nullptr;
v40[3] = (void *)15;
*(_BYTE *)v40 = 0;
}
}
else
{
v40 = GameToolbox::msToTimeString((void **)&v78, v39, 1);
if ( Block_8 != v40 )
{
if ( *((_QWORD *)&v77 + 1) > 0xFu )
{
v41 = Block_8[0];
if ( (unsigned __int64)(*((_QWORD *)&v77 + 1) + 1LL) >= 0x1000 )
{
v41 = *((void **)Block_8[0] - 1);
if ( (unsigned __int64)((char *)Block_8[0] - (char *)v41 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
LABEL_39:
j_j_free(v41);
goto LABEL_40;
}
goto LABEL_40;
}
}
sub_14003D310((__int64)&v78);
goto LABEL_45;
}
v42 = cocos2d::CCString::createWithFormat("%i%%", v39);
v43 = (char *)cocos2d::CCString::getCString(v42);
v44 = -1;
do
++v44;
while ( v43[v44] );
sub_1400405A0(Block_8, v43, v44);
LABEL_45:
v45 = (const char *)Block_8;
if ( *((_QWORD *)&v77 + 1) > 0xFu )
v45 = (const char *)Block_8[0];
v46 = cocos2d::CCLabelBMFont::create(v45, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v46,
2);
v47 = *(_QWORD *)v46;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 560) + 936LL) == 1 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v47 + 288))(v46, v48);
cocos2d::CCLabelBMFont::limitLabelWidth(v46, 85.0, 0.5, 0.0);
v49 = *(_QWORD *)v46;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, *(float *)(a1 + 528) - 60.0, *(float *)(a1 + 532) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v49 + 184))(v46, v50);
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v47 + 288))(v46, v51);
cocos2d::CCLabelBMFont::limitLabelWidth(v46, 200.0, 0.60000002, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v29 + 6.0, -1.0);
cocos2d::CCPoint::operator+(Block, v71, v52);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v46 + 184LL))(v46, v71);
v53 = *(_DWORD *)(*(_QWORD *)(a1 + 560) + 420LL);
if ( v53 > 0 )
{
v54 = 65;
v55 = (unsigned int)v53;
do
{
v56 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 544) + 464LL))(
*(_QWORD *)(a1 + 544),
v56);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v56 + 160LL))(v56);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, (float)v54, 5.0);
v58 = v57;
v59 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v46 + 200LL))(v46);
cocos2d::CCPoint::operator+(v59, v71, v58);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v56 + 184LL))(v56, v71);
v54 += 8;
--v55;
}
while ( v55 );
}
}
sub_14003F4F0((__int64)v81, *(_QWORD *)(a1 + 560) + 800LL);
v60 = (const char *)v81;
if ( v81[3] > 0xFu )
v60 = (const char *)v81[0];
v61 = cocos2d::CCString::createWithFormat("%s ago", v60);
v62 = cocos2d::CCString::getCString(v61);
v63 = cocos2d::CCLabelBMFont::create(v62, "chatFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v63,
1);
v64 = *(_QWORD *)v63;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, 1.0, 0.5);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v64 + 288))(v63, v65);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v63 + 160LL))(v63);
(**((void (__fastcall ***)(__int64, __int16 *))v63 + 46))((__int64)v63 + 368, &word_140702F60);
LOBYTE(v66) = 125;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v63 + 46) + 40LL))((__int64)v63 + 368, v66);
v67 = *(_QWORD *)v63;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, *(float *)(a1 + 528) - 11.0, 10.0);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64))(v67 + 184))(v63, v68);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 560) + 936LL) == 1 )
cocos2d::CCLabelBMFont::limitLabelWidth(v63, 35.0, 0.5, 0.0);
sub_14003D310((__int64)v81);
sub_14003D310((__int64)Block_8);
}