//
// FontObject::parseConfigFile from 0x2e0988 to 0x2e0be8 (608 bytes)
//
// 1 xrefs:
// > FontObject::initWithConfigFile @ 0x2e0c0a
//
// 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
//
void FontObject::parseConfigFile(FontObject *a1, const char *a2, float a3)
{
cocos2d::CCString *v3; // r0
cocos2d::CCArray *CString; // r5
cocos2d::CCArray *v5; // r7
char *v6; // r5
const std::string *v7; // r1
cocos2d::CCObject *v8; // r0
unsigned int v9; // r8
cocos2d::CCString *v10; // r10
char *v11; // r0
size_t v12; // r2
_BOOL4 v13; // r5
size_t v14; // r2
cocos2d::CCArray *v15; // r0
cocos2d::CCArray *v16; // r5
char *v17; // r0
char *v18; // r10
const std::string *v19; // r1
cocos2d::CCObject *v20; // r0
cocos2d::CCString *v21; // r0
char *v22; // r0
int v23; // r0
int v24; // r0
int v25; // r10
cocos2d::CCString *v26; // r0
int v27; // r11
cocos2d::CCString *v28; // r0
void *v30; // [sp+24h] [bp-20h] BYREF
void *v31; // [sp+28h] [bp-1Ch] BYREF
_BYTE v32[4]; // [sp+2Ch] [bp-18h] BYREF
void *v33; // [sp+30h] [bp-14h] BYREF
void *v34; // [sp+34h] [bp-10h] BYREF
char *v35; // [sp+38h] [bp-Ch] BYREF
v3 = cocos2d::CCString::createWithContentsOfFile(a2);
CString = (cocos2d::CCArray *)cocos2d::CCString::getCString(v3);
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(CString);
v6 = strtok((char *)CString, "\n");
while ( v6 )
{
v6 = strtok(nullptr, "\n");
if ( !v6 )
break;
sub_776584((int)&v35, v6);
v8 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v35, v7);
cocos2d::CCArray::addObject(v5, v8);
sub_774008(&v35);
}
v9 = 0;
while ( v9 < cocos2d::CCArray::count(v5) )
{
v10 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v5, v9);
sub_776584((int)&v30, "chars");
sub_776584((int)&v31, "char");
v11 = (char *)cocos2d::CCString::getCString(v10);
sub_776584((int)v32, v11);
sub_776158(&v33, v32, 0, *((_DWORD *)v30 - 3));
v12 = *((_DWORD *)v33 - 3);
v13 = v12 == *((_DWORD *)v30 - 3) && memcmp(v33, v30, v12) == 0;
sub_774008(&v33);
if ( !v13 )
{
sub_776158(&v34, v32, 0, *((_DWORD *)v31 - 3));
v14 = *((_DWORD *)v34 - 3);
if ( v14 == *((_DWORD *)v31 - 3) )
v13 = memcmp(v34, v31, v14) == 0;
v15 = (cocos2d::CCArray *)sub_774008(&v34);
if ( v13 )
{
v16 = (cocos2d::CCArray *)cocos2d::CCArray::create(v15);
v17 = (char *)cocos2d::CCString::getCString(v10);
v18 = strtok(v17, "=");
while ( v18 )
{
v18 = strtok(nullptr, "=");
if ( !v18 )
break;
sub_776584((int)&v35, v18);
v20 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v35, v19);
cocos2d::CCArray::addObject(v16, v20);
sub_774008(&v35);
}
v21 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v16, 0);
v22 = (char *)cocos2d::CCString::getCString(v21);
sub_776584((int)&v34, v22);
v23 = sub_7748A0((int)&v34, " ");
sub_776158(&v35, &v34, 0, *((_DWORD *)v34 - 3) + 1 - v23);
v24 = atoi(v35);
if ( v24 >= 300 )
v25 = 0;
else
v25 = v24;
v26 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v16, 3u);
v27 = cocos2d::CCString::intValue(v26);
v28 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v16, 7u);
a1->m_fontWidths.__elems_[v25] = cocos2d::CCString::intValue(v28) + v27;
sub_774008(&v35);
sub_774008(&v34);
}
}
++v9;
sub_774008(v32);
sub_774008(&v31);
sub_774008(&v30);
}
cocos2d::CCObject::release(v5);
}