//
// LevelTools::createStarPackDict from 0x100500bf0 to 0x100500fcf (991 bytes)
//
// 1 xrefs:
// > GameManager::recountUserStats @ 0x10036f510
//
// This function is hookable on this platform (idp: pc, 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:31:30 +0000
//
_QWORD *LevelTools::createStarPackDict()
{
char *v0; // r15
__int64 v1; // rax
__int64 v2; // r14
unsigned __int64 v3; // rbx
bool v4; // zf
unsigned __int64 v5; // r12
char *v6; // r13
size_t v7; // r12
char *v8; // r15
char v9; // al
__int64 v10; // r12
const char *v11; // r12
unsigned __int64 v12; // r14
size_t v13; // rbx
size_t v14; // rax
size_t v15; // r13
char *v16; // r15
__int64 v17; // r12
unsigned __int64 v18; // r14
size_t v19; // rbx
__int64 v20; // rax
__int64 v21; // r15
__int64 v22; // rbx
char *v23; // rax
unsigned __int64 v24; // rsi
char *v25; // rdx
unsigned __int64 v26; // rdi
unsigned int v27; // r15d
__int64 v28; // rax
int v29; // ebx
__int64 v30; // rax
unsigned int v31; // eax
unsigned int v32; // ecx
_QWORD *v34; // [rsp+8h] [rbp-88h]
_QWORD v35[2]; // [rsp+10h] [rbp-80h] BYREF
void *__p; // [rsp+20h] [rbp-70h]
__int64 v37; // [rsp+28h] [rbp-68h]
const char *v38; // [rsp+30h] [rbp-60h]
__int64 __dst; // [rsp+38h] [rbp-58h] BYREF
size_t v40; // [rsp+40h] [rbp-50h]
void *v41; // [rsp+48h] [rbp-48h]
__int64 v42; // [rsp+50h] [rbp-40h] BYREF
unsigned __int64 v43; // [rsp+58h] [rbp-38h]
void *v44; // [rsp+60h] [rbp-30h]
v34 = cocos2d::CCDictionary::create();
v0 = (char *)operator new(0x118u);
v44 = v0;
v42 = 281;
v43 = 279;
strcpy(
v0,
"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,30,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,10,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");
v1 = sub_1007FE900(v0);
v2 = 2;
while ( 1 )
{
if ( v0[v2 - 2] == 44 )
{
v2 -= 2;
LABEL_8:
if ( v2 != 279 )
goto LABEL_10;
LABEL_9:
v2 = -1;
goto LABEL_10;
}
if ( v0[v2 - 1] == 44 )
break;
if ( v0[v2] == 44 )
goto LABEL_8;
v2 += 3;
if ( v2 == 281 )
goto LABEL_9;
}
if ( --v2 == 279 )
goto LABEL_9;
LABEL_10:
v3 = 0;
v37 = v1;
do
{
if ( (v42 & 1) != 0 )
{
v5 = v43;
if ( v43 < v3 )
LABEL_65:
sub_100056810();
v6 = (char *)v44;
}
else
{
v5 = (unsigned __int8)v42 >> 1;
v6 = (char *)&v42 + 1;
if ( v3 > v5 )
goto LABEL_65;
}
v7 = v5 - v3;
if ( v7 >= v2 - v3 )
v7 = v2 - v3;
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
if ( v7 >= 0x17 )
{
v38 = (const char *)v2;
v12 = v3;
v13 = (v7 | 7) + 1;
if ( (v7 | 7) == 0x17 )
v13 = 26;
v8 = (char *)operator new(v13);
v41 = v8;
__dst = v13 | 1;
v40 = v7;
v3 = v12;
v2 = (__int64)v38;
}
else
{
LOBYTE(__dst) = 2 * v7;
v8 = (char *)&__dst + 1;
if ( !v7 )
{
BYTE1(__dst) = 0;
v9 = __dst;
if ( (__dst & 1) == 0 )
goto LABEL_23;
goto LABEL_30;
}
}
memmove(v8, &v6[v3], v7);
v8[v7] = 0;
v9 = __dst;
if ( (__dst & 1) == 0 )
{
LABEL_23:
v10 = v37;
if ( !v9 && v3 == 279 )
goto LABEL_43;
v11 = (char *)&__dst + 1;
goto LABEL_33;
}
LABEL_30:
v10 = v37;
if ( !v40 && v3 == 279 )
goto LABEL_43;
v11 = (const char *)v41;
LABEL_33:
v14 = strlen(v11);
if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v15 = v14;
if ( v14 >= 0x17 )
{
v38 = v11;
v17 = v2;
v18 = v3;
v19 = (v14 | 7) + 1;
if ( (v14 | 7) == 0x17 )
v19 = 26;
v16 = (char *)operator new(v19);
__p = v16;
v35[0] = v19 | 1;
v35[1] = v15;
v3 = v18;
v2 = v17;
v11 = v38;
LABEL_40:
memmove(v16, v11, v15);
goto LABEL_41;
}
LOBYTE(v35[0]) = 2 * v14;
v16 = (char *)v35 + 1;
if ( v14 )
goto LABEL_40;
LABEL_41:
v16[v15] = 0;
v20 = sub_10088E600(v35);
v10 = v37;
sub_1007FEBF0(v37, v20);
if ( (v35[0] & 1) != 0 )
operator delete(__p);
LABEL_43:
v21 = v3;
v22 = -1;
if ( v2 == -1 )
goto LABEL_44;
if ( (v42 & 1) != 0 )
{
v23 = (char *)v44;
v24 = v43;
v21 = v2 + 1;
if ( v43 <= v2 + 1 )
goto LABEL_44;
}
else
{
v24 = (unsigned __int8)v42 >> 1;
v23 = (char *)&v42 + 1;
v21 = v2 + 1;
if ( v24 <= v2 + 1 )
goto LABEL_44;
}
v25 = &v23[v21];
v26 = v24 + ~v2;
while ( *v25 != 44 )
{
++v25;
if ( !--v26 )
{
v25 = &v23[v24];
break;
}
}
v22 = v25 - v23;
if ( v25 == &v23[v24] )
v22 = -1;
LABEL_44:
if ( (__dst & 1) != 0 )
operator delete(v41);
v4 = v2 == -1;
v2 = v22;
v3 = v21;
}
while ( !v4 );
if ( (v42 & 1) != 0 )
operator delete(v44);
if ( (unsigned int)sub_1007FEF90(v10) >= 2 )
{
v27 = 0;
do
{
v28 = cocos2d::CCArray::stringAtIndex(v10, v27);
v29 = cocos2d::CCString::intValue(v28);
v30 = cocos2d::CCArray::stringAtIndex(v10, v27 + 1);
cocos2d::CCDictionary::setObject_1((__int64)v34, v30, v29);
v31 = sub_1007FEF90(v10);
v32 = v27 + 3;
v27 += 2;
}
while ( v32 < v31 );
}
return v34;
}