//
// sub_100246A8C from 0x100246a8c to 0x100247384 (2296 bytes)
//
// 1 xrefs:
// > GJRateLevelLayer::rateInfoFinished @ 0x1002479b0
//
// This function is hookable on this platform (idp: arm, 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 11:01:27 +0000
//
void __fastcall sub_100246A8C(__int64 a1, __int64 a2)
{
__int64 v3; // x20
__int64 v4; // x0
char *CString; // x0
__int64 v6; // x21
unsigned int v7; // w23
__int64 v8; // x22
__int64 v9; // x0
const char *v10; // x0
int v11; // w0
float v12; // s0
float v13; // s1
float v14; // s0
float v15; // s10
__int64 v16; // x25
int v17; // w27
__int64 v18; // x0
const char *v19; // x0
__int64 v20; // x24
__int64 v21; // x23
__int64 v22; // x25
__int64 v23; // x26
float v24; // s14
unsigned __int16 v25; // w26
__int64 v26; // x21
__int64 v27; // x0
double v28; // d0
__int64 v29; // x0
char *v30; // x0
__int64 v31; // x20
unsigned int v32; // w22
__int64 v33; // x21
__int64 v34; // x0
const char *v35; // x0
int v36; // w0
float v37; // s0
float v38; // s1
float v39; // s0
float v40; // s10
__int64 v41; // x21
unsigned int v42; // w25
__int64 v43; // x0
const char *v44; // x0
__int64 v45; // x28
__int64 v46; // x23
__int64 v47; // x24
float v48; // s14
_DWORD *v49; // x8
unsigned int v50; // w9
float v51; // s1
float v52; // s2
float v53; // s3
__int64 v54; // x0
const std::string::value_type *v55; // x0
std::string *p_p; // x0
__int64 v57; // x20
double v58; // d0
std::string v59; // [xsp+40h] [xbp-100h] BYREF
std::string __dst; // [xsp+60h] [xbp-E0h] BYREF
float32x2_t v61; // [xsp+80h] [xbp-C0h] BYREF
float32x2_t v62; // [xsp+88h] [xbp-B8h] BYREF
std::string __p; // [xsp+90h] [xbp-B0h] BYREF
v3 = sub_1002473EC(a2, ":");
v4 = cocos2d::CCArray::stringAtIndex(v3, 0);
CString = (char *)cocos2d::CCString::getCString(v4);
sub_100009900(&__p, CString);
v6 = sub_1002473EC(&__p, ",");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_1002E757C(v6) )
{
v7 = 0;
v8 = 0;
do
{
v9 = cocos2d::CCArray::stringAtIndex(v6, v8);
v10 = (const char *)cocos2d::CCString::getCString(v9);
v11 = atoi(v10);
if ( v11 > (int)v7 )
v7 = v11;
v8 = (unsigned int)(v8 + 1);
}
while ( (unsigned int)v8 < (unsigned int)sub_1002E757C(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_1002E757C(v6) )
{
v16 = 0;
v17 = -120;
while ( 1 )
{
v18 = cocos2d::CCArray::stringAtIndex(v6, v16);
v19 = (const char *)cocos2d::CCString::getCString(v18);
v20 = atoi(v19);
sub_1000262BC((float *)&__p, (float)v17, -42.0);
sub_100026318((float32x2_t *)(a1 + 1128), (float32x2_t *)&__p, &v62);
v21 = (unsigned int)(v16 + 1);
GameToolbox::intToString(v21, &__p);
if ( (int)v20 >= 1 )
break;
std::string::assign(&__p, "");
if ( v15 < 10.0 )
{
v20 = 1;
v22 = 1056823;
v23 = 1519699;
LABEL_42:
v24 = v15;
goto LABEL_43;
}
v62.f32[1] = v62.f32[1] + (float)((float)-(float)(v15 * 0.5) * 0.5);
v20 = 1;
v22 = 1056823;
v23 = 1519699;
v24 = v15 * 0.5;
LABEL_43:
sub_1000262F4(&v61, (double *)&v62);
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;
sub_100247608(a1, 10, (unsigned int)(int)v24, v20, v23, v22, &v61, &__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 = v21;
if ( (unsigned int)v21 >= (unsigned int)sub_1002E757C(v6) )
goto LABEL_51;
}
if ( (int)v16 > 4 )
{
if ( (int)v16 <= 6 )
{
if ( (_DWORD)v16 == 5 )
{
v22 = 0;
v23 = 47103;
}
else
{
v22 = 0;
v23 = 30975;
}
goto LABEL_42;
}
switch ( (_DWORD)v16 )
{
case 7:
v22 = 0;
v23 = 15431167;
goto LABEL_42;
case 8:
v22 = 0;
v23 = 15478271;
goto LABEL_42;
case 9:
v22 = 0;
v23 = 11775;
goto LABEL_42;
}
}
else
{
if ( (int)v16 > 1 )
{
if ( (_DWORD)v16 == 2 )
{
v22 = 0;
v23 = 3996160;
}
else if ( (_DWORD)v16 == 3 )
{
v22 = 0;
v23 = 55390;
}
else
{
v22 = 0;
v23 = 1371646;
}
goto LABEL_42;
}
if ( !(_DWORD)v16 )
{
v22 = 0;
v25 = -11517;
goto LABEL_35;
}
if ( (_DWORD)v16 == 1 )
{
v22 = 0;
v25 = -27904;
LABEL_35:
v23 = v25 | 0xFF0000u;
goto LABEL_42;
}
}
v22 = 0;
v23 = 9868950;
goto LABEL_42;
}
LABEL_51:
v26 = cocos2d::CCSprite::createWithSpriteFrameName("whiteSquare60_001.png");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v26 + 128LL))(v26, 0.06);
v27 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v26 + 328LL))(v26);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v26 + 144LL))(v26, 110.0 / *(float *)(v27 + 4));
__p.__r_.__value_.__s.__data_[2] = 24;
LOWORD(__p.__r_.__value_.__l.__data_) = 11086;
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v26 + 960LL))(v26, &__p);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v26 + 912LL))(v26, 200);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v26, 3);
sub_1000262BC((float *)&v62, 38.0, 0.0);
*(float32x2_t *)&v28 = sub_100026318((float32x2_t *)(a1 + 1128), &v62, (float32x2_t *)&__p);
(*(void (__fastcall **)(__int64, std::string *, double))(*(_QWORD *)v26 + 184LL))(v26, &__p, v28);
v29 = cocos2d::CCArray::stringAtIndex(v3, 1);
v30 = (char *)cocos2d::CCString::getCString(v29);
sub_100009900(&__p, v30);
v31 = sub_1002473EC(&__p, ",");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_1002E757C(v31) )
{
v32 = 0;
v33 = 0;
do
{
v34 = cocos2d::CCArray::stringAtIndex(v31, v33);
v35 = (const char *)cocos2d::CCString::getCString(v34);
v36 = atoi(v35);
if ( v36 > (int)v32 )
v32 = v36;
v33 = (unsigned int)(v33 + 1);
}
while ( (unsigned int)v33 < (unsigned int)sub_1002E757C(v31) );
v37 = (float)v32;
}
else
{
v37 = 0.0;
}
v38 = v37 * 10.0;
v39 = 100.0 / v37;
if ( v38 <= 100.0 )
v40 = 10.0;
else
v40 = v39;
if ( (unsigned int)sub_1002E757C(v31) )
{
v41 = 0;
v42 = 60;
while ( 1 )
{
v43 = cocos2d::CCArray::stringAtIndex(v31, v41);
v44 = (const char *)cocos2d::CCString::getCString(v43);
v45 = atoi(v44);
sub_1000262BC((float *)&__p, (float)v42, -42.0);
sub_100026318((float32x2_t *)(a1 + 1128), (float32x2_t *)&__p, &v62);
sub_100009900(&__p, "");
if ( (int)v45 >= 1 )
break;
std::string::assign(&__p, "");
if ( v40 < 10.0 )
{
v45 = 1;
v47 = 1519699;
v46 = 1056823;
goto LABEL_79;
}
v62.f32[1] = v62.f32[1] + (float)((float)-(float)(v40 * 0.5) * 0.5);
v45 = 1;
v47 = 1519699;
v46 = 1056823;
v48 = v40 * 0.5;
LABEL_80:
sub_1000262F4(&v61, (double *)&v62);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v59, __p.__r_.__value_.__l.__data_, __p.__r_.__value_.__l.__size_);
else
v59 = __p;
sub_100247608(a1, 10, (unsigned int)(int)v48, v45, v47, v46, &v61, &v59);
if ( SHIBYTE(v59.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v59.__r_.__value_.__l.__data_);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v41 = (unsigned int)(v41 + 1);
v42 += 15;
if ( (unsigned int)v41 >= (unsigned int)sub_1002E757C(v31) )
goto LABEL_88;
}
if ( (int)v41 > 2 )
{
if ( (_DWORD)v41 == 3 )
{
std::string::assign(&__p, "L");
v46 = 0;
v47 = 16711935;
goto LABEL_79;
}
if ( (_DWORD)v41 == 4 )
{
std::string::assign(&__p, "M");
v46 = 0;
v47 = 16776960;
goto LABEL_79;
}
}
else
{
if ( (_DWORD)v41 == 1 )
{
std::string::assign(&__p, "F");
v46 = 0;
v47 = 0xFFFF;
goto LABEL_79;
}
if ( (_DWORD)v41 == 2 )
{
std::string::assign(&__p, "E");
v46 = 0;
v47 = 32255;
LABEL_79:
v48 = v40;
goto LABEL_80;
}
}
std::string::assign(&__p, "R");
v46 = 0;
v47 = 9868950;
goto LABEL_79;
}
LABEL_88:
memset(&__p, 0, sizeof(__p));
v49 = *(_DWORD **)(a1 + 1048);
v50 = v49[263];
if ( (int)v50 <= 0 )
{
v54 = sub_1003065B0("Req: %i", v49[261]);
}
else
{
v51 = (float)(int)v49[264];
v52 = (float)(int)v49[265];
v53 = (float)(int)v49[266];
v54 = sub_1003065B0(
"R: %i (%i- / %i+)\n%.1f | +%.1f | -%.1f | +-%.1f\nReq: %i",
(int)(float)v50,
(int)v53,
(int)v52,
(float)(v51 / (float)v50),
(float)((float)(v51 - v53) / (float)((float)v50 - v53)),
(float)((float)(v51 + (float)(v52 * -10.0)) / (float)((float)v50 - v52)),
(float)((float)((float)(v51 + (float)(v52 * -10.0)) - v53) / (float)((float)((float)v50 - v52) - v53)),
v49[261]);
}
v55 = (const std::string::value_type *)cocos2d::CCString::getCString(v54);
std::string::assign(&__p, v55);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v57 = cocos2d::CCLabelBMFont::create_1(p_p, "chatFont.fnt");
sub_1000262BC((float *)&v62, 0.0, 1.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v57 + 296LL))(v57, &v62);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v57 + 160LL))(v57, 0.6);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v57 + 1072LL))(v57, &unk_100762858);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v57 + 1024LL))(v57, 225);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v57, 2);
sub_1000262BC((float *)&v61, -130.0, 48.0);
*(float32x2_t *)&v58 = sub_100026318((float32x2_t *)(a1 + 1128), &v61, &v62);
(*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v57 + 184LL))(v57, &v62, v58);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}