//
// GJRateLevelLayer::setupRateInfo from 0x1005057c0 to 0x1005061d7 (2583 bytes)
//
// 1 xrefs:
// > GJRateLevelLayer::rateInfoFinished @ 0x1005069ba
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:31:32 +0000
//
void __fastcall GJRateLevelLayer::setupRateInfo(__int64 a1, __int64 a2, double a3, double a4, double a5, double a6)
{
__int64 v6; // r13
__int64 v7; // rax
const char *CString; // r14
size_t v9; // rax
std::string::size_type v10; // rbx
char *data; // r15
size_t v12; // r12
__int64 v13; // r15
int v14; // r14d
unsigned int v15; // ebx
__int64 v16; // rax
const char *v17; // rax
int v18; // eax
double v19; // xmm0_8
unsigned int v20; // r13d
int v21; // r14d
__int64 v22; // rax
const char *v23; // rax
int v24; // r15d
unsigned int v25; // r12d
int v26; // ebx
int v27; // r13d
char *v28; // rbx
__int64 v29; // rax
__int64 v30; // r14
__int64 v31; // rax
const char *v32; // r14
size_t v33; // rax
std::string::size_type v34; // rbx
char *v35; // r15
size_t v36; // r12
__int64 v37; // r15
int v38; // r14d
unsigned int v39; // ebx
__int64 v40; // rax
const char *v41; // rax
int v42; // eax
float v43; // xmm0_4
__int64 v44; // xmm2_8
__int64 v45; // rbx
unsigned int v46; // r12d
int v47; // r15d
float v48; // xmm1_4
__int64 v49; // rax
const char *v50; // rax
int v51; // r14d
int v52; // ebx
int v53; // r13d
float v54; // xmm0_4
_DWORD *v55; // rax
int v56; // ecx
float v57; // xmm2_4
float v58; // xmm5_4
float v59; // xmm6_4
__int64 v60; // rax
const std::string::value_type *v61; // rax
std::string::pointer v62; // rdi
__int64 v63; // rbx
char v64; // [rsp+0h] [rbp-F0h]
__int64 v65; // [rsp+18h] [rbp-D8h]
double v66; // [rsp+20h] [rbp-D0h]
float v67; // [rsp+20h] [rbp-D0h]
float v68; // [rsp+30h] [rbp-C0h]
__int128 v69; // [rsp+40h] [rbp-B0h] BYREF
void *v70; // [rsp+50h] [rbp-A0h]
__int128 v71; // [rsp+60h] [rbp-90h] BYREF
void *v72; // [rsp+70h] [rbp-80h]
__int64 v73; // [rsp+78h] [rbp-78h]
unsigned __int64 *v74; // [rsp+80h] [rbp-70h]
unsigned __int64 v75; // [rsp+88h] [rbp-68h] BYREF
__int64 v76; // [rsp+90h] [rbp-60h]
unsigned __int64 v77; // [rsp+98h] [rbp-58h] BYREF
std::string __dst; // [rsp+A0h] [rbp-50h] BYREF
float v79; // [rsp+C0h] [rbp-30h]
float v80; // [rsp+C4h] [rbp-2Ch]
v76 = a1;
v6 = sub_100506270(a2, ":");
v7 = cocos2d::CCArray::stringAtIndex(v6, 0);
CString = (const char *)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 = sub_100506270(&__dst, ",");
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v65 = v6;
if ( (unsigned int)sub_1007FEF90(v13) )
{
v14 = 0;
v15 = 0;
do
{
v16 = cocos2d::CCArray::stringAtIndex(v13, v15);
v17 = (const char *)cocos2d::CCString::getCString(v16);
v18 = atoi(v17);
if ( v18 > v14 )
v14 = v18;
++v15;
}
while ( v15 < (unsigned int)sub_1007FEF90(v13) );
*(float *)&a3 = (float)v14;
}
else
{
a3 = 0.0;
}
v80 = 10.0;
if ( (float)(*(float *)&a3 * 10.0) > 100.0 )
v80 = 100.0 / *(float *)&a3;
if ( (unsigned int)sub_1007FEF90(v13) )
{
v74 = (unsigned __int64 *)(v76 + 1128);
HIDWORD(v19) = 0;
*(float *)&v19 = 0.5 * v80;
v66 = v19;
v20 = 0;
v21 = -120;
v68 = (float)-(float)(0.5 * v80) * 0.5;
v73 = v13;
do
{
v22 = cocos2d::CCArray::stringAtIndex(v13, v20);
v23 = (const char *)cocos2d::CCString::getCString(v22);
v24 = atoi(v23);
sub_100278250((float *)&__dst, (float)v21, -42.0);
sub_100278350((double *)&v77, v74, (unsigned __int64 *)&__dst);
v25 = v20 + 1;
GameToolbox::intToString((size_t *)&__dst, v20 + 1);
if ( v24 <= 0 )
{
std::string::assign(&__dst, "");
v24 = 1;
v27 = 1519699;
v26 = 1056823;
*(_QWORD *)&a3 = LODWORD(v80);
if ( v80 >= 10.0 )
{
*((float *)&v77 + 1) = *((float *)&v77 + 1) + v68;
a3 = v66;
}
}
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;
}
*(_QWORD *)&a3 = LODWORD(v80);
}
v79 = *(float *)&a3;
sub_1002782D0(&v75, &v77);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
{
sub_10001AD30(&v69, __dst.__r_.__value_.__l.__data_, __dst.__r_.__value_.__l.__size_);
}
else
{
v70 = __dst.__r_.__value_.__l.__data_;
a3 = *(double *)__dst.__r_.__value_.__r.__words;
v69 = *(_OWORD *)&__dst.__r_.__value_.__l.0;
}
sub_100506640(v76, 10, (int)v79, v24, v27, v26, (__int64)&v75, (__int64)&v69);
if ( (v69 & 1) != 0 )
operator delete(v70);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v13 = v73;
v21 += 15;
v20 = v25;
}
while ( v25 < (unsigned int)sub_1007FEF90(v73) );
}
v28 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"whiteSquare60_001.png", a3);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v28 + 128LL))(v28, 0.059999999);
v29 = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v28 + 328LL))(v28);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v28 + 144LL))(v28, 110.0 / *(float *)(v29 + 4));
__dst.__r_.__value_.__s.__data_[1] = 24;
*(_WORD *)&__dst.__r_.__value_.__l.0 = 11086;
(*(void (__fastcall **)(char *, std::string *))(*(_QWORD *)v28 + 960LL))(v28, &__dst);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v28 + 912LL))(v28, 200);
v30 = v76;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v76 + 584) + 464LL))(*(_QWORD *)(v76 + 584), v28, 3);
sub_100278250((float *)&v77, 38.0, 0.0);
v74 = (unsigned __int64 *)(v30 + 1128);
sub_100278350((double *)&__dst, (unsigned __int64 *)(v30 + 1128), &v77);
(*(void (__fastcall **)(char *, std::string *))(*(_QWORD *)v28 + 184LL))(v28, &__dst);
v31 = cocos2d::CCArray::stringAtIndex(v65, 1);
v32 = (const char *)cocos2d::CCString::getCString(v31);
v33 = strlen(v32);
if ( v33 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_94:
sub_100003630();
v34 = v33;
if ( v33 >= 0x17 )
{
v36 = 26;
if ( (v33 | 7) != 0x17 )
v36 = (v33 | 7) + 1;
v35 = (char *)operator new(v36);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v35;
__dst.__r_.__value_.__r.__words[0] = v36 + 1;
__dst.__r_.__value_.__l.__size_ = v34;
goto LABEL_53;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v33);
v35 = __dst.__r_.__value_.__s.__data_;
if ( v33 )
LABEL_53:
memmove(v35, v32, v34);
v35[v34] = 0;
v37 = sub_100506270(&__dst, ",");
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_1007FEF90(v37) )
{
v38 = 0;
v39 = 0;
do
{
v40 = cocos2d::CCArray::stringAtIndex(v37, v39);
v41 = (const char *)cocos2d::CCString::getCString(v40);
v42 = atoi(v41);
if ( v42 > v38 )
v38 = v42;
++v39;
}
while ( v39 < (unsigned int)sub_1007FEF90(v37) );
v43 = (float)v38;
}
else
{
v43 = 0.0;
}
v44 = 1092616192;
v80 = 10.0;
if ( (float)(v43 * 10.0) > 100.0 )
v80 = 100.0 / v43;
if ( (unsigned int)sub_1007FEF90(v37) )
{
v45 = v37;
v67 = 0.5 * v80;
v46 = 0;
v47 = 60;
v48 = (float)-(float)(0.5 * v80) * 0.5;
v73 = v45;
do
{
v49 = cocos2d::CCArray::stringAtIndex(v45, v46);
v50 = (const char *)cocos2d::CCString::getCString(v49);
v51 = atoi(v50);
sub_100278250((float *)&__dst, (float)v47, -42.0);
sub_100278350((double *)&v77, v74, (unsigned __int64 *)&__dst);
*(_WORD *)&__dst.__r_.__value_.__l.0 = 0;
if ( v51 <= 0 )
{
std::string::assign(&__dst, "");
v51 = 1;
v52 = 1519699;
v53 = 1056823;
v54 = v80;
if ( v80 >= 10.0 )
{
*((float *)&v77 + 1) = *((float *)&v77 + 1) + v48;
v54 = v67;
}
}
else
{
switch ( v46 )
{
case 1u:
std::string::assign(&__dst, "F");
v52 = 0xFFFF;
break;
case 2u:
std::string::assign(&__dst, "E");
v52 = 32255;
break;
case 3u:
std::string::assign(&__dst, "L");
v52 = 16711935;
break;
case 4u:
std::string::assign(&__dst, "M");
v52 = 16776960;
break;
default:
std::string::assign(&__dst, "R");
v52 = 9868950;
break;
}
v53 = 0;
v54 = v80;
}
v79 = v54;
sub_1002782D0(&v75, &v77);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
{
sub_10001AD30(&v71, __dst.__r_.__value_.__l.__data_, __dst.__r_.__value_.__l.__size_);
}
else
{
v72 = __dst.__r_.__value_.__l.__data_;
v71 = *(_OWORD *)&__dst.__r_.__value_.__l.0;
}
sub_100506640(v76, 10, (int)v79, v51, v52, v53, (__int64)&v75, (__int64)&v71);
if ( (v71 & 1) != 0 )
operator delete(v72);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
++v46;
v45 = v73;
v47 += 15;
}
while ( v46 < (unsigned int)sub_1007FEF90(v73) );
}
memset(&__dst, 0, sizeof(__dst));
v55 = *(_DWORD **)(v76 + 1048);
v56 = v55[263];
if ( v56 <= 0 )
{
v60 = sub_10088E820("Req: %i", v64);
}
else
{
v57 = (float)(int)v55[265];
v58 = (float)(-10.0 * v57) + (float)(int)v55[264];
v59 = (float)v56 - v57;
*(double *)&v44 = (float)(v58 / v59);
a6 = (float)((float)(v58 - (float)(int)v55[266]) / (float)(v59 - (float)(int)v55[266]));
v60 = sub_10088E820("R: %i (%i- / %i+)\n%.1f | +%.1f | -%.1f | +-%.1f\nReq: %i", v64);
}
v61 = (const std::string::value_type *)cocos2d::CCString::getCString(v60);
std::string::assign(&__dst, v61);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v62 = __dst.__r_.__value_.__l.__data_;
else
v62 = __dst.__r_.__value_.__s.__data_;
v63 = cocos2d::CCLabelBMFont::create_3(v62, "chatFont.fnt");
sub_100278250((float *)&v77, 0.0, 1.0);
(*(void (__fastcall **)(__int64, unsigned __int64 *, double, float, double, double))(*(_QWORD *)v63 + 296LL))(
v63,
&v77,
0.0,
1.0,
*(double *)&v44,
a6);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v63 + 160LL))(v63, 0.60000002);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v63 + 1072LL))(v63, &unk_100A0C7E8);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v63 + 1024LL))(v63, 225);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(v76 + 584) + 464LL))(*(_QWORD *)(v76 + 584), v63, 2);
sub_100278250((float *)&v75, -130.0, 48.0);
sub_100278350((double *)&v77, v74, &v75);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v63 + 184LL))(v63, &v77);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
}