//
// GameLevelManager::getLengthStr from 0x10053ee70 to 0x10053f5b3 (1859 bytes)
//
// 2 xrefs:
// > LevelSearchLayer::getSearchObject @ 0x10062c306
// > LevelSearchLayer::getLevelLenKey @ 0x10062c76f
//
// 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
//
size_t *__fastcall GameLevelManager::getLengthStr(
size_t *a1,
double a2,
__int64 a3,
char a4,
char a5,
char a6,
char a7,
char a8,
char a9)
{
cocos2d::CCString *v12; // rax
const char *CString; // rax
int v14; // ebx
cocos2d::CCString *v15; // rax
const char *v16; // rax
int v17; // ebx
cocos2d::CCString *v18; // rax
const char *v19; // rax
cocos2d::CCString *v20; // rax
const char *v21; // rax
int v22; // ebx
cocos2d::CCString *v23; // rax
const char *v24; // rax
cocos2d::CCString *v25; // rax
const char *v26; // rax
cocos2d::CCString *v27; // rax
const char *v28; // rax
cocos2d::CCString *v29; // rax
const char *v30; // rax
cocos2d::CCString *v31; // rax
const char *v32; // rax
cocos2d::CCString *v33; // rax
const char *v34; // rax
int v35; // r14d
cocos2d::CCString *v36; // rax
const char *v37; // rax
cocos2d::CCString *v38; // rax
const char *v39; // rax
cocos2d::CCString *v40; // rax
const char *v41; // rax
cocos2d::CCString *v42; // rax
const char *v43; // rax
int v44; // ebx
cocos2d::CCString *v45; // rax
const char *v46; // rax
cocos2d::CCString *v47; // rax
const char *v48; // rax
int v49; // ebx
cocos2d::CCString *v50; // rax
const char *v51; // rax
cocos2d::CCString *v52; // rax
const char *v53; // rax
cocos2d::CCString *v54; // rax
size_t *v55; // rbx
const char *v56; // r14
size_t v57; // rax
size_t v58; // r15
_BYTE *v59; // r12
size_t v60; // r13
cocos2d::CCString *v61; // rax
const char *v62; // rax
cocos2d::CCString *v63; // rax
const char *v64; // rax
cocos2d::CCString *v65; // rax
const char *v66; // rax
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v67; // al
char v69; // [rsp+0h] [rbp-50h]
char v70; // [rsp+0h] [rbp-50h]
std::string v71; // [rsp+10h] [rbp-40h] BYREF
*(_WORD *)&v71.__r_.__value_.__l.0 = 0;
if ( a9 )
{
if ( a4 )
{
v12 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
CString = cocos2d::CCString::getCString(v12);
std::string::append(&v71, CString);
v14 = 1;
if ( !a5 )
{
LABEL_11:
if ( !a6 )
{
LABEL_23:
if ( !a7 )
{
LABEL_26:
if ( !a8 )
{
LABEL_29:
std::string::append(&v71, ",");
goto LABEL_30;
}
std::string::append(&v71, ",");
LABEL_28:
v29 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v30 = cocos2d::CCString::getCString(v29);
std::string::append(&v71, v30);
++v14;
goto LABEL_29;
}
std::string::append(&v71, ",");
LABEL_25:
v27 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v28 = cocos2d::CCString::getCString(v27);
std::string::append(&v71, v28);
++v14;
goto LABEL_26;
}
std::string::append(&v71, ",");
LABEL_22:
v25 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v26 = cocos2d::CCString::getCString(v25);
std::string::append(&v71, v26);
++v14;
goto LABEL_23;
}
v14 = 2;
std::string::append(&v71, ",");
}
else
{
v14 = 1;
if ( !a5 )
{
v14 = 0;
if ( !a6 )
{
v14 = 0;
if ( !a7 )
{
v14 = 0;
if ( !a8 )
{
LABEL_30:
v31 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v32 = cocos2d::CCString::getCString(v31);
std::string::append(&v71, v32);
if ( v14 )
goto LABEL_79;
LABEL_60:
v54 = (cocos2d::CCString *)sub_1007AB580("%i", v70);
v55 = a1;
v56 = cocos2d::CCString::getCString(v54);
v57 = strlen(v56);
if ( v57 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a2);
v58 = v57;
if ( v57 >= 0x17 )
{
v60 = 26;
if ( (v57 | 7) != 0x17 )
v60 = (v57 | 7) + 1;
v59 = operator new(v60);
a1[2] = (size_t)v59;
*a1 = v60 | 1;
a1[1] = v58;
}
else
{
*(_BYTE *)a1 = 2 * v57;
v59 = (char *)a1 + 1;
if ( !v57 )
{
LABEL_68:
v59[v58] = 0;
if ( (*(_BYTE *)&v71.__r_.__value_.__s.0 & 1) == 0 )
return v55;
goto LABEL_84;
}
}
memmove(v59, v56, v58);
goto LABEL_68;
}
goto LABEL_28;
}
goto LABEL_25;
}
goto LABEL_22;
}
}
v18 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v19 = cocos2d::CCString::getCString(v18);
std::string::append(&v71, v19);
goto LABEL_11;
}
if ( a8 )
{
if ( a4 )
{
v15 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v16 = cocos2d::CCString::getCString(v15);
std::string::append(&v71, v16);
v17 = 1;
if ( !a5 )
{
LABEL_19:
if ( !a6 )
{
LABEL_42:
if ( !a7 )
{
LABEL_45:
std::string::append(&v71, ",");
goto LABEL_46;
}
std::string::append(&v71, ",");
LABEL_44:
v40 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v41 = cocos2d::CCString::getCString(v40);
std::string::append(&v71, v41);
++v17;
goto LABEL_45;
}
std::string::append(&v71, ",");
LABEL_41:
v38 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v39 = cocos2d::CCString::getCString(v38);
std::string::append(&v71, v39);
++v17;
goto LABEL_42;
}
v17 = 2;
std::string::append(&v71, ",");
}
else
{
v17 = 1;
if ( !a5 )
{
v17 = 0;
if ( !a6 )
{
v17 = 0;
if ( !a7 )
{
LABEL_46:
v42 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v43 = cocos2d::CCString::getCString(v42);
std::string::append(&v71, v43);
if ( !v17 )
goto LABEL_60;
goto LABEL_79;
}
goto LABEL_44;
}
goto LABEL_41;
}
}
v23 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v24 = cocos2d::CCString::getCString(v23);
std::string::append(&v71, v24);
goto LABEL_19;
}
if ( !a7 )
{
if ( !a6 )
{
if ( !a5 )
{
if ( !a4 )
goto LABEL_79;
v65 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v66 = cocos2d::CCString::getCString(v65);
std::string::append(&v71, v66);
goto LABEL_60;
}
v44 = 1;
if ( a4 )
{
v45 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v46 = cocos2d::CCString::getCString(v45);
std::string::append(&v71, v46);
v44 = 2;
std::string::append(&v71, ",");
}
v47 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v48 = cocos2d::CCString::getCString(v47);
std::string::append(&v71, v48);
LABEL_59:
if ( v44 != 1 )
goto LABEL_79;
goto LABEL_60;
}
if ( a4 )
{
v33 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v34 = cocos2d::CCString::getCString(v33);
std::string::append(&v71, v34);
v35 = 1;
if ( !a5 )
{
LABEL_57:
std::string::append(&v71, ",");
v49 = v35;
goto LABEL_58;
}
v35 = 2;
std::string::append(&v71, ",");
}
else
{
v49 = 0;
v35 = 1;
if ( !a5 )
{
LABEL_58:
v52 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v53 = cocos2d::CCString::getCString(v52);
std::string::append(&v71, v53);
v44 = v49 + 1;
goto LABEL_59;
}
}
v50 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v51 = cocos2d::CCString::getCString(v50);
std::string::append(&v71, v51);
goto LABEL_57;
}
if ( a4 )
{
v20 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v21 = cocos2d::CCString::getCString(v20);
std::string::append(&v71, v21);
v22 = 1;
if ( !a5 )
goto LABEL_38;
v22 = 2;
std::string::append(&v71, ",");
}
else
{
v22 = 1;
if ( !a5 )
{
v22 = 0;
if ( !a6 )
goto LABEL_73;
goto LABEL_71;
}
}
v36 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v37 = cocos2d::CCString::getCString(v36);
std::string::append(&v71, v37);
LABEL_38:
if ( a6 )
{
std::string::append(&v71, ",");
LABEL_71:
v61 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v62 = cocos2d::CCString::getCString(v61);
std::string::append(&v71, v62);
++v22;
}
std::string::append(&v71, ",");
LABEL_73:
v63 = (cocos2d::CCString *)sub_1007AB580("%i", v69);
v64 = cocos2d::CCString::getCString(v63);
std::string::append(&v71, v64);
if ( !v22 )
goto LABEL_60;
LABEL_79:
v67 = v71.__r_.__value_.__s.0;
if ( (*(_BYTE *)&v71.__r_.__value_.__s.0 & 1) == 0 )
{
v55 = a1;
if ( *(_BYTE *)&v71.__r_.__value_.__l.0 >> 1 )
goto LABEL_81;
goto LABEL_83;
}
v55 = a1;
if ( !v71.__r_.__value_.__l.__size_ )
{
LABEL_83:
*(_WORD *)v55 = 11522;
*((_BYTE *)v55 + 2) = 0;
if ( (*(_BYTE *)&v67 & 1) == 0 )
return v55;
LABEL_84:
operator delete(v71.__r_.__value_.__l.__data_);
return v55;
}
LABEL_81:
*(std::string *)v55 = v71;
return v55;
}