//
// GJLocalLevelScoreCell::loadFromScore from 0x140156c20 to 0x140156fe2 (962 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x140145e22
// > ??> @ 0x140917984
//
// 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:20 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GJLocalLevelScoreCell::loadFromScore(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
int v4; // edx
__m128i *v5; // rbx
void *v6; // rax
const char *v7; // rdx
size_t v8; // r8
void **v9; // rcx
struct cocos2d::CCSprite *v10; // rdi
__int64 v11; // rbx
__int64 v12; // rax
void **v13; // rcx
struct cocos2d::CCLabelBMFont *v14; // rdi
__int64 v15; // rbx
__int64 v16; // rax
__int64 v17; // rbx
__int64 v18; // rax
void *v19; // rcx
void *v20; // rcx
_BYTE v21[8]; // [rsp+38h] [rbp-39h] BYREF
void *Block[2]; // [rsp+40h] [rbp-31h] BYREF
__m128i si128; // [rsp+50h] [rbp-21h]
void *v24[2]; // [rsp+60h] [rbp-11h] BYREF
__m128i v25; // [rsp+70h] [rbp-1h]
__m128i v26[2]; // [rsp+80h] [rbp+Fh] BYREF
v2 = a2;
LOBYTE(a2) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 544) + 576LL))(*(_QWORD *)(a1 + 544), a2);
*(_QWORD *)(a1 + 560) = v2;
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v4 = *(_DWORD *)(v2 + 56);
if ( !*(_DWORD *)(v2 + 60) )
{
v5 = (__m128i *)GameToolbox::msToTimeString((void **)v26, v4, 1);
if ( Block == (void **)v5 )
goto LABEL_14;
if ( si128.m128i_i64[1] <= 0xFuLL )
goto LABEL_13;
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
goto LABEL_12;
}
v5 = GameToolbox::pointsToString(v26, v4);
if ( Block == (void **)v5 )
goto LABEL_14;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
LABEL_12:
j_j_free(v6);
}
LABEL_13:
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
*(__m128i *)Block = *v5;
si128 = v5[1];
v5[1].m128i_i64[0] = 0;
v5->m128i_i8[0] = 0;
v5[1].m128i_i64[1] = 15;
LABEL_14:
sub_14003D310((__int64)v26);
v7 = "GJ_timeIcon_001.png";
if ( *(_DWORD *)(*(_QWORD *)(a1 + 560) + 60LL) == 1 )
v7 = "GJ_pointsIcon_001.png";
*(_OWORD *)v24 = 0;
v25 = 0;
v8 = -1;
do
++v8;
while ( v7[v8] );
sub_14003D230(v24, v7, v8);
v9 = v24;
if ( v25.m128i_i64[1] > 0xFuLL )
v9 = (void **)v24[0];
v10 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v9);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v10 + 160LL))(v10);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v10,
20);
v11 = *(_QWORD *)v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, 20.0, *(float *)(a1 + 532) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v11 + 184))(v10, v12);
v13 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v13 = (void **)Block[0];
v14 = cocos2d::CCLabelBMFont::create((const char *)v13, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 544) + 456LL))(
*(_QWORD *)(a1 + 544),
v14,
2);
v15 = *(_QWORD *)v14;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v15 + 288))(v14, v16);
cocos2d::CCLabelBMFont::limitLabelWidth(v14, 200.0, 0.46000001, 0.0);
v17 = *(_QWORD *)v14;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, 40.0, (float)(*(float *)(a1 + 532) * 0.5) + 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v17 + 184))(v14, v18);
if ( v25.m128i_i64[1] > 0xFuLL )
{
v19 = v24[0];
if ( (unsigned __int64)(v25.m128i_i64[1] + 1) >= 0x1000 )
{
v19 = *((void **)v24[0] - 1);
if ( (unsigned __int64)((char *)v24[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
v25 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(v24[0]) = 0;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v20 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v20 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v20 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v20);
}
}