//
// EditorBuildStats::fromString from 0x811418 to 0x811760 (840 bytes)
//
// 2 xrefs:
// > GJGameLevel::dataLoaded @ 0x83e49c
// > ??> @ 0x6e290
//
// 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:50 +0000
//
__int64 __fastcall EditorBuildStats::fromString(__int64 a1, char *a2)
{
char *v3; // x21
size_t v4; // x0
cocos2d::CCArray *v5; // x21
cocos2d::CCString *v7; // x0
const char *CString; // x0
__int64 v9; // x23
unsigned int v10; // w24
__int128 v11; // q2
int v12; // w0
__int128 v13; // q1
int v14; // w2
int v15; // w1
const char *v16; // x1
size_t v17; // x0
int v18; // w24
__int64 v19; // x20
unsigned __int8 *v20; // x26
void *v21; // x0
cocos2d::CCString *v22; // x0
const char *v23; // x0
int v24; // w0
char *v25; // x20
unsigned __int8 *v26; // x21
int v27; // w0
int v28; // w0
cocos2d::CCString *v29; // x0
char *v30; // [xsp+58h] [xbp+58h]
__int64 v31; // [xsp+68h] [xbp+68h] BYREF
__int64 v32; // [xsp+70h] [xbp+70h]
void *v33; // [xsp+78h] [xbp+78h]
__int64 v34; // [xsp+80h] [xbp+80h] BYREF
__int64 v35; // [xsp+88h] [xbp+88h]
void *v36; // [xsp+90h] [xbp+90h]
__int64 v37; // [xsp+98h] [xbp+98h]
_QWORD v38[5]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v39; // [xsp+C8h] [xbp+C8h]
__int64 v40; // [xsp+D0h] [xbp+D0h]
v3 = a2 + 1;
if ( (*a2 & 1) != 0 )
v3 = *((char **)a2 + 2);
v34 = 0;
v35 = 0;
v36 = nullptr;
v4 = strlen(v3);
std::string::__init(&v34, v3, v4);
v5 = sub_80CFCC((unsigned __int8 *)&v34, &byte_1169BE0);
if ( (v34 & 1) != 0 )
{
operator delete(v36);
if ( !(unsigned int)cocos2d::CCArray::count(v5) )
return _stack_chk_guard;
}
else if ( !(unsigned int)cocos2d::CCArray::count(v5) )
{
return _stack_chk_guard;
}
v7 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0);
CString = (const char *)cocos2d::CCString::getCString(v7);
if ( atoi(CString) <= 0 )
return _stack_chk_guard;
v34 = 0;
v35 = 0;
v36 = nullptr;
v37 = 0;
memset(v38, 0, sizeof(v38));
v39 = 0;
v40 = 0;
v9 = 0;
v10 = 0;
do
{
if ( (int)++v10 >= (int)cocos2d::CCArray::count(v5) )
break;
v22 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, v10);
v23 = (const char *)cocos2d::CCString::getCString(v22);
*(_DWORD *)((char *)&v34 + v9) = atoi(v23);
v9 += 4;
}
while ( v10 != 22 );
*(_DWORD *)a1 = v34;
v11 = *(_OWORD *)((char *)v38 + 4);
v12 = HIDWORD(v37);
*(_DWORD *)(a1 + 4) = HIDWORD(v34);
*(_QWORD *)(a1 + 8) = v35;
*(_DWORD *)(a1 + 16) = (_DWORD)v36;
v13 = *(_OWORD *)((char *)&v38[2] + 4);
*(_DWORD *)(a1 + 20) = HIDWORD(v36);
*(_DWORD *)(a1 + 24) = v37;
v14 = v38[0];
*(float *)(a1 + 28) = (float)v12;
*(_DWORD *)(a1 + 32) = v14;
*(_OWORD *)(a1 + 64) = v11;
v15 = HIDWORD(v38[4]);
*(_OWORD *)(a1 + 80) = v13;
*(_DWORD *)(a1 + 36) = v15;
*(_DWORD *)(a1 + 40) = v39;
if ( (unsigned int)cocos2d::CCArray::count(v5) > 0x14 )
{
v29 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v5, 0x14u);
v16 = (const char *)cocos2d::CCString::getCString(v29);
}
else
{
v16 = &byte_11B8890;
}
v30 = (char *)v16;
v31 = 0;
v32 = 0;
v33 = nullptr;
v17 = strlen(v16);
std::string::__init(&v31, v30, v17);
v18 = v31 & 1;
if ( v18 )
{
v19 = v32;
if ( (unsigned __int64)(v32 - 1) > 0x12 )
{
*(_DWORD *)(a1 + 56) = v40;
v28 = HIDWORD(v40);
*(_QWORD *)(a1 + 48) = 0;
*(_DWORD *)(a1 + 60) = v28;
LABEL_31:
operator delete(v33);
return _stack_chk_guard;
}
v20 = (unsigned __int8 *)v33;
}
else
{
v24 = (int)(unsigned __int8)v31 >> 1;
if ( !v24 || (v19 = v24, v24 > 19) )
{
*(_DWORD *)(a1 + 56) = v40;
v27 = HIDWORD(v40);
*(_QWORD *)(a1 + 48) = 0;
*(_DWORD *)(a1 + 60) = v27;
return _stack_chk_guard;
}
v20 = (unsigned __int8 *)&v31 + 1;
}
v25 = (char *)&v20[v19];
if ( v20 == (unsigned __int8 *)v25 )
goto LABEL_15;
v26 = v20;
while ( 1 )
{
v21 = memchr("0123456789", *v26, 0xAu);
if ( !v21 )
break;
if ( v25 == (char *)++v26 )
goto LABEL_15;
}
if ( v26 - v20 == -1 )
{
LABEL_15:
v21 = (void *)std::stoull(&v31, 0, 10);
v18 = v31 & 1;
}
*(_QWORD *)(a1 + 48) = v21;
*(_QWORD *)(a1 + 56) = v40;
if ( v18 )
goto LABEL_31;
return _stack_chk_guard;
}