//
// GameLevelManager::getLengthStr from 0x81d0f4 to 0x81d390 (668 bytes)
//
// 2 xrefs:
// > LevelSearchLayer::getLevelLenKey @ 0x7deb54
// > ??> @ 0xfdd68
//
// 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 12:54:59 +0000
//
__int64 *__usercall GameLevelManager::getLengthStr@(
unsigned __int8 a1@,
unsigned __int8 a2@,
unsigned __int8 a3@,
unsigned __int8 a4@,
unsigned __int8 a5@,
unsigned __int8 a6@,
__int64 *a7@)
{
int v8; // w23
int v9; // w19
unsigned int v11; // w20
int v12; // w0
int v13; // w21
const char *v14; // x1
cocos2d::CCString *v15; // x0
size_t v16; // x0
_BOOL4 v17; // w19
__int64 v18; // x0
__int64 v19; // x1
cocos2d::CCString *v21; // x0
const char *v22; // x0
size_t v23; // x0
int v24; // [xsp+64h] [xbp+64h]
int v25; // [xsp+68h] [xbp+68h]
int v26; // [xsp+6Ch] [xbp+6Ch]
int v27; // [xsp+70h] [xbp+70h]
int v28; // [xsp+74h] [xbp+74h]
char *CString; // [xsp+78h] [xbp+78h]
char *v30; // [xsp+78h] [xbp+78h]
__int64 v31; // [xsp+88h] [xbp+88h] BYREF
__int64 v32; // [xsp+90h] [xbp+90h]
void *v33; // [xsp+98h] [xbp+98h]
__int64 v34[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v35; // [xsp+B0h] [xbp+B0h]
v28 = a3;
v8 = a1;
v26 = a4;
v27 = a2;
v25 = a5;
v9 = 1;
v24 = a6;
v11 = 0;
v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init(&v31, &byte_11B8890, 0);
v12 = -1;
v13 = 0;
v14 = nullptr;
LABEL_2:
switch ( v12 )
{
case 0:
if ( v27 )
goto LABEL_4;
goto LABEL_7;
case 1:
if ( v28 )
goto LABEL_4;
goto LABEL_7;
case 2:
if ( !v26 )
goto LABEL_7;
goto LABEL_4;
case 3:
if ( !v25 )
goto LABEL_7;
goto LABEL_4;
case 4:
if ( v24 )
goto LABEL_4;
if ( v13 == 1 )
goto LABEL_25;
goto LABEL_11;
default:
break;
}
while ( !v8 )
{
if ( v9 == 6 )
goto LABEL_10;
LABEL_7:
v11 = v9++;
v12 = v9 - 2;
if ( (unsigned int)(v9 - 2) <= 4 )
goto LABEL_2;
}
LABEL_4:
if ( v13 )
std::string::append((__int64)&v31, &byte_1169BE0, 1u);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v11);
CString = (char *)cocos2d::CCString::getCString(v15);
v16 = strlen(CString);
std::string::append((__int64)&v31, CString, v16);
++v13;
v14 = (const char *)v11;
if ( v9 != 6 )
goto LABEL_7;
LABEL_10:
if ( v13 == 1 )
{
LABEL_25:
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v14);
v22 = (const char *)cocos2d::CCString::getCString(v21);
*a7 = 0;
a7[1] = 0;
a7[2] = 0;
v30 = (char *)v22;
v23 = strlen(v22);
std::string::__init(a7, v30, v23);
}
else
{
LABEL_11:
v34[0] = 0;
v34[1] = 0;
v35 = nullptr;
std::string::__init(v34, &byte_11B8890, 0);
v17 = sub_7FEA60((__int64)&v31, (__int64)v34);
if ( (v34[0] & 1) != 0 )
{
operator delete(v35);
if ( v17 )
goto LABEL_27;
LABEL_13:
v18 = v31;
v19 = v32;
a7[2] = (__int64)v33;
v31 = 0;
v32 = 0;
v33 = nullptr;
*a7 = v18;
a7[1] = v19;
}
else
{
if ( !v17 )
goto LABEL_13;
LABEL_27:
*a7 = 0;
a7[1] = 0;
a7[2] = 0;
std::string::__init(a7, &byte_1191DE0, 1u);
}
}
if ( (v31 & 1) != 0 )
operator delete(v33);
return a7;
}