//
// cocos2d::CCBMFontConfiguration::parseCommonArguments from 0xd57dbc to 0xd58190 (980 bytes)
//
// 2 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0xd593f4
// > ??> @ 0x50d88
//
// 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 13:07:44 +0000
//
__int64 __fastcall cocos2d::CCBMFontConfiguration::parseCommonArguments(__int64 a1, __int64 a2)
{
__int64 v4; // x21
unsigned __int64 v5; // x20
__int64 v6; // x20
__int64 v7; // x0
int v8; // w24
unsigned __int64 v9; // x21
int v10; // w0
char *v11; // x0
__int64 v12; // x24
unsigned __int64 v13; // x0
unsigned __int64 v14; // x21
__int64 v15; // x0
int v16; // w21
unsigned __int64 v17; // x24
int v18; // w0
cocos2d::CCConfiguration *v19; // x0
__int64 v20; // x24
unsigned __int64 v21; // x0
unsigned __int64 v22; // x21
__int64 v23; // x0
int v24; // w21
unsigned __int64 v25; // x24
int v26; // w0
cocos2d::CCConfiguration *v27; // x0
__int64 v28; // x24
unsigned __int64 v29; // x0
unsigned __int64 v30; // x21
__int64 v31; // x0
int v32; // w21
unsigned __int64 v33; // x24
int v34; // w0
cocos2d::CCConfiguration *v36; // [xsp+48h] [xbp+48h] BYREF
__int64 v37; // [xsp+50h] [xbp+50h]
char *s; // [xsp+58h] [xbp+58h]
cocos2d::CCConfiguration *v39; // [xsp+60h] [xbp+60h] BYREF
__int64 v40; // [xsp+68h] [xbp+68h]
void *v41; // [xsp+70h] [xbp+70h]
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v4 = *(_QWORD *)(a2 + 16);
v5 = *(_QWORD *)(a2 + 8);
}
else
{
v4 = a2 + 1;
v5 = *(_BYTE *)a2 >> 1;
}
if ( v5 <= 0xA
|| (v6 = v4 + v5,
v7 = std::__search(
v4,
v6,
"lineHeight=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v6 == v7) )
{
v9 = -1;
v8 = -1;
}
else
{
v8 = v7 - v4;
v9 = (int)v7 - (int)v4;
}
v10 = std::string::find(a2, 0x20u, v9);
std::string::basic_string((__int64 *)&v36, a2, v9, v10 - v8);
v11 = (char *)&v36 + 1;
if ( ((unsigned __int8)v36 & 1) != 0 )
v11 = s;
sscanf(v11, "lineHeight=%d", a1 + 64);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v12 = *(_QWORD *)(a2 + 16);
v13 = *(_QWORD *)(a2 + 8);
}
else
{
v12 = a2 + 1;
v13 = *(_BYTE *)a2 >> 1;
}
if ( v13 <= 6
|| (v14 = v12 + v13,
v15 = std::__search(
v12,
v12 + v13,
"scaleW=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v14 == v15) )
{
v17 = 6;
v16 = 6;
}
else
{
v16 = v15 - v12 + 7;
v17 = v16;
}
v18 = std::string::find(a2, 0x20u, v17);
std::string::basic_string((__int64 *)&v39, a2, v17, v18 - v16);
if ( ((unsigned __int8)v36 & 1) != 0 )
{
*s = 0;
v37 = 0;
}
else
{
LOWORD(v36) = 0;
}
std::string::reserve((__int64 *)&v36, 0);
s = (char *)v41;
v36 = v39;
v37 = v40;
v19 = (cocos2d::CCConfiguration *)cocos2d::CCConfiguration::sharedConfiguration(v39);
cocos2d::CCConfiguration::getMaxTextureSize(v19);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v20 = *(_QWORD *)(a2 + 16);
v21 = *(_QWORD *)(a2 + 8);
}
else
{
v20 = a2 + 1;
v21 = *(_BYTE *)a2 >> 1;
}
if ( v21 <= 6
|| (v22 = v20 + v21,
v23 = std::__search(
v20,
v20 + v21,
"scaleH=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v22 == v23) )
{
v25 = 6;
v24 = 6;
}
else
{
v24 = v23 - v20 + 7;
v25 = v24;
}
v26 = std::string::find(a2, 0x20u, v25);
std::string::basic_string((__int64 *)&v39, a2, v25, v26 - v24);
if ( ((unsigned __int8)v36 & 1) != 0 )
{
*s = 0;
v37 = 0;
}
else
{
LOWORD(v36) = 0;
}
std::string::reserve((__int64 *)&v36, 0);
s = (char *)v41;
v36 = v39;
v37 = v40;
v27 = (cocos2d::CCConfiguration *)cocos2d::CCConfiguration::sharedConfiguration(v39);
cocos2d::CCConfiguration::getMaxTextureSize(v27);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v28 = *(_QWORD *)(a2 + 16);
v29 = *(_QWORD *)(a2 + 8);
}
else
{
v28 = a2 + 1;
v29 = *(_BYTE *)a2 >> 1;
}
if ( v29 <= 5
|| (v30 = v28 + v29,
v31 = std::__search(
v28,
v28 + v29,
"pages=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v30 == v31) )
{
v33 = 5;
v32 = 5;
}
else
{
v32 = v31 - v28 + 6;
v33 = v32;
}
v34 = std::string::find(a2, 0x20u, v33);
std::string::basic_string((__int64 *)&v39, a2, v33, v34 - v32);
if ( ((unsigned __int8)v36 & 1) != 0 )
{
*s = 0;
v37 = 0;
}
else
{
LOWORD(v36) = 0;
}
std::string::reserve((__int64 *)&v36, 0);
v36 = v39;
v37 = v40;
s = (char *)v41;
if ( ((unsigned __int8)v39 & 1) != 0 )
operator delete(v41);
return _stack_chk_guard;
}