//
// cocos2d::CCBMFontConfiguration::parseCharacterDefinition from 0xd58190 to 0xd589c8 (2104 bytes)
//
// 2 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0xd597c8
// > ??> @ 0xe9aa0
//
// 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:45 +0000
//
__int64 __fastcall cocos2d::CCBMFontConfiguration::parseCharacterDefinition(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v5; // x22
unsigned __int64 v6; // x20
__int64 v7; // x20
__int64 v8; // x0
int v9; // w23
unsigned __int64 v10; // x22
int v11; // w0
char *v12; // x0
__int64 v13; // x23
unsigned __int64 v14; // x22
__int64 v15; // x22
__int64 v16; // x0
int v17; // w25
unsigned __int64 v18; // x23
int v19; // w0
const char *v20; // x0
__int64 v21; // x25
unsigned __int64 v22; // x0
unsigned __int64 v23; // x23
__int64 v24; // x0
int v25; // w25
unsigned __int64 v26; // x23
int v27; // w0
const char *v28; // x0
__int64 v29; // x25
unsigned __int64 v30; // x0
unsigned __int64 v31; // x23
__int64 v32; // x0
int v33; // w25
unsigned __int64 v34; // x23
int v35; // w0
const char *v36; // x0
__int64 v37; // x25
unsigned __int64 v38; // x0
unsigned __int64 v39; // x23
__int64 v40; // x0
int v41; // w25
unsigned __int64 v42; // x23
int v43; // w0
const char *v44; // x0
__int64 v45; // x25
unsigned __int64 v46; // x0
unsigned __int64 v47; // x23
__int64 v48; // x0
int v49; // w25
unsigned __int64 v50; // x23
int v51; // w0
const char *v52; // x0
__int64 v53; // x25
unsigned __int64 v54; // x0
unsigned __int64 v55; // x23
__int64 v56; // x0
int v57; // w25
unsigned __int64 v58; // x23
int v59; // w0
const char *v60; // x0
__int64 v61; // x25
unsigned __int64 v62; // x0
unsigned __int64 v63; // x23
__int64 v64; // x0
int v65; // w25
unsigned __int64 v66; // x23
int v67; // w0
const char *v68; // x0
__int64 v70; // [xsp+58h] [xbp+58h] BYREF
__int64 v71; // [xsp+60h] [xbp+60h]
char *s; // [xsp+68h] [xbp+68h]
__int64 v73; // [xsp+70h] [xbp+70h] BYREF
__int64 v74; // [xsp+78h] [xbp+78h]
char *v75; // [xsp+80h] [xbp+80h]
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v5 = *(_QWORD *)(a2 + 16);
v6 = *(_QWORD *)(a2 + 8);
}
else
{
v5 = a2 + 1;
v6 = *(_BYTE *)a2 >> 1;
}
if ( v6 <= 2
|| (v7 = v5 + v6,
v8 = std::__search(
v5,
v7,
"id=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v7 == v8) )
{
v10 = -1;
v9 = -1;
}
else
{
v9 = v8 - v5;
v10 = (int)v8 - (int)v5;
}
v11 = std::string::find(a2, 0x20u, v10);
std::string::basic_string(&v70, a2, v10, v11 - v9);
v12 = (char *)&v70 + 1;
if ( (v70 & 1) != 0 )
v12 = s;
sscanf(v12, "id=%u", a3);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v13 = *(_QWORD *)(a2 + 16);
v14 = *(_QWORD *)(a2 + 8);
}
else
{
v13 = a2 + 1;
v14 = *(_BYTE *)a2 >> 1;
}
if ( v14 <= 1
|| (v15 = v13 + v14,
v16 = std::__search(
v13,
v15,
"x=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v15 == v16) )
{
v18 = -1;
v17 = -1;
}
else
{
v17 = v16 - v13;
v18 = (int)v16 - (int)v13;
}
v19 = std::string::find(a2, 0x20u, v18);
std::string::basic_string(&v73, a2, v18, v19 - v17);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v20 = v75;
else
v20 = (char *)&v70 + 1;
s = v75;
sscanf(v20, "x=%f", a3 + 4);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v21 = *(_QWORD *)(a2 + 16);
v22 = *(_QWORD *)(a2 + 8);
}
else
{
v21 = a2 + 1;
v22 = *(_BYTE *)a2 >> 1;
}
if ( v22 <= 1
|| (v23 = v21 + v22,
v24 = std::__search(
v21,
v21 + v22,
"y=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v23 == v24) )
{
v26 = -1;
v25 = -1;
}
else
{
v25 = v24 - v21;
v26 = v25;
}
v27 = std::string::find(a2, 0x20u, v26);
std::string::basic_string(&v73, a2, v26, v27 - v25);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v28 = v75;
else
v28 = (char *)&v70 + 1;
s = v75;
sscanf(v28, "y=%f", a3 + 8);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v29 = *(_QWORD *)(a2 + 16);
v30 = *(_QWORD *)(a2 + 8);
}
else
{
v29 = a2 + 1;
v30 = *(_BYTE *)a2 >> 1;
}
if ( v30 <= 5
|| (v31 = v29 + v30,
v32 = std::__search(
v29,
v29 + v30,
"width=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v31 == v32) )
{
v34 = -1;
v33 = -1;
}
else
{
v33 = v32 - v29;
v34 = v33;
}
v35 = std::string::find(a2, 0x20u, v34);
std::string::basic_string(&v73, a2, v34, v35 - v33);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v36 = v75;
else
v36 = (char *)&v70 + 1;
s = v75;
sscanf(v36, "width=%f", a3 + 12);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v37 = *(_QWORD *)(a2 + 16);
v38 = *(_QWORD *)(a2 + 8);
}
else
{
v37 = a2 + 1;
v38 = *(_BYTE *)a2 >> 1;
}
if ( v38 <= 6
|| (v39 = v37 + v38,
v40 = std::__search(
v37,
v37 + v38,
"height=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v39 == v40) )
{
v42 = -1;
v41 = -1;
}
else
{
v41 = v40 - v37;
v42 = v41;
}
v43 = std::string::find(a2, 0x20u, v42);
std::string::basic_string(&v73, a2, v42, v43 - v41);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v44 = v75;
else
v44 = (char *)&v70 + 1;
s = v75;
sscanf(v44, "height=%f", a3 + 16);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v45 = *(_QWORD *)(a2 + 16);
v46 = *(_QWORD *)(a2 + 8);
}
else
{
v45 = a2 + 1;
v46 = *(_BYTE *)a2 >> 1;
}
if ( v46 <= 7
|| (v47 = v45 + v46,
v48 = std::__search(
v45,
v45 + v46,
"xoffset=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v47 == v48) )
{
v50 = -1;
v49 = -1;
}
else
{
v49 = v48 - v45;
v50 = v49;
}
v51 = std::string::find(a2, 0x20u, v50);
std::string::basic_string(&v73, a2, v50, v51 - v49);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v52 = v75;
else
v52 = (char *)&v70 + 1;
s = v75;
sscanf(v52, "xoffset=%hd", a3 + 20);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v53 = *(_QWORD *)(a2 + 16);
v54 = *(_QWORD *)(a2 + 8);
}
else
{
v53 = a2 + 1;
v54 = *(_BYTE *)a2 >> 1;
}
if ( v54 <= 7
|| (v55 = v53 + v54,
v56 = std::__search(
v53,
v53 + v54,
"yoffset=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v55 == v56) )
{
v58 = -1;
v57 = -1;
}
else
{
v57 = v56 - v53;
v58 = v57;
}
v59 = std::string::find(a2, 0x20u, v58);
std::string::basic_string(&v73, a2, v58, v59 - v57);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v60 = v75;
else
v60 = (char *)&v70 + 1;
s = v75;
sscanf(v60, "yoffset=%hd", a3 + 22);
if ( (*(_BYTE *)a2 & 1) != 0 )
{
v61 = *(_QWORD *)(a2 + 16);
v62 = *(_QWORD *)(a2 + 8);
}
else
{
v61 = a2 + 1;
v62 = *(_BYTE *)a2 >> 1;
}
if ( v62 <= 8
|| (v63 = v61 + v62,
v64 = std::__search(
v61,
v61 + v62,
"xadvance=",
(unsigned __int8 *)"",
(unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq),
v63 == v64) )
{
v66 = -1;
v65 = -1;
}
else
{
v65 = v64 - v61;
v66 = v65;
}
v67 = std::string::find(a2, 0x20u, v66);
std::string::basic_string(&v73, a2, v66, v67 - v65);
if ( (v70 & 1) != 0 )
{
*s = 0;
v71 = 0;
}
else
{
LOWORD(v70) = 0;
}
std::string::reserve(&v70, 0);
v70 = v73;
v71 = v74;
if ( (v73 & 1) != 0 )
v68 = v75;
else
v68 = (char *)&v70 + 1;
s = v75;
sscanf(v68, "xadvance=%hd", a3 + 24);
if ( (v70 & 1) != 0 )
operator delete(s);
return _stack_chk_guard;
}