//
// sub_140063EF0 from 0x140063ef0 to 0x14006413e (590 bytes)
//
// 4 xrefs:
// > GameToolbox::stringSetupToDict @ 0x140065cd2
// > GameManager::recountUserStats @ 0x1401853d8
// > LevelEditorLayer::init @ 0x1402d24d1
// > ??> @ 0x1406c5ce8
//
// 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
//
// Hidden C++ exception states: #wind=2
cocos2d::CCArray *__fastcall sub_140063EF0(__int64 *a1)
{
cocos2d::CCArray *v2; // r14
unsigned __int64 v3; // rdi
__int64 v4; // rcx
unsigned __int64 v5; // rbp
__int64 v6; // rsi
unsigned __int64 v7; // rcx
size_t v8; // r8
size_t v9; // rcx
__int64 *v10; // rax
void **v11; // rdx
size_t v12; // r8
struct cocos2d::CCObject *v13; // rax
void *v14; // rcx
__int64 v15; // rcx
void *v16; // rcx
void *v17; // rcx
void *Block[2]; // [rsp+38h] [rbp-60h] BYREF
__int64 v20; // [rsp+48h] [rbp-50h]
unsigned __int64 v21; // [rsp+50h] [rbp-48h]
__int128 v22; // [rsp+58h] [rbp-40h] BYREF
__int64 v23; // [rsp+68h] [rbp-30h]
unsigned __int64 v24; // [rsp+70h] [rbp-28h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v3 = 0;
v4 = (__int64)a1;
if ( (unsigned __int64)a1[3] > 0xF )
v4 = *a1;
v5 = a1[2];
v6 = sub_140042190(v4, v5, 0, ",", 1);
while ( 1 )
{
*(_OWORD *)Block = 0;
v20 = 0;
v21 = 0;
v7 = a1[2];
if ( v7 < v3 )
sub_14003BCC0(v7);
v8 = v6 - v3;
v9 = v7 - v3;
if ( v9 < v6 - v3 )
v8 = v9;
v10 = a1;
if ( (unsigned __int64)a1[3] > 0xF )
v10 = (__int64 *)*a1;
sub_14003A930(Block, (char *)v10 + v3, v8);
if ( v20 || v3 != v5 )
{
v11 = Block;
if ( v21 > 0xF )
v11 = (void **)Block[0];
v22 = 0;
v23 = 0;
v24 = 0;
v12 = -1;
do
++v12;
while ( *((_BYTE *)v11 + v12) );
sub_14003A930(&v22, v11, v12);
v13 = (struct cocos2d::CCObject *)cocos2d::CCString::create(&v22);
cocos2d::CCArray::addObject(v2, v13);
if ( v24 > 0xF )
{
v14 = (void *)v22;
if ( v24 + 1 >= 0x1000 )
{
v14 = *(void **)(v22 - 8);
if ( (unsigned __int64)(v22 - (_QWORD)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
}
if ( v6 == -1 )
break;
v3 = v6 + 1;
v15 = (__int64)a1;
if ( (unsigned __int64)a1[3] > 0xF )
v15 = *a1;
v6 = sub_140042190(v15, a1[2], v6 + 1, ",", 1);
if ( v21 > 0xF )
{
v16 = Block[0];
if ( v21 + 1 >= 0x1000 )
{
v16 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v16 - 8) > 0x1F )
goto LABEL_30;
}
j_j_free(v16);
}
}
if ( v21 > 0xF )
{
v17 = Block[0];
if ( v21 + 1 >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
LABEL_30:
invalid_parameter_noinfo_noreturn();
}
j_j_free(v17);
}
return v2;
}