//
// GJRateLevelLayer::setupRateInfo from 0x100506af0 to 0x100507507 (2583 bytes)
//
// 1 xrefs:
// > GJRateLevelLayer::rateInfoFinished @ 0x100507cea
//
// 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, double a3, double a4, double a5, double a6)
{
cocos2d::CCArray *v6; // r13
cocos2d::CCString *v7; // rax
const char *CString; // r14
size_t v9; // rax
std::string::size_type v10; // rbx
char *data; // r15
size_t v12; // r12
cocos2d::CCArray *v13; // r15
int v14; // r14d
unsigned int v15; // ebx
cocos2d::CCString *v16; // rax
const char *v17; // rax
int v18; // eax
float v19; // xmm0_4
unsigned int v20; // r13d
int v21; // r14d
cocos2d::CCString *v22; // rax
const char *v23; // rax
int v24; // r15d
unsigned int v25; // r12d
int v26; // ebx
int v27; // r13d
float v28; // xmm0_4
double v29; // xmm0_8
cocos2d::CCSprite *v30; // rbx
__int64 v31; // rax
__int64 v32; // r14
cocos2d::CCString *v33; // rax
const char *v34; // r14
size_t v35; // rax
std::string::size_type v36; // rbx
char *v37; // r15
size_t v38; // r12
cocos2d::CCArray *v39; // r15
int v40; // r14d
unsigned int v41; // ebx
cocos2d::CCString *v42; // rax
const char *v43; // rax
int v44; // eax
float v45; // xmm0_4
__int64 v46; // xmm2_8
cocos2d::CCArray *v47; // rbx
unsigned int v48; // r12d
int v49; // r15d
float v50; // xmm1_4
cocos2d::CCString *v51; // rax
const char *v52; // rax
int v53; // r14d
int v54; // ebx
int v55; // r13d
float v56; // xmm0_4
double v57; // xmm0_8
_DWORD *v58; // rax
int v59; // ecx
float v60; // xmm2_4
float v61; // xmm5_4
float v62; // xmm6_4
cocos2d::CCString *v63; // rax
const char *v64; // rax
const char *v65; // rdi
cocos2d::CCLabelBMFont *v66; // rbx
char v67; // [rsp+0h] [rbp-F0h]
cocos2d::CCArray *v68; // [rsp+18h] [rbp-D8h]
float v69; // [rsp+20h] [rbp-D0h]
float v70; // [rsp+20h] [rbp-D0h]
float v71; // [rsp+30h] [rbp-C0h]
__int128 v72; // [rsp+40h] [rbp-B0h] BYREF
void *v73; // [rsp+50h] [rbp-A0h]
__int128 v74; // [rsp+60h] [rbp-90h] BYREF
void *v75; // [rsp+70h] [rbp-80h]
cocos2d::CCArray *v76; // [rsp+78h] [rbp-78h]
unsigned __int64 *v77; // [rsp+80h] [rbp-70h]
unsigned __int64 v78; // [rsp+88h] [rbp-68h] BYREF
__int64 v79; // [rsp+90h] [rbp-60h]
unsigned __int64 v80; // [rsp+98h] [rbp-58h] BYREF
std::string __dst; // [rsp+A0h] [rbp-50h] BYREF
float v82; // [rsp+C0h] [rbp-30h]
float v83; // [rsp+C4h] [rbp-2Ch]
v79 = a1;
v6 = (cocos2d::CCArray *)sub_1005075A0(a2, ":");
v7 = cocos2d::CCArray::stringAtIndex(v6, 0);
CString = cocos2d::CCString::getCString(v7);
v9 = strlen(CString);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_94;
v10 = v9;
if ( v9 >= 0x17 )
{
v12 = 26;
if ( (v9 | 7) != 0x17 )
v12 = (v9 | 7) + 1;
data = (char *)operator new(v12);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v12 + 1;
__dst.__r_.__value_.__l.__size_ = v10;
goto LABEL_8;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v9);
data = __dst.__r_.__value_.__s.__data_;
if ( v9 )
LABEL_8:
memmove(data, CString, v10);
data[v10] = 0;
v13 = (cocos2d::CCArray *)sub_1005075A0(&__dst, ",");
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v68 = v6;
if ( (unsigned int)sub_100720070(v13) )
{
v14 = 0;
v15 = 0;
do
{
v16 = cocos2d::CCArray::stringAtIndex(v13, v15);
v17 = cocos2d::CCString::getCString(v16);
v18 = atoi(v17);
if ( v18 > v14 )
v14 = v18;
++v15;
}
while ( v15 < (unsigned int)sub_100720070(v13) );
v19 = (float)v14;
}
else
{
v19 = 0.0;
}
v83 = 10.0;
if ( (float)(v19 * 10.0) > 100.0 )
v83 = 100.0 / v19;
if ( (unsigned int)sub_100720070(v13) )
{
v77 = (unsigned __int64 *)(v79 + 1056);
v69 = 0.5 * v83;
v20 = 0;
v21 = -120;
v71 = (float)-(float)(0.5 * v83) * 0.5;
v76 = v13;
do
{
v22 = cocos2d::CCArray::stringAtIndex(v13, v20);
v23 = cocos2d::CCString::getCString(v22);
v24 = atoi(v23);
sub_10028CBE0((float *)&__dst, (float)v21, -42.0);
sub_10028CCE0((double *)&v80, v77, (unsigned __int64 *)&__dst);
v25 = v20 + 1;
GameToolbox::intToString(
(size_t *)&__dst,
v20 + 1,
COERCE_DOUBLE((unsigned __int64)COERCE_UNSIGNED_INT((float)v21)));
if ( v24 <= 0 )
{
std::string::assign(&__dst, "");
v24 = 1;
v27 = 1519699;
v26 = 1056823;
v28 = v83;
if ( v83 >= 10.0 )
{
*((float *)&v80 + 1) = *((float *)&v80 + 1) + v71;
v28 = v69;
}
}
else
{
v26 = 0;
switch ( v20 )
{
case 0u:
v27 = 16765699;
break;
case 1u:
v27 = 16749312;
break;
case 2u:
v27 = 3996160;
break;
case 3u:
v27 = 55390;
break;
case 4u:
v27 = 1371646;
break;
case 5u:
v27 = 47103;
break;
case 6u:
v27 = 30975;
break;
case 7u:
v27 = 15431167;
break;
case 8u:
v27 = 15478271;
break;
case 9u:
v27 = 11775;
break;
default:
v27 = 9868950;
break;
}
v28 = v83;
}
v82 = v28;
v29 = sub_10028CC60(&v78, (double *)&v80);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v72, __dst.__r_.__value_.__l.__data_, __dst.__r_.__value_.__l.__size_, v29);
}
else
{
v73 = __dst.__r_.__value_.__l.__data_;
v72 = *(_OWORD *)&__dst.__r_.__value_.__l.0;
}
GJRateLevelLayer::createStatPillar(v79, 10, (int)v82, v24, v27, v26, (__int64)&v78, (__int64)&v72);
if ( (v72 & 1) != 0 )
operator delete(v73);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v13 = v76;
v21 += 15;
v20 = v25;
}
while ( v25 < (unsigned int)sub_100720070(v76) );
}
v30 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v30->setScaleX)(v30, 0.059999999);
v31 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v30->getContentSize)(v30);
((void (__fastcall *)(cocos2d::CCSprite *, float))v30->setScaleY)(v30, 110.0 / *(float *)(v31 + 4));
__dst.__r_.__value_.__s.__data_[1] = 24;
*(_WORD *)&__dst.__r_.__value_.__l.0 = 11086;
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v30->setColor)(v30, &__dst);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v30->setOpacity)(v30, 200);
v32 = v79;
(*(void (__fastcall **)(_QWORD, cocos2d::CCSprite *, __int64))(**(_QWORD **)(v79 + 576) + 448LL))(
*(_QWORD *)(v79 + 576),
v30,
3);
*(_QWORD *)&a3 = 1108869120;
sub_10028CBE0((float *)&v80, 38.0, 0.0);
v77 = (unsigned __int64 *)(v32 + 1056);
sub_10028CCE0((double *)&__dst, (unsigned __int64 *)(v32 + 1056), &v80);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v30->setPosition)(v30, &__dst);
v33 = cocos2d::CCArray::stringAtIndex(v68, 1u);
v34 = cocos2d::CCString::getCString(v33);
v35 = strlen(v34);
if ( v35 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_94:
sub_100006BF0(a3);
v36 = v35;
if ( v35 >= 0x17 )
{
v38 = 26;
if ( (v35 | 7) != 0x17 )
v38 = (v35 | 7) + 1;
v37 = (char *)operator new(v38);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v37;
__dst.__r_.__value_.__r.__words[0] = v38 + 1;
__dst.__r_.__value_.__l.__size_ = v36;
goto LABEL_53;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v35);
v37 = __dst.__r_.__value_.__s.__data_;
if ( v35 )
LABEL_53:
memmove(v37, v34, v36);
v37[v36] = 0;
v39 = (cocos2d::CCArray *)sub_1005075A0(&__dst, ",");
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_100720070(v39) )
{
v40 = 0;
v41 = 0;
do
{
v42 = cocos2d::CCArray::stringAtIndex(v39, v41);
v43 = cocos2d::CCString::getCString(v42);
v44 = atoi(v43);
if ( v44 > v40 )
v40 = v44;
++v41;
}
while ( v41 < (unsigned int)sub_100720070(v39) );
v45 = (float)v40;
}
else
{
v45 = 0.0;
}
v46 = 1092616192;
v83 = 10.0;
if ( (float)(v45 * 10.0) > 100.0 )
v83 = 100.0 / v45;
if ( (unsigned int)sub_100720070(v39) )
{
v47 = v39;
v70 = 0.5 * v83;
v48 = 0;
v49 = 60;
v50 = (float)-(float)(0.5 * v83) * 0.5;
v76 = v47;
do
{
v51 = cocos2d::CCArray::stringAtIndex(v47, v48);
v52 = cocos2d::CCString::getCString(v51);
v53 = atoi(v52);
sub_10028CBE0((float *)&__dst, (float)v49, -42.0);
sub_10028CCE0((double *)&v80, v77, (unsigned __int64 *)&__dst);
*(_WORD *)&__dst.__r_.__value_.__l.0 = 0;
if ( v53 <= 0 )
{
std::string::assign(&__dst, "");
v53 = 1;
v54 = 1519699;
v55 = 1056823;
v56 = v83;
if ( v83 >= 10.0 )
{
*((float *)&v80 + 1) = *((float *)&v80 + 1) + v50;
v56 = v70;
}
}
else
{
switch ( v48 )
{
case 1u:
std::string::assign(&__dst, "F");
v54 = 0xFFFF;
break;
case 2u:
std::string::assign(&__dst, "E");
v54 = 32255;
break;
case 3u:
std::string::assign(&__dst, "L");
v54 = 16711935;
break;
case 4u:
std::string::assign(&__dst, "M");
v54 = 16776960;
break;
default:
std::string::assign(&__dst, "R");
v54 = 9868950;
break;
}
v55 = 0;
v56 = v83;
}
v82 = v56;
v57 = sub_10028CC60(&v78, (double *)&v80);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v74, __dst.__r_.__value_.__l.__data_, __dst.__r_.__value_.__l.__size_, v57);
}
else
{
v75 = __dst.__r_.__value_.__l.__data_;
v74 = *(_OWORD *)&__dst.__r_.__value_.__l.0;
}
GJRateLevelLayer::createStatPillar(v79, 10, (int)v82, v53, v54, v55, (__int64)&v78, (__int64)&v74);
if ( (v74 & 1) != 0 )
operator delete(v75);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
++v48;
v47 = v76;
v49 += 15;
}
while ( v48 < (unsigned int)sub_100720070(v76) );
}
memset(&__dst, 0, sizeof(__dst));
v58 = *(_DWORD **)(v79 + 976);
v59 = v58[234];
if ( v59 <= 0 )
{
v63 = (cocos2d::CCString *)sub_1007AB580("Req: %i", v67);
}
else
{
v60 = (float)(int)v58[236];
v61 = (float)(-10.0 * v60) + (float)(int)v58[235];
v62 = (float)v59 - v60;
*(double *)&v46 = (float)(v61 / v62);
a6 = (float)((float)(v61 - (float)(int)v58[237]) / (float)(v62 - (float)(int)v58[237]));
v63 = (cocos2d::CCString *)sub_1007AB580("R: %i (%i- / %i+)\n%.1f | +%.1f | -%.1f | +-%.1f\nReq: %i", v67);
}
v64 = cocos2d::CCString::getCString(v63);
std::string::assign(&__dst, v64);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v65 = __dst.__r_.__value_.__l.__data_;
else
v65 = __dst.__r_.__value_.__s.__data_;
v66 = cocos2d::CCLabelBMFont::create_3(v65, "chatFont.fnt");
sub_10028CBE0((float *)&v80, 0.0, 1.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *, double, float, double, double))v66->setAnchorPoint)(
v66,
&v80,
0.0,
1.0,
*(double *)&v46,
a6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v66->setScale)(v66, 0.60000002);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v66->setColor)(v66, &unk_10081E1B0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))v66->setOpacity)(v66, 225);
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(v79 + 576) + 448LL))(
*(_QWORD *)(v79 + 576),
v66,
2);
sub_10028CBE0((float *)&v78, -130.0, 48.0);
sub_10028CCE0((double *)&v80, v77, &v78);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v66->setPosition)(v66, &v80);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
}