//
// GJLocalLevelScoreCell::loadFromScore from 0x1400b9ca0 to 0x1400ba00a (874 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x1400ab9e2
// > ??> @ 0x1406c7cf8
//
// 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=2
void GJLocalLevelScoreCell::loadFromScore(GJLocalLevelScoreCell *a1, GJLocalScore *a2)
{
GJLocalScore *v2; // rbx
signed int m_points; // edx
void **v5; // rbx
const char *v6; // rdx
size_t v7; // r8
void **v8; // rcx
struct cocos2d::CCSprite *v9; // rdi
cocos2d::CCSprite_vtbl *v10; // rbx
const cocos2d::CCPoint *v11; // rax
void **v12; // rcx
struct cocos2d::CCLabelBMFont *v13; // rdi
cocos2d::CCLabelBMFont_vtbl *v14; // rbx
const cocos2d::CCPoint *v15; // rax
cocos2d::CCLabelBMFont_vtbl *v16; // rbx
const cocos2d::CCPoint *v17; // rax
void *v18; // rcx
void *v19; // rcx
cocos2d::CCPoint v20; // [rsp+28h] [rbp-29h] BYREF
void *Block[2]; // [rsp+30h] [rbp-21h] BYREF
__int128 v22; // [rsp+40h] [rbp-11h]
void *v23[2]; // [rsp+50h] [rbp-1h] BYREF
__m128i si128; // [rsp+60h] [rbp+Fh]
__m128i v25[2]; // [rsp+70h] [rbp+1Fh] BYREF
v2 = a2;
LOBYTE(a2) = 1;
a1->m_mainLayer->removeAllChildrenWithCleanup(a1->m_mainLayer, (bool)a2);
a1->m_localScore = v2;
*(_OWORD *)Block = 0;
*(_QWORD *)&v22 = 0;
*((_QWORD *)&v22 + 1) = 15;
LOBYTE(Block[0]) = 0;
m_points = v2->m_points;
if ( v2->m_type )
{
v5 = (void **)GameToolbox::pointsToString(v25, m_points);
if ( Block == v5 )
goto LABEL_6;
}
else
{
v5 = GameToolbox::msToTimeString((void **)v25, m_points);
if ( Block == v5 )
goto LABEL_6;
}
*(_QWORD *)&v22 = 0;
*((_QWORD *)&v22 + 1) = 15;
LOBYTE(Block[0]) = 0;
*(_OWORD *)Block = *(_OWORD *)v5;
v22 = *((_OWORD *)v5 + 1);
v5[2] = nullptr;
*(_BYTE *)v5 = 0;
v5[3] = (void *)15;
LABEL_6:
sub_14003A830((__int64)v25);
v6 = "GJ_timeIcon_001.png";
if ( a1->m_localScore->m_type == 1 )
v6 = "GJ_pointsIcon_001.png";
*(_OWORD *)v23 = 0;
si128 = 0;
v7 = -1;
do
++v7;
while ( v6[v7] );
sub_14003A930(v23, v6, v7);
v8 = v23;
if ( si128.m128i_i64[1] > 0xFuLL )
v8 = (void **)v23[0];
v9 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v8);
((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setScale_0)(v9);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v9, 20);
v10 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v20, 20.0, a1->m_height * 0.5);
v10->setPosition_0(v9, v11);
v12 = Block;
if ( *((_QWORD *)&v22 + 1) > 0xFu )
v12 = (void **)Block[0];
v13 = cocos2d::CCLabelBMFont::create((const char *)v12, (const char *)&qword_14052A4D8);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v13, 2);
v14 = v13->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v20, 0.0, 0.5);
v14->setAnchorPoint(v13, v15);
cocos2d::CCLabelBMFont::limitLabelWidth(v13, 200.0, 0.46000001, 0.0);
v16 = v13->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(&v20, 40.0, (float)(a1->m_height * 0.5) + 0.5);
v16->setPosition_0(v13, v17);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v18 = v23[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v18 = *((void **)v23[0] - 1);
if ( (unsigned __int64)((char *)v23[0] - (char *)v18 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v18);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(v23[0]) = 0;
if ( *((_QWORD *)&v22 + 1) > 0xFu )
{
v19 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v22 + 1) + 1LL) >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v19);
}
}