//
// StatsCell::loadFromObject from 0x100104e88 to 0x100105180 (760 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x1001010b4
//
// 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
//
void __fastcall StatsCell::loadFromObject(StatsCell *a1, StatsObject *a2)
{
StatsCell *v4; // x0
int m_value; // w21
const char *TitleFromKey; // x0
cocos2d::CCLabelBMFont *v7; // x20
float v8; // s0
float *v9; // x0
__n128 v10; // q0
cocos2d::CCString *v11; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v13; // x21
__n128 v14; // q0
float *v15; // x0
__n128 v16; // q0
float v17; // s8
bool v18; // cc
__n128 v19; // q0
__n128 v20; // q0
__n128 v21; // q1
__n128 v22; // q0
__n128 v23; // q1
__n128 v24; // q0
__n128 v25; // q1
__n128 v26; // q0
__n128 v27; // q1
int v28; // [xsp+8h] [xbp-38h] BYREF
((void (__fastcall *)(cocos2d::CCLayerColor *, __int64))a1->m_backgroundLayer->setOpacity)(a1->m_backgroundLayer, 255);
v4 = (StatsCell *)((__int64 (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->removeAllChildrenWithCleanup)(
a1->m_mainLayer,
1);
m_value = a2->m_value;
TitleFromKey = StatsCell::getTitleFromKey(v4, a2->m_key);
v7 = cocos2d::CCLabelBMFont::create_1(TitleFromKey, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v7);
v8 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v7->getContentSize)(v7);
if ( v8 > 200.0 )
{
v9 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v7->getContentSize)(v7, v8);
v10.n128_u32[0] = 1.0;
if ( (float)(200.0 / *v9) < 1.0 )
v10.n128_f32[0] = 200.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v7->getContentSize)(v7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v7->setScale)(v7, v10);
}
v11 = (cocos2d::CCString *)sub_100268F4C("%i", m_value);
CString = cocos2d::CCString::getCString(v11);
v13 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v13);
v14.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v13->getContentSize)(v13);
if ( v14.n128_f32[0] > 100.0 )
{
v15 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v13->getContentSize)(v13, v14.n128_f32[0]);
v16.n128_u32[0] = 1.0;
if ( (float)(100.0 / *v15) < 1.0 )
v16.n128_f32[0] = 100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v13->getContentSize)(v13);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v13->setScale)(v13, v16);
}
v17 = 0.7;
v18 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v7->getScale)(v7, v14) <= 0.7;
v19.n128_u32[0] = 1060320051;
if ( v18 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v7->getScale)(v7, 0.7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v7->setScale)(v7, v19);
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v13->getScale)(v13) <= 0.7 )
v17 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v13->getScale)(v13);
v20 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v13->setScale)(v13, v17);
v20.n128_u32[0] = 0;
v21.n128_u32[0] = 0.5;
sub_100022980(v20, v21, &v28);
v22 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, int *))v7->setAnchorPoint)(v7, &v28);
v22.n128_u32[0] = 1.0;
v23.n128_u32[0] = 0.5;
sub_100022980(v22, v23, &v28);
v24 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, int *))v13->setAnchorPoint)(v13, &v28);
v25.n128_f32[0] = (float)(a1->m_height * 0.5) + -1.0;
v24.n128_u32[0] = 20.0;
sub_100022980(v24, v25, &v28);
v26 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, int *))v7->setPosition)(v7, &v28);
v27.n128_f32[0] = (float)(a1->m_height * 0.5) + -1.0;
v26.n128_u32[0] = 1134886912;
sub_100022980(v26, v27, &v28);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int *))v13->setPosition)(v13, &v28);
}