//
// cocos2d::CCBMFontConfiguration::parseInfoArguments from 0x18004b5c0 to 0x18004b7f3 (563 bytes)
//
// 4 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x18004a79f
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x18004a842
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b19b0
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCBMFontConfiguration::parseInfoArguments(__int64 a1, unsigned __int64 *a2)
{
char *v3; // rbp
unsigned __int64 v4; // rsi
char *v5; // rbx
int v6; // ebx
char *v7; // r14
void *v8; // rax
int v9; // eax
size_t v10; // r8
unsigned __int64 v11; // rsi
char *v12; // rax
char *v13; // rcx
void *v14; // rcx
unsigned __int64 v15; // rdx
char *v16; // rcx
void *Block[2]; // [rsp+40h] [rbp-58h] BYREF
__m128i si128; // [rsp+50h] [rbp-48h]
v3 = (char *)a2;
if ( a2[3] > 0xF )
v3 = (char *)*a2;
v4 = a2[2];
if ( v4 >= 8 && (v5 = (char *)memchr(v3, 112, v4 - 7)) != nullptr )
{
while ( memcmp(v5, "padding=", 8u) )
{
v5 = (char *)memchr(v5 + 1, 112, &v3[v4 - 7] - (v5 + 1));
if ( !v5 )
goto LABEL_7;
}
v6 = (_DWORD)v5 - (_DWORD)v3;
}
else
{
LABEL_7:
v6 = -1;
}
v7 = (char *)a2;
if ( a2[3] > 0xF )
v7 = (char *)*a2;
if ( v6 < v4 && (v8 = memchr(&v7[v6], 32, v4 - v6)) != nullptr )
v9 = (_DWORD)v8 - (_DWORD)v7;
else
v9 = -1;
*(_OWORD *)Block = 0;
si128 = 0;
if ( v4 < v6 )
std::vector::_Xlen();
v10 = v9 - v6;
v11 = v4 - v6;
if ( v11 < v10 )
v10 = v11;
v12 = (char *)a2;
if ( a2[3] > 0xF )
v12 = (char *)*a2;
sub_18000CE60(Block, &v12[v6], v10);
v13 = (char *)Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v13 = (char *)Block[0];
sub_18004D5D0(v13, "padding=%d,%d,%d,%d");
if ( si128.m128i_i64[1] > 0xFuLL )
{
v14 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v14);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
v15 = a2[3];
if ( v15 > 0xF )
{
v16 = (char *)*a2;
if ( v15 + 1 >= 0x1000 )
{
if ( (unsigned __int64)&v16[-*((_QWORD *)v16 - 1) - 8] > 0x1F )
invalid_parameter_noinfo_noreturn();
v16 = *((char **)v16 - 1);
}
j_j_free_0(v16);
}
a2[2] = 0;
a2[3] = 15;
*(_BYTE *)a2 = 0;
}