//
// GameLevelManager::getDifficultyStr from 0x10053e890 to 0x10053ee47 (1463 bytes)
//
// 1 xrefs:
// > LevelSearchLayer::getSearchDiffKey @ 0x10062c6aa
//
// 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
//
__int64 __fastcall GameLevelManager::getDifficultyStr(
__int64 a1,
double a2,
__int64 a3,
int a4,
char a5,
char a6,
char a7,
char a8,
char a9,
char a10,
char a11)
{
cocos2d::CCString *v14; // rax
const char *CString; // rax
int v16; // r13d
cocos2d::CCString *v17; // rax
const char *v18; // rax
cocos2d::CCString *v19; // rax
const char *v20; // rax
cocos2d::CCString *v21; // rax
const char *v22; // rax
int v23; // r14d
cocos2d::CCString *v24; // rax
const char *v25; // rax
cocos2d::CCString *v26; // rax
const char *v27; // rax
cocos2d::CCString *v28; // rax
const char *v29; // rax
int v30; // r13d
cocos2d::CCString *v31; // rax
const char *v32; // rax
cocos2d::CCString *v33; // rax
const char *v34; // rax
cocos2d::CCString *v35; // rax
const char *v36; // rax
cocos2d::CCString *v37; // rax
const char *v38; // rax
cocos2d::CCString *v39; // rax
const char *v40; // rax
cocos2d::CCString *v41; // rax
const char *v42; // r14
size_t v43; // rax
size_t v44; // r15
_BYTE *v45; // r12
size_t v46; // r13
cocos2d::CCString *v47; // rax
const char *v48; // rax
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v49; // al
std::string v50; // [rsp+0h] [rbp-40h] BYREF
if ( !a4 )
{
if ( a10 )
{
*(_BYTE *)a1 = 4;
*(_WORD *)(a1 + 1) = 12845;
goto LABEL_7;
}
if ( a11 )
{
*(_BYTE *)a1 = 4;
*(_WORD *)(a1 + 1) = 13101;
goto LABEL_7;
}
*(_WORD *)&v50.__r_.__value_.__l.0 = 0;
if ( a9 )
{
if ( a5 )
{
v14 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
CString = cocos2d::CCString::getCString(v14);
std::string::append(&v50, CString);
v16 = 1;
if ( !a6 )
{
LABEL_19:
if ( !a7 )
goto LABEL_31;
std::string::append(&v50, ",");
LABEL_30:
v26 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v27 = cocos2d::CCString::getCString(v26);
std::string::append(&v50, v27);
++v16;
LABEL_31:
if ( a8 )
{
std::string::append(&v50, ",");
LABEL_33:
v28 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v29 = cocos2d::CCString::getCString(v28);
std::string::append(&v50, v29);
++v16;
}
LABEL_45:
std::string::append(&v50, ",");
goto LABEL_46;
}
v16 = 2;
std::string::append(&v50, ",");
}
else
{
v16 = 1;
if ( !a6 )
{
v16 = 0;
if ( !a7 )
{
v16 = 0;
if ( !a8 )
goto LABEL_46;
goto LABEL_33;
}
goto LABEL_30;
}
}
v19 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v20 = cocos2d::CCString::getCString(v19);
std::string::append(&v50, v20);
goto LABEL_19;
}
if ( a8 )
{
if ( a5 )
{
v17 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v18 = cocos2d::CCString::getCString(v17);
std::string::append(&v50, v18);
v16 = 1;
if ( !a6 )
{
LABEL_27:
if ( !a7 )
goto LABEL_45;
std::string::append(&v50, ",");
LABEL_44:
v37 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v38 = cocos2d::CCString::getCString(v37);
std::string::append(&v50, v38);
++v16;
goto LABEL_45;
}
v16 = 2;
std::string::append(&v50, ",");
}
else
{
v16 = 1;
if ( !a6 )
{
v16 = 0;
if ( !a7 )
{
LABEL_46:
v39 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v40 = cocos2d::CCString::getCString(v39);
std::string::append(&v50, v40);
v30 = v16 + 1;
goto LABEL_47;
}
goto LABEL_44;
}
}
v24 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v25 = cocos2d::CCString::getCString(v24);
std::string::append(&v50, v25);
goto LABEL_27;
}
if ( !a7 )
{
if ( !a6 )
{
if ( a5 )
{
v47 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v48 = cocos2d::CCString::getCString(v47);
std::string::append(&v50, v48);
LABEL_48:
v41 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v42 = cocos2d::CCString::getCString(v41);
v43 = strlen(v42);
if ( v43 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a2);
v44 = v43;
if ( v43 >= 0x17 )
{
v46 = 26;
if ( (v43 | 7) != 0x17 )
v46 = (v43 | 7) + 1;
v45 = operator new(v46);
*(_QWORD *)(a1 + 16) = v45;
*(_QWORD *)a1 = v46 | 1;
*(_QWORD *)(a1 + 8) = v44;
}
else
{
*(_BYTE *)a1 = 2 * v43;
v45 = (_BYTE *)(a1 + 1);
if ( !v43 )
{
LABEL_56:
v45[v44] = 0;
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) == 0 )
return a1;
LABEL_67:
operator delete(v50.__r_.__value_.__l.__data_);
return a1;
}
}
memmove(v45, v42, v44);
goto LABEL_56;
}
LABEL_62:
v49 = v50.__r_.__value_.__s.0;
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
{
if ( v50.__r_.__value_.__l.__size_ )
{
LABEL_64:
*(std::string *)a1 = v50;
return a1;
}
}
else if ( *(_BYTE *)&v50.__r_.__value_.__l.0 >> 1 )
{
goto LABEL_64;
}
*(_WORD *)a1 = 11522;
*(_BYTE *)(a1 + 2) = 0;
if ( (*(_BYTE *)&v49 & 1) == 0 )
return a1;
goto LABEL_67;
}
v30 = 1;
if ( a5 )
{
v31 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v32 = cocos2d::CCString::getCString(v31);
std::string::append(&v50, v32);
v30 = 2;
std::string::append(&v50, ",");
}
v33 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v34 = cocos2d::CCString::getCString(v33);
std::string::append(&v50, v34);
LABEL_47:
if ( v30 == 1 )
goto LABEL_48;
goto LABEL_62;
}
if ( a5 )
{
v21 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v22 = cocos2d::CCString::getCString(v21);
std::string::append(&v50, v22);
v23 = 1;
if ( !a6 )
{
LABEL_41:
std::string::append(&v50, ",");
v16 = v23;
goto LABEL_46;
}
v23 = 2;
std::string::append(&v50, ",");
}
else
{
v16 = 0;
v23 = 1;
if ( !a6 )
goto LABEL_46;
}
v35 = (cocos2d::CCString *)sub_1007AB580("%i", *(_BYTE *)&v50.__r_.__value_.__l.0);
v36 = cocos2d::CCString::getCString(v35);
std::string::append(&v50, v36);
goto LABEL_41;
}
*(_BYTE *)a1 = 4;
*(_WORD *)(a1 + 1) = 12589;
LABEL_7:
*(_BYTE *)(a1 + 3) = 0;
return a1;
}