//
// cocos2d::CCBMFontConfiguration::parseImageFileName from 0x1006a82b0 to 0x1006a8503 (595 bytes)
//
// 1 xrefs:
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x1006a6fde
//
// 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::parseImageFileName(__int64 a1, const std::string *a2, __int64 a3)
{
std::string::size_type v5; // r13
int v6; // eax
unsigned int v7; // r12d
std::string::size_type size; // r12
std::string::pointer data; // rsi
size_t v10; // rax
size_t v11; // r12
char *v12; // rbx
size_t v13; // r14
std::string::size_type v14; // r13
void *v15; // rdi
__int64 v16; // rsi
int v17; // eax
unsigned int v18; // r12d
std::string::size_type v19; // r12
std::string::pointer v20; // r15
size_t v21; // rax
size_t v22; // r12
char *v23; // r14
__int64 v24; // rax
char *v25; // rsi
size_t v26; // rbx
const std::string::value_type *v27; // rax
__int64 v29; // [rsp+10h] [rbp-60h]
__int128 v30; // [rsp+18h] [rbp-58h] BYREF
void *v31; // [rsp+28h] [rbp-48h]
__int128 __dst; // [rsp+30h] [rbp-40h] BYREF
void *__p; // [rsp+40h] [rbp-30h]
v5 = (int)(std::string::find(a2, 61, 0) + 1);
v6 = std::string::find(a2, 32, v5);
v7 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v7 & 1) == 0 )
{
size = v7 >> 1;
if ( size >= v5 )
{
data = a2->__r_.__value_.__s.__data_;
goto LABEL_6;
}
LABEL_39:
sub_100056810();
}
size = a2->__r_.__value_.__l.__size_;
if ( size < v5 )
goto LABEL_39;
data = a2->__r_.__value_.__l.__data_;
LABEL_6:
v10 = v6 - (int)v5;
v11 = size - v5;
if ( v11 >= v10 )
v11 = v10;
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v29 = a3;
if ( v11 >= 0x17 )
{
v13 = 26;
if ( (v11 | 7) != 0x17 )
v13 = (v11 | 7) + 1;
v12 = (char *)operator new(v13);
__p = v12;
*(_QWORD *)&__dst = v13 + 1;
*((_QWORD *)&__dst + 1) = v11;
goto LABEL_15;
}
LOBYTE(__dst) = 2 * v11;
v12 = (char *)&__dst + 1;
if ( v11 )
LABEL_15:
memmove(v12, &data[v5], v11);
v12[v11] = 0;
v14 = (int)(std::string::find(a2, 34, 0) + 1);
v15 = (void *)a2;
v16 = 34;
v17 = std::string::find(a2, 34, v14);
v18 = (unsigned int)a2->__r_.__value_.__l.0;
if ( (v18 & 1) == 0 )
{
v19 = v18 >> 1;
if ( v19 >= v14 )
{
v20 = a2->__r_.__value_.__s.__data_;
goto LABEL_21;
}
LABEL_41:
sub_100056810();
}
v19 = a2->__r_.__value_.__l.__size_;
if ( v19 < v14 )
goto LABEL_41;
v20 = a2->__r_.__value_.__l.__data_;
LABEL_21:
v21 = v17 - (int)v14;
v22 = v19 - v14;
if ( v22 >= v21 )
v22 = v21;
if ( v22 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
if ( v22 >= 0x17 )
{
v26 = 26;
if ( (v22 | 7) != 0x17 )
v26 = (v22 | 7) + 1;
v23 = (char *)operator new(v26);
v31 = v23;
*(_QWORD *)&v30 = v26 | 1;
*((_QWORD *)&v30 + 1) = v22;
}
else
{
LOBYTE(v30) = 2 * v22;
v23 = (char *)&v30 + 1;
if ( !v22 )
{
BYTE1(v30) = 0;
if ( (__dst & 1) == 0 )
goto LABEL_28;
goto LABEL_27;
}
}
v15 = v23;
v16 = (__int64)&v20[v14];
memmove(v23, &v20[v14], v22);
v23[v22] = 0;
if ( (__dst & 1) != 0 )
{
LABEL_27:
v15 = __p;
operator delete(__p);
}
LABEL_28:
__p = v31;
__dst = v30;
v24 = cocos2d::CCFileUtils::sharedFileUtils(v15, v16);
if ( (__dst & 1) != 0 )
v25 = (char *)__p;
else
v25 = (char *)&__dst + 1;
v27 = (const std::string::value_type *)(*(__int64 (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v24 + 80LL))(
v24,
v25,
v29);
std::string::assign((std::string *)(a1 + 88), v27);
if ( (__dst & 1) != 0 )
operator delete(__p);
}