//
// cocos2d::CCBMFontConfiguration::parseInfoArguments from 0x1006a79d0 to 0x1006a7bc0 (496 bytes)
//
// 1 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x1006a6f54
//
// This function is hookable on this platform (idp: pc, 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:35:20 +0000
//
void __fastcall cocos2d::CCBMFontConfiguration::parseInfoArguments(__int64 a1, const std::string *a2)
{
unsigned int v2; // edx
std::string::pointer data; // rbx
__int64 size; // rdx
char *v5; // r15
std::string::pointer v6; // rax
char *v7; // rax
int v8; // ecx
int v9; // ecx
bool v10; // zf
int v11; // eax
std::string::size_type v12; // r12
int v13; // eax
unsigned int v14; // r15d
std::string::size_type v15; // r15
std::string::pointer v16; // r14
size_t v17; // rax
size_t v18; // r15
char *v19; // r13
size_t v20; // rbx
char *v21; // rbx
char __dst[8]; // [rsp+8h] [rbp-48h] BYREF
size_t v23; // [rsp+10h] [rbp-40h]
char *v24; // [rsp+18h] [rbp-38h]
__int64 v25; // [rsp+20h] [rbp-30h]
v2 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v2 & 1) != 0 )
{
size = a2->__r_.__value_.__l.__size_;
data = a2->__r_.__value_.__l.__data_;
v5 = &data[size];
if ( size < 8 )
goto LABEL_9;
}
else
{
data = a2->__r_.__value_.__s.__data_;
size = v2 >> 1;
v5 = (char *)&a2->__r_.__value_.__l.0 + size + 1;
if ( size < 8 )
goto LABEL_9;
}
v6 = data;
do
{
v7 = (char *)memchr(v6, 112, size - 7);
if ( !v7 )
break;
if ( *(_QWORD *)v7 == 0x3D676E6964646170LL )
{
v8 = (int)v7;
goto LABEL_10;
}
v6 = v7 + 1;
size = v5 - v6;
}
while ( v5 - v6 > 7 );
LABEL_9:
v8 = (int)v5;
v7 = v5;
LABEL_10:
v9 = v8 - (_DWORD)data;
v10 = v7 == v5;
v11 = -1;
if ( !v10 )
v11 = v9;
v12 = v11;
v13 = std::string::find(a2, 32, v11);
v14 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v14 & 1) == 0 )
{
v15 = v14 >> 1;
if ( v12 <= v15 )
{
v16 = a2->__r_.__value_.__s.__data_;
goto LABEL_17;
}
LABEL_30:
sub_100056810();
}
v15 = a2->__r_.__value_.__l.__size_;
if ( v15 < v12 )
goto LABEL_30;
v16 = a2->__r_.__value_.__l.__data_;
LABEL_17:
v17 = v13 - (int)v12;
v18 = v15 - v12;
if ( v18 >= v17 )
v18 = v17;
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v25 = a1;
if ( v18 >= 0x17 )
{
v20 = 26;
if ( (v18 | 7) != 0x17 )
v20 = (v18 | 7) + 1;
v19 = (char *)operator new(v20);
v24 = v19;
*(_QWORD *)__dst = v20 + 1;
v23 = v18;
LABEL_27:
memmove(v19, &v16[v12], v18);
v19[v18] = 0;
if ( (__dst[0] & 1) == 0 )
goto LABEL_23;
goto LABEL_28;
}
__dst[0] = 2 * v18;
v19 = &__dst[1];
if ( v18 )
goto LABEL_27;
__dst[1] = 0;
if ( (__dst[0] & 1) == 0 )
{
LABEL_23:
sscanf(&__dst[1], "padding=%d,%d,%d,%d", v25 + 72, v25 + 76, v25 + 80, v25 + 68);
return;
}
LABEL_28:
v21 = v24;
sscanf(v24, "padding=%d,%d,%d,%d", v25 + 72, v25 + 76, v25 + 80, v25 + 68);
operator delete(v21);
}