//
// GJRateLevelLayer::createStatPillar from 0x1001b26cc to 0x1001b2a00 (820 bytes)
//
// 2 xrefs:
// > GJRateLevelLayer::setupRateInfo @ 0x1001b1e6c
// > GJRateLevelLayer::setupRateInfo @ 0x1001b2214
//
// 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
//
__int64 __fastcall GJRateLevelLayer::createStatPillar(
__int64 result,
int a2,
int a3,
int a4,
int a5,
int a6,
float32x2_t *a7,
__int64 *a8)
{
__int64 v13; // x20
unsigned int v14; // w27
float v15; // s10
cocos2d::CCSprite *v16; // x25
cocos2d::CCSprite *v17; // x26
float *v18; // x0
__int64 v19; // x0
float v20; // s8
float v21; // s8
float v22; // s8
__n128 v23; // q0
__n128 v24; // q1
double v25; // d0
cocos2d::CCLabelBMFont *v26; // x19
__n128 v27; // q0
__n128 v28; // q1
float32x2_t v29; // [xsp+0h] [xbp-A0h] BYREF
float32x2_t v30; // [xsp+8h] [xbp-98h] BYREF
__int64 v31; // [xsp+10h] [xbp-90h] BYREF
__int16 v32; // [xsp+18h] [xbp-88h] BYREF
char v33; // [xsp+1Ah] [xbp-86h]
__int16 v34; // [xsp+1Ch] [xbp-84h] BYREF
char v35; // [xsp+1Eh] [xbp-82h]
cocos2d::CCPoint v36; // 0:kr00_8.8
v34 = a5;
v35 = BYTE2(a5);
v32 = a6;
v33 = BYTE2(a6);
if ( a4 >= 1 )
{
v13 = result;
sub_1000229B0(&v31);
v14 = 0;
v15 = (float)a3;
do
{
v16 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
v17 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))v16->addChild_0)(v16, v17, 1);
v36 = cocos2d::CCNode::convertToNodeSpace(v16, &stru_10086C230);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *, float, float))v17->setPosition)(v17, &v30, v36.x, v36.y);
(*(void (__fastcall **)(_QWORD, cocos2d::CCSprite *, __int64))(**(_QWORD **)(v13 + 576) + 448LL))(
*(_QWORD *)(v13 + 576),
v16,
3);
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v16->setColor)(v16, &v32);
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v17->setColor)(v17, &v34);
v18 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v16->getContentSize)(v16);
((void (__fastcall *)(cocos2d::CCSprite *, float))v16->setScaleX)(v16, (float)a2 / *v18);
v19 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v16->getContentSize)(v16);
((void (__fastcall *)(cocos2d::CCSprite *, float))v16->setScaleY)(v16, v15 / *(float *)(v19 + 4));
v20 = ((float (__fastcall *)(cocos2d::CCSprite *))v16->getScaleX)(v16);
v21 = v20 / ((float (__fastcall *)(cocos2d::CCSprite *))v16->getScaleY)(v16);
((void (__fastcall *)(cocos2d::CCSprite *, float))v17->setScaleX)(v17, 0.75);
((void (__fastcall *)(cocos2d::CCSprite *, float))v17->setScaleY)(v17, 0.75 / v21);
v22 = *(float *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))v16->getContentSize)(v16) + 4);
v23 = ((__n128 (__fastcall *)(cocos2d::CCSprite *))v16->getScaleY)(v16);
v23.n128_f64[0] = (float)(v22 * v23.n128_f32[0]) * -0.25 * 0.5;
v23.n128_f32[0] = v23.n128_f64[0];
v24.n128_f32[0] = (float)(v15 + v23.n128_f32[0]) * (float)v14;
v23.n128_u32[0] = 0;
sub_100022980(v23, v24, &v29);
sub_1000229DC(a7, &v29, &v30);
v25 = sub_1000229D0(&v31, (double *)&v30);
result = ((__int64 (__fastcall *)(cocos2d::CCSprite *, __int64 *, double))v16->setPosition)(v16, &v31, v25);
++v14;
}
while ( a4 != v14 );
if ( *((char *)a8 + 23) < 0 )
{
if ( !a8[1] )
return result;
a8 = (__int64 *)*a8;
}
else if ( !*((_BYTE *)a8 + 23) )
{
return result;
}
v26 = cocos2d::CCLabelBMFont::create_1((const char *)a8, "chatFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(v13 + 576) + 448LL))(
*(_QWORD *)(v13 + 576),
v26,
3);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v26->setColor)(v26, &unk_100639BC4);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v26->setOpacity)(v26, 125);
v27 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v26->setScale)(v26, 0.8);
v27.n128_u32[0] = v31;
v28.n128_f32[0] = *((float *)&v31 + 1) + 13.0;
sub_100022980(v27, v28, &v30);
return ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v26->setPosition)(v26, &v30);
}
return result;
}