//
// GJRateLevelLayer::setupRateInfo from 0x1001b1b50 to 0x1001b2448 (2296 bytes)
//
// 1 xrefs:
// > GJRateLevelLayer::rateInfoFinished @ 0x1001b2a74
//
// 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 GJRateLevelLayer::setupRateInfo(__int64 a1, __int64 a2)
{
cocos2d::CCArray *v3; // x20
cocos2d::CCString *v4; // x0
char *CString; // x0
cocos2d::CCArray *v6; // x21
unsigned int v7; // w23
unsigned int v8; // w22
cocos2d::CCString *v9; // x0
const char *v10; // x0
int v11; // w0
float v12; // s0
float v13; // s1
float v14; // s0
float v15; // s10
signed int v16; // w25
int v17; // w27
cocos2d::CCString *v18; // x0
const char *v19; // x0
__int64 v20; // x24
__n128 v21; // q0
__n128 v22; // q1
unsigned int v23; // w23
__int64 v24; // x25
__int64 v25; // x26
float v26; // s14
unsigned __int16 v27; // w26
cocos2d::CCSprite *v28; // x21
__int64 v29; // x0
__n128 v30; // q0
__n128 v31; // q1
double v32; // d0
cocos2d::CCString *v33; // x0
char *v34; // x0
cocos2d::CCArray *v35; // x20
unsigned int v36; // w22
unsigned int v37; // w21
cocos2d::CCString *v38; // x0
const char *v39; // x0
int v40; // w0
float v41; // s0
float v42; // s1
float v43; // s0
float v44; // s10
signed int v45; // w21
unsigned int v46; // w25
cocos2d::CCString *v47; // x0
const char *v48; // x0
__int64 v49; // x28
__n128 v50; // q0
__n128 v51; // q1
__int64 v52; // x23
__int64 v53; // x24
float v54; // s14
_DWORD *v55; // x8
unsigned int v56; // w9
float v57; // s1
float v58; // s2
float v59; // s3
cocos2d::CCString *v60; // x0
const char *v61; // x0
std::string *p_p; // x0
cocos2d::CCLabelBMFont *v63; // x20
__n128 v64; // q0
__n128 v65; // q1
__n128 v66; // q0
__n128 v67; // q1
double v68; // d0
std::string v69; // [xsp+40h] [xbp-100h] BYREF
std::string __dst; // [xsp+60h] [xbp-E0h] BYREF
float32x2_t v71; // [xsp+80h] [xbp-C0h] BYREF
float32x2_t v72; // [xsp+88h] [xbp-B8h] BYREF
std::string __p; // [xsp+90h] [xbp-B0h] BYREF
v3 = (cocos2d::CCArray *)sub_1001B24B0(a2, ":");
v4 = cocos2d::CCArray::stringAtIndex(v3, 0);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_100009900(&__p, CString);
v6 = (cocos2d::CCArray *)sub_1001B24B0(&__p, ",");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_10024A36C(v6) )
{
v7 = 0;
v8 = 0;
do
{
v9 = cocos2d::CCArray::stringAtIndex(v6, v8);
v10 = cocos2d::CCString::getCString(v9);
v11 = atoi(v10);
if ( v11 > (int)v7 )
v7 = v11;
++v8;
}
while ( v8 < (unsigned int)sub_10024A36C(v6) );
v12 = (float)v7;
}
else
{
v12 = 0.0;
}
v13 = v12 * 10.0;
v14 = 100.0 / v12;
if ( v13 <= 100.0 )
v15 = 10.0;
else
v15 = v14;
if ( (unsigned int)sub_10024A36C(v6) )
{
v16 = 0;
v17 = -120;
while ( 1 )
{
v18 = cocos2d::CCArray::stringAtIndex(v6, v16);
v19 = cocos2d::CCString::getCString(v18);
v20 = atoi(v19);
v21.n128_f32[0] = (float)v17;
v22.n128_u32[0] = -1037565952;
sub_100022980(v21, v22, &__p);
sub_1000229DC((float32x2_t *)(a1 + 1056), (float32x2_t *)&__p, &v72);
v23 = v16 + 1;
GameToolbox::intToString((unsigned int)(v16 + 1), &__p);
if ( (int)v20 >= 1 )
break;
std::string::assign(&__p, "");
if ( v15 < 10.0 )
{
v20 = 1;
v24 = 1056823;
v25 = 1519699;
LABEL_42:
v26 = v15;
goto LABEL_43;
}
v72.f32[1] = v72.f32[1] + (float)((float)-(float)(v15 * 0.5) * 0.5);
v20 = 1;
v24 = 1056823;
v25 = 1519699;
v26 = v15 * 0.5;
LABEL_43:
sub_1000229B8((__int64 *)&v71, (__int64 *)&v72);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__dst, __p.__r_.__value_.__l.__data_, __p.__r_.__value_.__l.__size_);
else
__dst = __p;
GJRateLevelLayer::createStatPillar(a1, 10, (unsigned int)(int)v26, v20, v25, v24, &v71, &__dst);
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v17 += 15;
v16 = v23;
if ( v23 >= (unsigned int)sub_10024A36C(v6) )
goto LABEL_51;
}
if ( v16 > 4 )
{
if ( v16 <= 6 )
{
if ( v16 == 5 )
{
v24 = 0;
v25 = 47103;
}
else
{
v24 = 0;
v25 = 30975;
}
goto LABEL_42;
}
switch ( v16 )
{
case 7:
v24 = 0;
v25 = 15431167;
goto LABEL_42;
case 8:
v24 = 0;
v25 = 15478271;
goto LABEL_42;
case 9:
v24 = 0;
v25 = 11775;
goto LABEL_42;
}
}
else
{
if ( v16 > 1 )
{
if ( v16 == 2 )
{
v24 = 0;
v25 = 3996160;
}
else if ( v16 == 3 )
{
v24 = 0;
v25 = 55390;
}
else
{
v24 = 0;
v25 = 1371646;
}
goto LABEL_42;
}
if ( !v16 )
{
v24 = 0;
v27 = -11517;
goto LABEL_35;
}
if ( v16 == 1 )
{
v24 = 0;
v27 = -27904;
LABEL_35:
v25 = v27 | 0xFF0000u;
goto LABEL_42;
}
}
v24 = 0;
v25 = 9868950;
goto LABEL_42;
}
LABEL_51:
v28 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v28->setScaleX)(v28, 0.06);
v29 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v28->getContentSize)(v28);
((void (__fastcall *)(cocos2d::CCSprite *, float))v28->setScaleY)(v28, 110.0 / *(float *)(v29 + 4));
__p.__r_.__value_.__s.__data_[2] = 24;
LOWORD(__p.__r_.__value_.__l.__data_) = 11086;
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v28->setColor)(v28, &__p);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v28->setOpacity)(v28, 200);
v30 = ((__n128 (__fastcall *)(_QWORD, cocos2d::CCSprite *, __int64))*(_QWORD *)(**(_QWORD **)(a1 + 576) + 448LL))(
*(_QWORD *)(a1 + 576),
v28,
3);
v30.n128_u32[0] = 1108869120;
v31.n128_u32[0] = 0;
sub_100022980(v30, v31, &v72);
*(float32x2_t *)&v32 = sub_1000229DC((float32x2_t *)(a1 + 1056), &v72, (float32x2_t *)&__p);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *, double))v28->setPosition)(v28, &__p, v32);
v33 = cocos2d::CCArray::stringAtIndex(v3, 1u);
v34 = (char *)cocos2d::CCString::getCString(v33);
sub_100009900(&__p, v34);
v35 = (cocos2d::CCArray *)sub_1001B24B0(&__p, ",");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_10024A36C(v35) )
{
v36 = 0;
v37 = 0;
do
{
v38 = cocos2d::CCArray::stringAtIndex(v35, v37);
v39 = cocos2d::CCString::getCString(v38);
v40 = atoi(v39);
if ( v40 > (int)v36 )
v36 = v40;
++v37;
}
while ( v37 < (unsigned int)sub_10024A36C(v35) );
v41 = (float)v36;
}
else
{
v41 = 0.0;
}
v42 = v41 * 10.0;
v43 = 100.0 / v41;
if ( v42 <= 100.0 )
v44 = 10.0;
else
v44 = v43;
if ( (unsigned int)sub_10024A36C(v35) )
{
v45 = 0;
v46 = 60;
while ( 1 )
{
v47 = cocos2d::CCArray::stringAtIndex(v35, v45);
v48 = cocos2d::CCString::getCString(v47);
v49 = atoi(v48);
v50.n128_f32[0] = (float)v46;
v51.n128_u32[0] = -1037565952;
sub_100022980(v50, v51, &__p);
sub_1000229DC((float32x2_t *)(a1 + 1056), (float32x2_t *)&__p, &v72);
sub_100009900(&__p, "");
if ( (int)v49 >= 1 )
break;
std::string::assign(&__p, "");
if ( v44 < 10.0 )
{
v49 = 1;
v53 = 1519699;
v52 = 1056823;
goto LABEL_79;
}
v72.f32[1] = v72.f32[1] + (float)((float)-(float)(v44 * 0.5) * 0.5);
v49 = 1;
v53 = 1519699;
v52 = 1056823;
v54 = v44 * 0.5;
LABEL_80:
sub_1000229B8((__int64 *)&v71, (__int64 *)&v72);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v69, __p.__r_.__value_.__l.__data_, __p.__r_.__value_.__l.__size_);
else
v69 = __p;
GJRateLevelLayer::createStatPillar(a1, 10, (unsigned int)(int)v54, v49, v53, v52, &v71, &v69);
if ( SHIBYTE(v69.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v69.__r_.__value_.__l.__data_);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
++v45;
v46 += 15;
if ( v45 >= (unsigned int)sub_10024A36C(v35) )
goto LABEL_88;
}
if ( v45 > 2 )
{
if ( v45 == 3 )
{
std::string::assign(&__p, "L");
v52 = 0;
v53 = 16711935;
goto LABEL_79;
}
if ( v45 == 4 )
{
std::string::assign(&__p, "M");
v52 = 0;
v53 = 16776960;
goto LABEL_79;
}
}
else
{
if ( v45 == 1 )
{
std::string::assign(&__p, "F");
v52 = 0;
v53 = 0xFFFF;
goto LABEL_79;
}
if ( v45 == 2 )
{
std::string::assign(&__p, "E");
v52 = 0;
v53 = 32255;
LABEL_79:
v54 = v44;
goto LABEL_80;
}
}
std::string::assign(&__p, "R");
v52 = 0;
v53 = 9868950;
goto LABEL_79;
}
LABEL_88:
memset(&__p, 0, sizeof(__p));
v55 = *(_DWORD **)(a1 + 976);
v56 = v55[234];
if ( (int)v56 <= 0 )
{
v60 = (cocos2d::CCString *)sub_100268F4C("Req: %i", v55[232]);
}
else
{
v57 = (float)(int)v55[235];
v58 = (float)(int)v55[236];
v59 = (float)(int)v55[237];
v60 = (cocos2d::CCString *)sub_100268F4C(
"R: %i (%i- / %i+)\n%.1f | +%.1f | -%.1f | +-%.1f\nReq: %i",
(int)(float)v56,
(int)v59,
(int)v58,
(float)(v57 / (float)v56),
(float)((float)(v57 - v59) / (float)((float)v56 - v59)),
(float)((float)(v57 + (float)(v58 * -10.0)) / (float)((float)v56 - v58)),
(float)((float)((float)(v57 + (float)(v58 * -10.0)) - v59)
/ (float)((float)((float)v56 - v58) - v59)),
v55[232]);
}
v61 = cocos2d::CCString::getCString(v60);
std::string::assign(&__p, v61);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v63 = cocos2d::CCLabelBMFont::create_1((const char *)p_p, "chatFont.fnt");
v64.n128_u32[0] = 0;
v65.n128_u32[0] = 1.0;
sub_100022980(v64, v65, &v72);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v63->setAnchorPoint)(v63, &v72);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v63->setScale)(v63, 0.6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v63->setColor)(v63, &unk_100639BC4);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v63->setOpacity)(v63, 225);
v66 = ((__n128 (__fastcall *)(_QWORD, cocos2d::CCLabelBMFont *, __int64))*(_QWORD *)(**(_QWORD **)(a1 + 576) + 448LL))(
*(_QWORD *)(a1 + 576),
v63,
2);
v66.n128_u32[0] = -1023279104;
v67.n128_u32[0] = 1111490560;
sub_100022980(v66, v67, &v71);
*(float32x2_t *)&v68 = sub_1000229DC((float32x2_t *)(a1 + 1056), &v71, &v72);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v63->setPosition)(v63, &v72, v68);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}