//
// EditorBuildStats::fromString from 0x4c5220 to 0x4c53de (446 bytes)
//
// 1 xrefs:
// > GJGameLevel::dataLoaded @ 0x4cbfbc
//
// 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:50:29 +0000
//
int __fastcall EditorBuildStats::fromString(int a1, int a2)
{
const char *v3; // r5
size_t v4; // r0
cocos2d::CCArray *v5; // r5
int result; // r0
cocos2d::CCString *v7; // r0
const char *CString; // r0
char **v9; // r8
unsigned int v10; // r7
cocos2d::CCString *v11; // r0
const char *v12; // r0
int v13; // s15
int v14; // r3
int *v15; // r3
int v16; // r2
int v17; // t1
cocos2d::CCString *v18; // r0
const char *v19; // r5
size_t v20; // r0
int v21; // r3
unsigned __int8 *v22; // r8
unsigned __int8 *v23; // r5
unsigned __int8 *v24; // r9
unsigned __int8 *v25; // r10
int v26; // r1
__int64 v27; // r0
int v28; // r3
int v29; // [sp+0h] [bp-Ch] BYREF
int v30; // [sp+4h] [bp-8h]
char *v31; // [sp+8h] [bp-4h] BYREF
int v32[22]; // [sp+Ch] [bp+0h] BYREF
memset(v32, 0, 12);
if ( (*(_BYTE *)a2 & 1) != 0 )
v3 = *(const char **)(a2 + 8);
else
v3 = (const char *)(a2 + 1);
v4 = strlen(v3);
std::string::__init(v32, v3, v4);
v5 = sub_4C1A88(v32, ",");
std::string::~string((int)v32);
result = cocos2d::CCArray::count(v5);
if ( result )
{
v7 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0);
CString = (const char *)cocos2d::CCString::getCString(v7);
result = atoi(CString);
if ( result > 0 )
{
v9 = &v31;
memset(v32, 0, sizeof(v32));
v10 = 0;
do
{
if ( (signed int)++v10 >= cocos2d::CCArray::count(v5) )
break;
v11 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, v10);
v12 = (const char *)cocos2d::CCString::getCString(v11);
v9[1] = (char *)atoi(v12);
++v9;
}
while ( v10 != 22 );
v13 = v32[7];
*(_DWORD *)a1 = v32[0];
*(_DWORD *)(a1 + 4) = v32[1];
*(_DWORD *)(a1 + 8) = v32[2];
v14 = v32[3];
*(float *)(a1 + 28) = (float)v13;
*(_DWORD *)(a1 + 12) = v14;
*(_DWORD *)(a1 + 16) = v32[4];
*(_DWORD *)(a1 + 20) = v32[5];
*(_DWORD *)(a1 + 24) = v32[6];
v15 = &v32[8];
*(_DWORD *)(a1 + 32) = v32[8];
v16 = a1 + 60;
do
{
v17 = v15[1];
++v15;
*(_DWORD *)(v16 + 4) = v17;
v16 += 4;
}
while ( v16 != a1 + 92 );
*(_DWORD *)(a1 + 36) = v32[17];
*(_DWORD *)(a1 + 40) = v32[18];
if ( cocos2d::CCArray::count(v5) <= 0x14u )
{
v19 = (const char *)&unk_B6B226;
}
else
{
v18 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0x14u);
v19 = (const char *)cocos2d::CCString::getCString(v18);
}
v29 = 0;
v30 = 0;
v31 = nullptr;
v20 = strlen(v19);
std::string::__init(&v29, v19, v20);
if ( (v29 & 1) != 0 )
{
v21 = v30;
if ( (unsigned int)(v30 - 1) > 0x12 )
{
LABEL_26:
v27 = 0;
LABEL_27:
v28 = v32[20];
*(_QWORD *)(a1 + 48) = v27;
*(_DWORD *)(a1 + 56) = v28;
*(_DWORD *)(a1 + 60) = v32[21];
return std::string::~string((int)&v29);
}
v22 = (unsigned __int8 *)v31;
}
else
{
v21 = (int)(unsigned __int8)v29 >> 1;
if ( !v21 || v21 > 19 )
goto LABEL_26;
v22 = (unsigned __int8 *)&v29 + 1;
}
v23 = &v22[v21];
v24 = v22;
while ( 1 )
{
v25 = v24;
if ( v24 == v23 )
break;
v26 = *v24++;
if ( !memchr("0123456789", v26, 0xAu) )
{
if ( v25 - v22 != -1 )
goto LABEL_26;
break;
}
}
LODWORD(v27) = std::stoull(&v29, 0, 10);
goto LABEL_27;
}
}
return result;
}