//
// LevelTools::createStarPackDict from 0x42146c to 0x421660 (500 bytes)
//
// 1 xrefs:
// > GameManager::recountUserStats @ 0x41bcc0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:01 +0000
//
cocos2d::CCDictionary *__fastcall LevelTools::createStarPackDict(LevelTools *this)
{
cocos2d::CCDictionary *v1; // r11
cocos2d::CCArray *v2; // r0
cocos2d::CCArray *v3; // r8
int v4; // r3
unsigned __int8 *v5; // r2
unsigned __int8 *v6; // r3
unsigned __int8 *v7; // r1
unsigned __int8 *v8; // r4
int v9; // r5
int v10; // r4
int v11; // r6
unsigned int v12; // r5
size_t v13; // r2
unsigned int v14; // r3
std::logic_error *exception; // r4
char *v16; // r1
size_t v17; // r3
char *v18; // r1
char *v19; // r1
size_t v20; // r0
cocos2d::CCObject *v21; // r0
unsigned __int8 *v22; // r2
unsigned int v23; // r3
unsigned __int8 *v24; // r1
unsigned __int8 *v25; // r3
unsigned __int8 *v26; // r4
int v27; // r0
unsigned int v28; // r4
unsigned int v29; // r5
cocos2d::CCString *v30; // r0
int v31; // r6
cocos2d::CCObject *v32; // r0
char *v34; // [sp+4h] [bp-30h]
int v35; // [sp+8h] [bp-2Ch] BYREF
unsigned int v36; // [sp+Ch] [bp-28h]
char *v37; // [sp+10h] [bp-24h]
int v38; // [sp+14h] [bp-20h] BYREF
int v39; // [sp+18h] [bp-1Ch]
char *v40; // [sp+1Ch] [bp-18h]
int v41[3]; // [sp+20h] [bp-14h] BYREF
v35 = 0;
v36 = 0;
v37 = nullptr;
v1 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(this);
v2 = (cocos2d::CCArray *)std::string::__init(
&v35,
"1,3,2,4,3,4,5,5,6,6,7,6,8,7,9,8,10,8,11,9,19,10,20,10,21,10,22,10,26,10,27,10,28,10,29,10,3"
"0,10,31,10,32,4,33,5,34,6,35,8,36,8,37,5,38,5,39,6,40,7,41,8,42,8,43,8,44,9,45,6,46,10,47,1"
"0,48,10,49,10,50,10,52,4,53,3,54,4,55,4,56,5,57,6,58,7,59,8,60,8,61,8,62,9,63,9,64,10,65,10,66,10",
0x117u);
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create(v2);
if ( (v35 & 1) == 0 )
{
v4 = (int)(unsigned __int8)v35 >> 1;
if ( !v4 )
{
v10 = -1;
goto LABEL_14;
}
v5 = (unsigned __int8 *)&v35 + 1;
LABEL_3:
v6 = &v5[v4];
v7 = v5;
while ( 1 )
{
v8 = v7;
if ( v7 == v6 )
break;
v9 = *v7++;
if ( v9 == 44 )
{
v10 = v8 - v5;
goto LABEL_8;
}
}
v10 = -1;
LABEL_8:
if ( (v35 & 1) != 0 )
goto LABEL_11;
LABEL_14:
v11 = (int)(unsigned __int8)v35 >> 1;
goto LABEL_15;
}
v4 = v36;
v5 = (unsigned __int8 *)v37;
if ( v36 )
goto LABEL_3;
v10 = -1;
LABEL_11:
v11 = v36;
LABEL_15:
v12 = 0;
while ( 1 )
{
v13 = v10 - v12;
v38 = 0;
v39 = 0;
v40 = nullptr;
if ( (v35 & 1) != 0 )
{
v14 = v36;
if ( v12 > v36 )
goto LABEL_20;
v16 = v37;
}
else
{
v14 = (int)(unsigned __int8)v35 >> 1;
if ( v12 > v14 )
{
LABEL_20:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v16 = (char *)&v35 + 1;
}
v17 = v14 - v12;
v18 = &v16[v12];
if ( v13 >= v17 )
v13 = v17;
std::string::__init(&v38, v18, v13);
if ( (v38 & 1) != 0 )
{
if ( v39 || v12 != v11 )
{
v19 = v40;
LABEL_34:
v34 = v19;
memset(v41, 0, sizeof(v41));
v20 = strlen(v19);
std::string::__init(v41, v34, v20);
v21 = (cocos2d::CCObject *)cocos2d::CCString::create(v41);
cocos2d::CCArray::addObject(v3, v21);
std::string::~string((int)v41);
}
}
else if ( (unsigned __int8)v38 >> 1 || v12 != v11 )
{
v19 = (char *)&v38 + 1;
goto LABEL_34;
}
if ( v10 == -1 )
break;
v12 = v10 + 1;
if ( (v35 & 1) != 0 )
{
v22 = (unsigned __int8 *)v37;
v23 = v36;
}
else
{
v23 = (int)(unsigned __int8)v35 >> 1;
v22 = (unsigned __int8 *)&v35 + 1;
}
if ( v12 < v23 )
{
v24 = &v22[v12];
v25 = &v22[v23];
while ( 1 )
{
v26 = v24;
if ( v24 == v25 )
break;
v27 = *v24++;
if ( v27 == 44 )
{
v10 = v26 - v22;
goto LABEL_44;
}
}
}
v10 = -1;
LABEL_44:
std::string::~string((int)&v38);
}
v28 = 0;
std::string::~string((int)&v38);
std::string::~string((int)&v35);
while ( 1 )
{
v29 = v28 + 1;
if ( v28 + 1 >= cocos2d::CCArray::count(v3) )
break;
v30 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v3, v28);
v28 += 2;
v31 = cocos2d::CCString::intValue(v30);
v32 = (cocos2d::CCObject *)cocos2d::CCArray::stringAtIndex(v3, v29);
cocos2d::CCDictionary::setObject(v1, v32, v31);
}
return v1;
}