//
// EditorBuildStats::fromString from 0x140266bc0 to 0x140267006 (1094 bytes)
//
// 2 xrefs:
// > GJGameLevel::dataLoaded @ 0x140268b78
// > ??> @ 0x14091c9b8
//
// 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 11:28:50 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall EditorBuildStats::fromString(__int64 a1, _QWORD *a2)
{
size_t v3; // rbx
size_t v4; // r8
cocos2d::CCArray *v5; // r14
void *v6; // rcx
cocos2d::CCString *v7; // rax
const char *CString; // rax
__int64 v9; // rsi
signed int v10; // edi
cocos2d::CCString *v11; // rax
const char *v12; // rax
cocos2d::CCString *v13; // rax
char *v14; // rax
unsigned __int64 v15; // r14
char *v16; // rbx
char **v17; // rdi
char **v18; // rsi
char *v19; // rcx
unsigned __int8 *v20; // rcx
int *v21; // rax
int *v22; // rdi
const char *v23; // rbx
unsigned __int64 v24; // rax
char *v25; // rax
__int128 v26; // [rsp+30h] [rbp-D0h]
__int128 v27; // [rsp+40h] [rbp-C0h]
__int128 v28; // [rsp+50h] [rbp-B0h]
__int128 v29; // [rsp+60h] [rbp-A0h]
__int128 v30; // [rsp+70h] [rbp-90h]
__int64 v31; // [rsp+80h] [rbp-80h]
char *EndPtr; // [rsp+90h] [rbp-70h] BYREF
_BYTE v33[256]; // [rsp+A0h] [rbp-60h] BYREF
char *String[2]; // [rsp+1A0h] [rbp+A0h] BYREF
__int64 v35; // [rsp+1B0h] [rbp+B0h]
unsigned __int64 v36; // [rsp+1B8h] [rbp+B8h]
void *Block[2]; // [rsp+1C0h] [rbp+C0h] BYREF
__m128i si128; // [rsp+1D0h] [rbp+D0h]
if ( a2[3] > 0xFu )
a2 = (_QWORD *)*a2;
*(_OWORD *)Block = 0;
si128 = 0;
v3 = -1;
v4 = -1;
do
++v4;
while ( *((_BYTE *)a2 + v4) );
sub_14003D230(Block, a2, v4);
v5 = sub_1400D2840((__int64 *)Block, byte_14070ECF8);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( cocos2d::CCArray::count(v5) )
{
v7 = cocos2d::CCArray::stringAtIndex(v5, 0);
CString = cocos2d::CCString::getCString(v7);
if ( atoi(CString) >= 1 )
{
v26 = 0;
v27 = 0;
v28 = 0;
v29 = 0;
v30 = 0;
v31 = 0;
v9 = 0;
v10 = 1;
do
{
if ( v10 >= (int)cocos2d::CCArray::count(v5) )
break;
v11 = cocos2d::CCArray::stringAtIndex(v5, v10);
v12 = cocos2d::CCString::getCString(v11);
*((_DWORD *)&v26 + v9) = atoi(v12);
++v10;
++v9;
}
while ( v9 < 22 );
*(_OWORD *)a1 = v26;
*(_QWORD *)(a1 + 16) = v27;
*(_DWORD *)(a1 + 24) = DWORD2(v27);
*(float *)(a1 + 28) = (float)SHIDWORD(v27);
*(_DWORD *)(a1 + 32) = v28;
*(_QWORD *)(a1 + 64) = *(_QWORD *)((char *)&v28 + 4);
*(_DWORD *)(a1 + 72) = HIDWORD(v28);
*(_OWORD *)(a1 + 76) = v29;
*(_DWORD *)(a1 + 92) = v30;
*(_QWORD *)(a1 + 36) = *(_QWORD *)((char *)&v30 + 4);
if ( cocos2d::CCArray::count(v5) <= 0x14 )
{
v14 = &byte_1406ED6E0;
}
else
{
v13 = cocos2d::CCArray::stringAtIndex(v5, 0x14u);
v14 = (char *)cocos2d::CCString::getCString(v13);
}
*(_OWORD *)String = 0;
v35 = 0;
v36 = 0;
do
++v3;
while ( v14[v3] );
sub_14003D230(String, v14, v3);
v15 = v36;
v16 = String[0];
if ( (unsigned __int64)(v35 - 1) > 0x12 )
goto LABEL_37;
v17 = String;
if ( v36 > 0xF )
v17 = (char **)String[0];
v18 = (char **)((char *)v17 + v35);
memset(v33, 0, sizeof(v33));
v19 = "0123456789";
do
v33[(unsigned __int8)*v19++] = 1;
while ( v19 != "" );
v20 = (unsigned __int8 *)v17;
if ( v17 >= v18 )
goto LABEL_30;
while ( v33[*v20] )
{
if ( ++v20 >= (unsigned __int8 *)v18 )
goto LABEL_30;
}
if ( v20 - (unsigned __int8 *)v17 == -1 )
{
LABEL_30:
v21 = errno();
v22 = v21;
v23 = (const char *)String;
if ( v36 > 0xF )
v23 = String[0];
*v21 = 0;
v24 = strtoull(v23, &EndPtr, 10);
if ( v23 == EndPtr )
{
std::_Xinvalid_argument("invalid stoull argument");
__debugbreak();
}
if ( *v22 == 34 )
{
std::_Xout_of_range("stoull argument out of range");
__debugbreak();
}
v15 = v36;
v16 = String[0];
}
else
{
LABEL_37:
v24 = 0;
}
*(_QWORD *)(a1 + 48) = v24;
*(_QWORD *)(a1 + 56) = v31;
if ( v15 > 0xF )
{
v25 = v16;
if ( v15 + 1 >= 0x1000 )
{
v16 = *((char **)v16 - 1);
if ( (unsigned __int64)(v25 - v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
}
}
}