//
// FontObject::parseConfigFile from 0x686c2c to 0x687358 (1836 bytes)
//
// 2 xrefs:
// > FontObject::initWithConfigFile @ 0x687360
// > ??> @ 0x47200
//
// 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:50:31 +0000
//
__int64 __fastcall FontObject::parseConfigFile(FontObject *this, cocos2d::CCString *a2, float a3)
{
_QWORD *v3; // x19
cocos2d::CCString *v4; // x0
cocos2d::CCArray *CString; // x19
cocos2d::CCArray *v6; // x26
char *v7; // x0
size_t v8; // x0
cocos2d::CCObject *v9; // x0
unsigned int i; // w23
__int64 v11; // x0
cocos2d::CCString *v12; // x27
size_t v13; // x0
size_t v14; // x3
size_t v15; // x2
size_t v16; // x1
size_t v17; // x3
int v18; // w3
size_t v19; // x2
size_t v20; // x1
void *v22; // x28
char *v23; // x1
_BOOL4 v24; // w25
cocos2d::CCString *v25; // x3
char *v26; // x1
_BOOL4 v27; // w28
int v28; // w0
cocos2d::CCArray *v29; // x0
cocos2d::CCArray *v30; // x28
char *v31; // x0
char *v32; // x0
size_t v33; // x0
cocos2d::CCObject *v34; // x0
cocos2d::CCString *v35; // x0
const char *v36; // x0
size_t v37; // x0
__int64 v38; // x4
_BYTE *v39; // x3
_BYTE *v40; // x4
_BYTE *v41; // x1
int v42; // w3
int v43; // w0
int v44; // w27
cocos2d::CCString *v45; // x0
cocos2d::CCString *v46; // x0
unsigned __int8 *v47; // x0
unsigned __int8 *v48; // x1
unsigned __int8 *v49; // x2
int v50; // t1
unsigned __int8 *v51; // x1
unsigned __int8 *v52; // x2
int v53; // t1
char *v54; // [xsp+60h] [xbp+60h]
char *v55; // [xsp+68h] [xbp+68h]
int v56; // [xsp+74h] [xbp+74h]
cocos2d::CCString *v58; // [xsp+88h] [xbp+88h]
cocos2d::CCString *v59; // [xsp+88h] [xbp+88h]
cocos2d::CCString *v60; // [xsp+88h] [xbp+88h]
cocos2d::CCString *v61; // [xsp+88h] [xbp+88h]
cocos2d::CCString *v62; // [xsp+88h] [xbp+88h]
cocos2d::CCString *v63; // [xsp+88h] [xbp+88h]
int v64; // [xsp+88h] [xbp+88h]
int v65; // [xsp+94h] [xbp+94h] BYREF
__int64 v66; // [xsp+98h] [xbp+98h] BYREF
size_t v67; // [xsp+A0h] [xbp+A0h]
void *v68; // [xsp+A8h] [xbp+A8h]
__int64 v69; // [xsp+B0h] [xbp+B0h] BYREF
size_t v70; // [xsp+B8h] [xbp+B8h]
void *v71; // [xsp+C0h] [xbp+C0h]
__int64 v72[2]; // [xsp+C8h] [xbp+C8h] BYREF
void *v73; // [xsp+D8h] [xbp+D8h]
__int64 v74[2]; // [xsp+E0h] [xbp+E0h] BYREF
void *v75; // [xsp+F0h] [xbp+F0h]
__int64 v76; // [xsp+F8h] [xbp+F8h] BYREF
__int64 v77; // [xsp+100h] [xbp+100h]
void *v78; // [xsp+108h] [xbp+108h]
__int64 v79; // [xsp+110h] [xbp+110h] BYREF
__int64 v80; // [xsp+118h] [xbp+118h]
void *v81; // [xsp+120h] [xbp+120h]
v3 = (_QWORD *)((char *)this + 96);
v55 = (char *)this + 96;
v54 = (char *)this + 56;
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::clear((_QWORD *)this + 7);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::clear(v3);
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithContentsOfFile(a2, (const char *)a2);
CString = (cocos2d::CCArray *)cocos2d::CCString::getCString(v4);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(CString);
if ( strtok((char *)CString, &byte_11AAA48) )
{
while ( 1 )
{
v7 = strtok(nullptr, &byte_11AAA48);
v58 = (cocos2d::CCString *)v7;
if ( !v7 )
break;
while ( 1 )
{
v79 = 0;
v80 = 0;
v81 = nullptr;
v8 = strlen(v7);
std::string::__init(&v79, v58, v8);
v9 = (cocos2d::CCObject *)cocos2d::CCString::create(&v79);
cocos2d::CCArray::addObject(v6, v9);
if ( (v79 & 1) == 0 )
break;
operator delete(v81);
v7 = strtok(nullptr, &byte_11AAA48);
v58 = (cocos2d::CCString *)v7;
if ( !v7 )
goto LABEL_5;
}
}
}
LABEL_5:
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v6); ++i )
{
v11 = cocos2d::CCArray::objectAtIndex(v6, i);
v66 = 0;
v12 = (cocos2d::CCString *)v11;
v67 = 0;
v68 = nullptr;
std::string::__init(&v66, "chars", 5u);
v69 = 0;
v70 = 0;
v71 = nullptr;
std::string::__init(&v69, "char", 4u);
v59 = (cocos2d::CCString *)cocos2d::CCString::getCString(v12);
v72[0] = 0;
v72[1] = 0;
v73 = nullptr;
v13 = strlen((const char *)v59);
std::string::__init(v72, v59, v13);
v14 = (unsigned __int8)v66 >> 1;
if ( (v66 & 1) != 0 )
v14 = v67;
std::string::basic_string(v74, (__int64)v72, 0, v14);
v15 = LOBYTE(v74[0]) >> 1;
if ( (v74[0] & 1) != 0 )
v15 = v74[1];
v16 = (unsigned __int8)v66 >> 1;
if ( (v66 & 1) != 0 )
v16 = v67;
if ( v15 == v16 )
{
if ( (v74[0] & 1) == 0 )
{
v47 = (unsigned __int8 *)&v66 + 1;
if ( (v66 & 1) != 0 )
v47 = (unsigned __int8 *)v68;
if ( !v15 )
goto LABEL_22;
if ( BYTE1(v74[0]) == *v47 )
{
v48 = (unsigned __int8 *)v74 + 2;
v49 = (unsigned __int8 *)v74 + v15 + 1;
while ( 1 )
{
++v47;
if ( v48 == v49 )
goto LABEL_22;
v50 = *v48++;
if ( *v47 != v50 )
goto LABEL_14;
}
}
goto LABEL_14;
}
if ( (v66 & 1) != 0 )
{
v23 = (char *)v68;
v22 = v75;
}
else
{
v22 = v75;
v23 = (char *)&v66 + 1;
}
v24 = 1;
if ( v15 )
v24 = memcmp(v75, v23, v15) == 0;
}
else
{
if ( (v74[0] & 1) == 0 )
goto LABEL_14;
v22 = v75;
v24 = 0;
}
operator delete(v22);
if ( v24 )
goto LABEL_22;
LABEL_14:
v17 = (unsigned __int8)v69 >> 1;
if ( (v69 & 1) != 0 )
v17 = v70;
std::string::basic_string(&v76, (__int64)v72, 0, v17);
v18 = v76 & 1;
v19 = (unsigned __int8)v76 >> 1;
if ( v18 )
v19 = v77;
v20 = (unsigned __int8)v69 >> 1;
if ( (v69 & 1) != 0 )
v20 = v70;
if ( v19 != v20 )
{
if ( !v18 )
goto LABEL_22;
v25 = (cocos2d::CCString *)v78;
v27 = 0;
goto LABEL_43;
}
if ( v18 )
{
if ( (v69 & 1) != 0 )
{
v26 = (char *)v71;
v25 = (cocos2d::CCString *)v78;
}
else
{
v25 = (cocos2d::CCString *)v78;
v26 = (char *)&v69 + 1;
}
v27 = 1;
if ( v19 )
{
v60 = v25;
v28 = memcmp(v78, v26, v19);
v25 = v60;
v27 = v28 == 0;
}
LABEL_43:
operator delete(v25);
if ( v27 )
goto LABEL_44;
goto LABEL_22;
}
v29 = (cocos2d::CCArray *)((char *)&v69 + 1);
if ( (v69 & 1) != 0 )
v29 = (cocos2d::CCArray *)v71;
if ( !v19 )
goto LABEL_44;
if ( BYTE1(v76) == *(unsigned __int8 *)v29 )
{
v51 = (unsigned __int8 *)&v76 + 2;
v52 = (unsigned __int8 *)&v76 + v19 + 1;
while ( 1 )
{
v29 = (cocos2d::CCArray *)((char *)v29 + 1);
if ( v51 == v52 )
break;
v53 = *v51++;
if ( *(unsigned __int8 *)v29 != v53 )
goto LABEL_22;
}
LABEL_44:
v30 = (cocos2d::CCArray *)cocos2d::CCArray::create(v29);
v31 = (char *)cocos2d::CCString::getCString(v12);
if ( strtok(v31, "=") )
{
while ( 1 )
{
v32 = strtok(nullptr, "=");
v61 = (cocos2d::CCString *)v32;
if ( !v32 )
break;
while ( 1 )
{
v79 = 0;
v80 = 0;
v81 = nullptr;
v33 = strlen(v32);
std::string::__init(&v79, v61, v33);
v34 = (cocos2d::CCObject *)cocos2d::CCString::create(&v79);
cocos2d::CCArray::addObject(v30, v34);
if ( (v79 & 1) == 0 )
break;
operator delete(v81);
v32 = strtok(nullptr, "=");
v61 = (cocos2d::CCString *)v32;
if ( !v32 )
goto LABEL_48;
}
}
}
LABEL_48:
v35 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v30, 0);
v36 = (const char *)cocos2d::CCString::getCString(v35);
v76 = 0;
v77 = 0;
v78 = nullptr;
v62 = (cocos2d::CCString *)v36;
v37 = strlen(v36);
std::string::__init(&v76, v62, v37);
if ( (v76 & 1) != 0 )
{
v38 = v77;
v39 = v78;
if ( v77 )
{
if ( v77 > 0 )
goto LABEL_51;
v42 = -1;
LABEL_65:
v43 = v77;
LABEL_55:
std::string::basic_string(&v79, (__int64)&v76, 0, v43 - v42 + 1);
if ( (v79 & 1) != 0 )
{
v63 = (cocos2d::CCString *)v81;
v44 = atoi((const char *)v81);
if ( v44 < 0 )
{
operator delete(v63);
}
else
{
LABEL_57:
v45 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v30, 3u);
v56 = cocos2d::CCString::intValue(v45);
v46 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v30, 7u);
v64 = cocos2d::CCString::intValue(v46);
v65 = v44;
*(_DWORD *)std::unordered_map::operator[]((__int64)v54, (unsigned int *)&v65) = v56 + v64;
v65 = v44;
*(_DWORD *)std::unordered_map::operator[]((__int64)v55, (unsigned int *)&v65) = v64;
if ( (v79 & 1) != 0 )
operator delete(v81);
}
}
else
{
v44 = atoi((const char *)&v79 + 1);
if ( (v44 & 0x80000000) == 0 )
goto LABEL_57;
}
if ( (v76 & 1) != 0 )
operator delete(v78);
goto LABEL_22;
}
LABEL_79:
v42 = -1;
v43 = 0;
goto LABEL_55;
}
v39 = (char *)&v76 + 1;
v38 = (int)(unsigned __int8)v76 >> 1;
if ( !((int)(unsigned __int8)v76 >> 1) )
goto LABEL_79;
LABEL_51:
v40 = &v39[v38];
if ( v40 != v39 )
{
v41 = v39;
if ( *v39 == 32 )
{
LABEL_53:
v42 = (_DWORD)v41 - (_DWORD)v39;
goto LABEL_54;
}
while ( v40 != ++v41 )
{
if ( *v41 == 32 )
goto LABEL_53;
}
}
v42 = -1;
LABEL_54:
v43 = (unsigned __int8)v76 >> 1;
if ( (v76 & 1) != 0 )
goto LABEL_65;
goto LABEL_55;
}
LABEL_22:
if ( (v72[0] & 1) != 0 )
operator delete(v73);
if ( (v69 & 1) != 0 )
operator delete(v71);
if ( (v66 & 1) != 0 )
operator delete(v68);
}
cocos2d::CCObject::release(v6);
return _stack_chk_guard;
}