//
// cocos2d::CCBMFontConfiguration::parseCommonArguments from 0x1003966bc to 0x100396a64 (936 bytes)
//
// 1 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x100395de0
//
// 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 11:03:41 +0000
//
void __fastcall cocos2d::CCBMFontConfiguration::parseCommonArguments(__int64 a1, const std::string *__s)
{
__int64 size; // x8
const std::string *v5; // x21
char *v6; // x22
std::string *v7; // x0
char *v8; // x0
int v10; // w8
std::string::size_type v11; // x21
int v12; // w0
std::string *v13; // x0
__int64 v14; // x8
const std::string *v15; // x20
char *v16; // x21
std::string *v17; // x0
char *v18; // x0
int v20; // w21
int v21; // w0
std::string *v22; // x0
__int64 v23; // x0
__int64 v24; // x8
const std::string *v25; // x20
char *v26; // x21
std::string *v27; // x0
char *v28; // x0
int v30; // w21
int v31; // w0
std::string *v32; // x0
__int64 v33; // x0
__int64 v34; // x8
const std::string *v35; // x20
char *v36; // x21
std::string *v37; // x0
char *v38; // x0
int v40; // w21
int v41; // w0
std::string __a; // [xsp+8h] [xbp-68h] BYREF
std::string v43; // [xsp+20h] [xbp-50h] BYREF
std::allocator v44; // [xsp+3Fh] [xbp-31h] BYREF
size = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( size < 0 )
{
v5 = (const std::string *)__s->__r_.__value_.__r.__words[0];
size = __s->__r_.__value_.__l.__size_;
}
else
{
v5 = __s;
}
v6 = (char *)v5 + size;
if ( size >= 11 )
{
v7 = (std::string *)v5;
do
{
v8 = (char *)memchr(v7, 108, size - 10);
if ( !v8 )
break;
if ( *(_QWORD *)v8 == 0x67696548656E696CLL && *(_QWORD *)(v8 + 3) == 0x3D74686769654865LL )
goto LABEL_13;
v7 = (std::string *)(v8 + 1);
size = v6 - (char *)v7;
}
while ( v6 - (char *)v7 > 10 );
}
v8 = v6;
LABEL_13:
v10 = (_DWORD)v8 - (_DWORD)v5;
if ( v8 == v6 )
v10 = -1;
v11 = v10;
v12 = std::string::find(__s, 32, v10);
std::string::basic_string(&v43, __s, v11, v12 - (int)v11, (std::allocator *)&__a);
if ( (v43.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &v43;
else
v13 = (std::string *)v43.__r_.__value_.__r.__words[0];
sscanf((const char *)v13, "lineHeight=%d", a1 + 64);
v14 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v14 < 0 )
{
v15 = (const std::string *)__s->__r_.__value_.__r.__words[0];
v14 = __s->__r_.__value_.__l.__size_;
}
else
{
v15 = __s;
}
v16 = (char *)v15 + v14;
if ( v14 >= 7 )
{
v17 = (std::string *)v15;
do
{
v18 = (char *)memchr(v17, 115, v14 - 6);
if ( !v18 )
break;
if ( *(_DWORD *)v18 == 1818321779 && *(_DWORD *)(v18 + 3) == 1029137772 )
goto LABEL_30;
v17 = (std::string *)(v18 + 1);
v14 = v16 - (char *)v17;
}
while ( v16 - (char *)v17 > 6 );
}
v18 = v16;
LABEL_30:
if ( v18 == v16 )
v20 = 6;
else
v20 = (_DWORD)v18 - (_DWORD)v15 + 7;
v21 = std::string::find(__s, 32, v20);
v22 = std::string::basic_string(&__a, __s, v20, v21 - v20, &v44);
if ( SHIBYTE(v43.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v43.__r_.__value_.__l.__data_);
v43 = __a;
v23 = cocos2d::CCConfiguration::sharedConfiguration(v22);
cocos2d::CCConfiguration::getMaxTextureSize(v23);
v24 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v24 < 0 )
{
v25 = (const std::string *)__s->__r_.__value_.__r.__words[0];
v24 = __s->__r_.__value_.__l.__size_;
}
else
{
v25 = __s;
}
v26 = (char *)v25 + v24;
if ( v24 >= 7 )
{
v27 = (std::string *)v25;
do
{
v28 = (char *)memchr(v27, 115, v24 - 6);
if ( !v28 )
break;
if ( *(_DWORD *)v28 == 1818321779 && *(_DWORD *)(v28 + 3) == 1028154732 )
goto LABEL_47;
v27 = (std::string *)(v28 + 1);
v24 = v26 - (char *)v27;
}
while ( v26 - (char *)v27 > 6 );
}
v28 = v26;
LABEL_47:
if ( v28 == v26 )
v30 = 6;
else
v30 = (_DWORD)v28 - (_DWORD)v25 + 7;
v31 = std::string::find(__s, 32, v30);
v32 = std::string::basic_string(&__a, __s, v30, v31 - v30, &v44);
if ( SHIBYTE(v43.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v43.__r_.__value_.__l.__data_);
v43 = __a;
v33 = cocos2d::CCConfiguration::sharedConfiguration(v32);
cocos2d::CCConfiguration::getMaxTextureSize(v33);
v34 = SHIBYTE(__s->__r_.__value_.__r.__words[2]);
if ( v34 < 0 )
{
v35 = (const std::string *)__s->__r_.__value_.__r.__words[0];
v34 = __s->__r_.__value_.__l.__size_;
}
else
{
v35 = __s;
}
v36 = (char *)v35 + v34;
if ( v34 >= 6 )
{
v37 = (std::string *)v35;
do
{
v38 = (char *)memchr(v37, 112, v34 - 5);
if ( !v38 )
break;
if ( *(_DWORD *)v38 == 1701273968 && *((_WORD *)v38 + 2) == 15731 )
goto LABEL_64;
v37 = (std::string *)(v38 + 1);
v34 = v36 - (char *)v37;
}
while ( v36 - (char *)v37 > 5 );
}
v38 = v36;
LABEL_64:
if ( v38 == v36 )
v40 = 5;
else
v40 = (_DWORD)v38 - (_DWORD)v35 + 6;
v41 = std::string::find(__s, 32, v40);
std::string::basic_string(&__a, __s, v40, v41 - v40, &v44);
if ( SHIBYTE(v43.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v43.__r_.__value_.__l.__data_);
v43 = __a;
if ( SHIBYTE(__a.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v43.__r_.__value_.__l.__data_);
}