//
// MultilineBitmapFont::readColorInfo from 0x100487ac0 to 0x100488793 (3283 bytes)
//
// 1 xrefs:
// > MultilineBitmapFont::initWithFont @ 0x1004872f0
//
// 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
//
std::string *__fastcall MultilineBitmapFont::readColorInfo(std::string *a1, __int64 a2, std::string *a3)
{
std::string *v3; // rbx
unsigned int v5; // r12d
__int64 v6; // rdx
char *v7; // r14
char *v8; // r13
void *v9; // rax
char *v10; // rax
bool v11; // cl
signed __int64 v12; // rax
__int64 v13; // rdx
char *v14; // r14
char *v15; // r13
void *v16; // rax
char *v17; // rax
bool v18; // cl
__int64 v19; // rax
__int64 v20; // rdx
char *v21; // r14
char *v22; // rbx
void *v23; // r13
char *v24; // rax
signed __int64 v25; // r13
__int64 v26; // rdx
char *v27; // r14
char *v28; // rbx
void *v29; // r13
char *v30; // rax
signed __int64 v31; // r13
unsigned __int64 v32; // rax
std::string::size_type v33; // rcx
char *v34; // rsi
size_t v35; // r12
std::string *v36; // rax
unsigned int v37; // r14d
int v38; // ecx
__int64 v39; // rax
int v40; // ecx
__int64 v41; // r12
cocos2d::CCObject *v42; // r14
__int64 v43; // rdi
std::string *v44; // rdi
int v45; // ebx
int v46; // r12d
std::string::size_type v47; // rsi
std::string *v48; // rbx
std::string *v49; // rax
unsigned int v50; // r14d
int v51; // ecx
__int64 v52; // rax
int v53; // ecx
unsigned int v54; // edx
__int64 size; // rdx
char *data; // rbx
__int64 v57; // r13
unsigned __int64 v58; // rcx
unsigned __int64 v59; // rax
char *v60; // rsi
unsigned __int64 v61; // rax
std::string::size_type v62; // rcx
char *v63; // rsi
std::string *v64; // rbx
char *v65; // r14
void *v66; // r13
char *v67; // rax
size_t v68; // r14
int v69; // r14d
std::string *v70; // rax
unsigned int v71; // r12d
int v72; // ecx
__int64 v73; // rax
int v74; // ecx
unsigned int v75; // edx
__int64 v76; // rdx
char *v77; // r12
char *v78; // r14
void *v79; // r13
char *v80; // rax
_BOOL8 v81; // r14
unsigned __int64 v82; // rax
unsigned __int64 v83; // rcx
char *v84; // rsi
size_t v85; // r14
std::string *v86; // rax
unsigned int v87; // r14d
int v88; // ecx
__int64 v89; // rax
int v90; // ecx
unsigned int v91; // edx
__int64 v92; // rdx
char *v93; // r14
char *v94; // rbx
void *v95; // r12
char *v96; // rax
int v97; // r13d
std::string *v98; // rax
unsigned int v99; // r14d
int v100; // ecx
__int64 v101; // rax
int v102; // ecx
int v103; // esi
int v104; // r13d
std::string *v105; // rax
unsigned int v106; // r14d
int v107; // ecx
__int64 v108; // rax
int v109; // ecx
int v110; // r12d
std::string *v111; // rax
unsigned int v112; // r14d
int v113; // ecx
__int64 v114; // rax
int v115; // ecx
__int16 v116; // cx
std::string *v117; // rcx
int v120; // [rsp+14h] [rbp-6Ch]
char __dst[23]; // [rsp+21h] [rbp-5Fh] BYREF
__int64 v122; // [rsp+38h] [rbp-48h]
std::string *v123; // [rsp+40h] [rbp-40h]
void *__s; // [rsp+48h] [rbp-38h]
__int64 v125; // [rsp+50h] [rbp-30h]
v3 = a3;
__s = (char *)&a3->__r_.__value_.__l.0 + 1;
v123 = a3;
v5 = (unsigned int)a3->__r_.__value_.__l.0;
if ( (v5 & 1) != 0 )
goto LABEL_4;
LABEL_2:
v6 = v5 >> 1;
v7 = (char *)__s;
if ( (unsigned __int64)v6 >= 2 )
{
while ( 1 )
{
v8 = &v7[v6];
v9 = v7;
while ( 1 )
{
v10 = (char *)memchr(v9, 60, v6 - 1);
if ( !v10 )
goto LABEL_11;
if ( *(_WORD *)v10 == 25404 )
break;
v9 = v10 + 1;
v6 = v8 - (_BYTE *)v9;
if ( v8 - (_BYTE *)v9 < 2 )
goto LABEL_11;
}
v11 = v10 == v8;
v12 = v10 - v7;
if ( v11 || v12 == -1 )
goto LABEL_11;
v44 = v3;
v45 = v12;
v125 = (unsigned __int8)*std::string::at(v44, (int)v12 + 2);
v46 = v45;
v47 = v45;
v48 = v123;
v49 = std::string::replace(v123, v47, 4u, "");
std::string::operator=(v48, v49);
if ( (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
v50 = 0;
while ( 1 )
{
v52 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v50);
v53 = *(_DWORD *)(v52 + 60);
if ( v53 <= v46 )
break;
*(_DWORD *)(v52 + 60) = v53 - 4;
v51 = *(_DWORD *)(v52 + 64);
if ( v51 != -1 )
goto LABEL_67;
LABEL_68:
if ( ++v50 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_73;
}
v51 = *(_DWORD *)(v52 + 64);
if ( v51 == -1 || v51 <= v46 )
goto LABEL_68;
LABEL_67:
*(_DWORD *)(v52 + 64) = v51 - 4;
goto LABEL_68;
}
LABEL_73:
v54 = (unsigned int)v48->__r_.__value_.__l.0;
if ( (v54 & 1) != 0 )
{
size = v48->__r_.__value_.__l.__size_;
data = v48->__r_.__value_.__l.__data_;
}
else
{
size = v54 >> 1;
data = (char *)__s;
}
if ( size < 4 )
goto LABEL_193;
v65 = &data[size];
v66 = data;
while ( 1 )
{
v67 = (char *)memchr(v66, 60, size - 3);
if ( !v67 )
goto LABEL_193;
if ( *(_DWORD *)v67 == 1046687548 )
break;
v66 = v67 + 1;
size = v65 - (v67 + 1);
if ( size < 4 )
goto LABEL_193;
}
if ( v67 == v65 )
goto LABEL_193;
v97 = (_DWORD)v67 - (_DWORD)data;
if ( v67 - data == -1 )
goto LABEL_193;
v3 = v123;
v98 = std::string::replace(v123, v97, 4u, "");
std::string::operator=(v3, v98);
if ( (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
break;
LABEL_154:
v103 = 255;
switch ( (int)v125 )
{
case 'a':
v103 = 16724630;
break;
case 'b':
v103 = 14766666;
break;
case 'c':
v103 = 9895935;
break;
case 'd':
v103 = 16750335;
break;
case 'f':
v103 = 16777110;
break;
case 'g':
v103 = 4776768;
break;
case 'j':
v103 = 16762930;
break;
case 'l':
v103 = 15706976;
break;
case 'o':
v103 = 4957695;
break;
case 'p':
v103 = 16711935;
break;
case 'r':
v103 = 5921535;
break;
case 's':
v103 = 4316415;
break;
case 'y':
v103 = 0xFFFF;
break;
default:
break;
}
LODWORD(v125) = v103;
v122 = *(_QWORD *)(a2 + 1800);
v42 = (cocos2d::CCObject *)operator new(0x58u);
cocos2d::CCObject::CCObject(v42);
v42->__vftable = (cocos2d::CCObject_vtbl *)off_1009423A8;
LODWORD(v42[1].__vftable) = 1;
HIDWORD(v42[1].__vftable) = v46;
v42[1].m_uID = v97 - 1;
cocos2d::CCObject::autorelease(v42);
v116 = v125;
BYTE2(v42[1].m_nLuaID) = BYTE2(v125);
LOWORD(v42[1].m_nLuaID) = v116;
v43 = v122;
LABEL_62:
sub_10071FCD0(v43, v42);
v5 = (unsigned int)v3->__r_.__value_.__l.0;
if ( (v5 & 1) == 0 )
goto LABEL_2;
LABEL_4:
v6 = v3->__r_.__value_.__l.__size_;
v7 = v3->__r_.__value_.__l.__data_;
if ( v6 < 2 )
goto LABEL_11;
}
v99 = 0;
while ( 1 )
{
v101 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v99);
v102 = *(_DWORD *)(v101 + 60);
if ( v102 <= v97 )
break;
*(_DWORD *)(v101 + 60) = v102 - 4;
v100 = *(_DWORD *)(v101 + 64);
if ( v100 != -1 )
goto LABEL_148;
LABEL_149:
if ( ++v99 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_154;
}
v100 = *(_DWORD *)(v101 + 64);
if ( v100 == -1 || v100 <= v97 )
goto LABEL_149;
LABEL_148:
*(_DWORD *)(v101 + 64) = v100 - 4;
goto LABEL_149;
}
LABEL_11:
if ( (v5 & 1) != 0 )
{
v13 = v3->__r_.__value_.__l.__size_;
v14 = v3->__r_.__value_.__l.__data_;
if ( v13 < 2 )
goto LABEL_21;
}
else
{
v13 = v5 >> 1;
v14 = (char *)__s;
if ( (unsigned __int64)v13 < 2 )
goto LABEL_21;
}
v15 = &v14[v13];
v16 = v14;
while ( 1 )
{
v17 = (char *)memchr(v16, 60, v13 - 1);
if ( !v17 )
goto LABEL_21;
if ( *(_WORD *)v17 == 26940 )
break;
v16 = v17 + 1;
v13 = v15 - (_BYTE *)v16;
if ( v15 - (_BYTE *)v16 < 2 )
goto LABEL_21;
}
v18 = v17 == v15;
v19 = v17 - v14;
if ( !v18 && v19 != -1 )
{
v57 = v19 << 32;
v58 = ((v19 << 32) + 0x200000000LL) >> 32;
v125 = v19;
if ( (v5 & 1) != 0 )
{
v59 = v3->__r_.__value_.__l.__size_;
if ( v59 < v58 )
goto LABEL_194;
v60 = v3->__r_.__value_.__l.__data_;
}
else
{
v59 = (unsigned __int8)v5 >> 1;
v60 = (char *)__s;
if ( v58 > v59 )
goto LABEL_194;
}
v68 = v59 - v58;
if ( v59 - v58 >= 3 )
v68 = 3;
if ( v59 != v58 )
memcpy(__dst, &v60[v58], v68);
__dst[v68] = 0;
v69 = atoi(__dst);
v70 = std::string::replace(v3, v57 >> 32, 6u, "");
std::string::operator=(v3, v70);
if ( (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
v71 = 0;
while ( 1 )
{
v73 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v71);
v74 = *(_DWORD *)(v73 + 60);
if ( v74 <= (int)v125 )
break;
*(_DWORD *)(v73 + 60) = v74 - 6;
v72 = *(_DWORD *)(v73 + 64);
if ( v72 != -1 )
goto LABEL_97;
LABEL_98:
if ( ++v71 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_103;
}
v72 = *(_DWORD *)(v73 + 64);
if ( v72 == -1 || v72 <= (int)v125 )
goto LABEL_98;
LABEL_97:
*(_DWORD *)(v73 + 64) = v72 - 6;
goto LABEL_98;
}
LABEL_103:
v75 = (unsigned int)v3->__r_.__value_.__l.0;
if ( (v75 & 1) != 0 )
{
v76 = v3->__r_.__value_.__l.__size_;
v77 = v3->__r_.__value_.__l.__data_;
}
else
{
v76 = v75 >> 1;
v77 = (char *)__s;
}
if ( v76 < 4 )
goto LABEL_193;
*(float *)&v122 = (float)v69;
v78 = &v77[v76];
v79 = v77;
while ( 1 )
{
v80 = (char *)memchr(v79, 60, v76 - 3);
if ( !v80 )
goto LABEL_193;
if ( *(_DWORD *)v80 == 1047080764 )
break;
v79 = v80 + 1;
v76 = v78 - (v80 + 1);
if ( v76 < 4 )
goto LABEL_193;
}
if ( v80 == v78 )
goto LABEL_193;
v104 = (_DWORD)v80 - (_DWORD)v77;
if ( v80 - v77 == -1 )
goto LABEL_193;
*(float *)&v122 = *(float *)&v122 / 100.0;
v3 = v123;
v105 = std::string::replace(v123, v104, 4u, "");
std::string::operator=(v3, v105);
if ( !(unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
LABEL_167:
v41 = *(_QWORD *)(a2 + 1800);
v42 = (cocos2d::CCObject *)operator new(0x58u);
cocos2d::CCObject::CCObject(v42);
v42->__vftable = (cocos2d::CCObject_vtbl *)off_1009423A8;
LODWORD(v42[1].__vftable) = 2;
HIDWORD(v42[1].__vftable) = v125;
v42[1].m_uID = v104 - 1;
cocos2d::CCObject::autorelease(v42);
v42[1].m_nTag = v122;
goto LABEL_61;
}
v106 = 0;
while ( 1 )
{
v108 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v106);
v109 = *(_DWORD *)(v108 + 60);
if ( v109 <= v104 )
break;
*(_DWORD *)(v108 + 60) = v109 - 4;
v107 = *(_DWORD *)(v108 + 64);
if ( v107 != -1 )
goto LABEL_161;
LABEL_162:
if ( ++v106 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_167;
}
v107 = *(_DWORD *)(v108 + 64);
if ( v107 == -1 || v107 <= v104 )
goto LABEL_162;
LABEL_161:
*(_DWORD *)(v108 + 64) = v107 - 4;
goto LABEL_162;
}
LABEL_21:
if ( (v5 & 1) != 0 )
{
v20 = v3->__r_.__value_.__l.__size_;
v21 = v3->__r_.__value_.__l.__data_;
if ( v20 < 2 )
goto LABEL_31;
}
else
{
v20 = v5 >> 1;
v21 = (char *)__s;
if ( (unsigned __int64)v20 < 2 )
goto LABEL_31;
}
v22 = &v21[v20];
v23 = v21;
while ( 1 )
{
v24 = (char *)memchr(v23, 60, v20 - 1);
if ( !v24 )
goto LABEL_31;
if ( *(_WORD *)v24 == 29500 )
break;
v23 = v24 + 1;
v20 = v22 - (v24 + 1);
if ( v20 < 2 )
goto LABEL_31;
}
v25 = v24 - v21;
if ( v24 != v22 && v24 - v21 != -1 )
{
v125 = v25 << 32;
v61 = ((v25 << 32) + 0x200000000LL) >> 32;
if ( (v5 & 1) != 0 )
{
v64 = v123;
v62 = v123->__r_.__value_.__l.__size_;
if ( v62 < v61 )
goto LABEL_194;
v63 = v123->__r_.__value_.__l.__data_;
}
else
{
v62 = (unsigned __int8)v5 >> 1;
v63 = (char *)__s;
v64 = v123;
if ( v61 > v62 )
goto LABEL_194;
}
v81 = v62 != v61;
if ( v62 != v61 )
memcpy(__dst, &v63[v61], v62 != v61);
__dst[v81] = 0;
LODWORD(v122) = atoi(__dst);
v82 = (v125 + 0x300000000LL) >> 32;
if ( (v5 & 1) != 0 )
{
v83 = v64->__r_.__value_.__l.__size_;
if ( v83 < v82 )
goto LABEL_194;
v84 = v64->__r_.__value_.__l.__data_;
}
else
{
v83 = (unsigned __int8)v5 >> 1;
v84 = (char *)__s;
if ( v82 > v83 )
LABEL_194:
sub_1000547C0();
}
v85 = v83 - v82;
if ( v83 - v82 >= 2 )
v85 = 2;
if ( v83 != v82 )
memcpy(__dst, &v84[v82], v85);
__dst[v85] = 0;
v120 = atoi(__dst);
v86 = std::string::replace(v64, v125 >> 32, 6u, "");
std::string::operator=(v64, v86);
if ( (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
v87 = 0;
while ( 1 )
{
v89 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v87);
v90 = *(_DWORD *)(v89 + 60);
if ( v90 <= (int)v25 )
break;
*(_DWORD *)(v89 + 60) = v90 - 6;
v88 = *(_DWORD *)(v89 + 64);
if ( v88 != -1 )
goto LABEL_128;
LABEL_129:
if ( ++v87 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_134;
}
v88 = *(_DWORD *)(v89 + 64);
if ( v88 == -1 || v88 <= (int)v25 )
goto LABEL_129;
LABEL_128:
*(_DWORD *)(v89 + 64) = v88 - 6;
goto LABEL_129;
}
LABEL_134:
v91 = (unsigned int)v64->__r_.__value_.__l.0;
if ( (v91 & 1) != 0 )
{
v92 = v64->__r_.__value_.__l.__size_;
v93 = v64->__r_.__value_.__l.__data_;
}
else
{
v92 = v91 >> 1;
v93 = (char *)__s;
}
if ( v92 < 4 )
goto LABEL_193;
v94 = &v93[v92];
v95 = v93;
while ( 1 )
{
v96 = (char *)memchr(v95, 60, v92 - 3);
if ( !v96 )
goto LABEL_193;
if ( *(_DWORD *)v96 == 1047736124 )
break;
v95 = v96 + 1;
v92 = v94 - (v96 + 1);
if ( v92 < 4 )
goto LABEL_193;
}
if ( v96 == v94 )
goto LABEL_193;
v110 = (_DWORD)v96 - (_DWORD)v93;
if ( v96 - v93 == -1 )
goto LABEL_193;
v3 = v123;
v111 = std::string::replace(v123, v110, 4u, "");
std::string::operator=(v3, v111);
if ( !(unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
LABEL_179:
v125 = *(_QWORD *)(a2 + 1800);
v42 = (cocos2d::CCObject *)operator new(0x58u);
cocos2d::CCObject::CCObject(v42);
v42->__vftable = (cocos2d::CCObject_vtbl *)off_1009423A8;
LODWORD(v42[1].__vftable) = 3;
HIDWORD(v42[1].__vftable) = v25;
v42[1].m_uID = v110 - 1;
cocos2d::CCObject::autorelease(v42);
v42[1].m_uAutoReleaseCount = v122;
v42[1].m_eObjType = v120;
v43 = v125;
goto LABEL_62;
}
v112 = 0;
while ( 1 )
{
v114 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v112);
v115 = *(_DWORD *)(v114 + 60);
if ( v115 <= v110 )
break;
*(_DWORD *)(v114 + 60) = v115 - 4;
v113 = *(_DWORD *)(v114 + 64);
if ( v113 != -1 )
goto LABEL_173;
LABEL_174:
if ( ++v112 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_179;
}
v113 = *(_DWORD *)(v114 + 64);
if ( v113 == -1 || v113 <= v110 )
goto LABEL_174;
LABEL_173:
*(_DWORD *)(v114 + 64) = v113 - 4;
goto LABEL_174;
}
LABEL_31:
if ( (v5 & 1) != 0 )
{
v26 = v123->__r_.__value_.__l.__size_;
v27 = v123->__r_.__value_.__l.__data_;
}
else
{
v26 = v5 >> 1;
v27 = (char *)__s;
}
if ( v26 >= 2 )
{
v28 = &v27[v26];
v29 = v27;
while ( 1 )
{
v30 = (char *)memchr(v29, 60, v26 - 1);
if ( !v30 )
goto LABEL_193;
if ( *(_WORD *)v30 == 25660 )
break;
v29 = v30 + 1;
v26 = v28 - (v30 + 1);
if ( v26 < 2 )
goto LABEL_193;
}
if ( v30 != v28 )
{
v31 = v30 - v27;
if ( v30 - v27 != -1 )
{
v32 = ((v31 << 32) + 0x200000000LL) >> 32;
if ( (v5 & 1) != 0 )
{
v3 = v123;
v33 = v123->__r_.__value_.__l.__size_;
if ( v33 < v32 )
goto LABEL_194;
v34 = v123->__r_.__value_.__l.__data_;
}
else
{
v33 = (unsigned __int8)v5 >> 1;
v34 = (char *)__s;
v3 = v123;
if ( v32 > v33 )
goto LABEL_194;
}
v35 = v33 - v32;
if ( v33 - v32 >= 3 )
v35 = 3;
if ( v33 != v32 )
memcpy(__dst, &v34[v32], v35);
__dst[v35] = 0;
*(float *)&v125 = (float)atoi(__dst) / 100.0;
v36 = std::string::replace(v3, (int)v31, 6u, "");
std::string::operator=(v3, v36);
if ( (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
{
v37 = 0;
while ( 1 )
{
v39 = sub_1007200C0(*(_QWORD *)(a2 + 1800), v37);
v40 = *(_DWORD *)(v39 + 60);
if ( v40 <= (int)v31 )
break;
*(_DWORD *)(v39 + 60) = v40 - 6;
v38 = *(_DWORD *)(v39 + 64);
if ( v38 != -1 )
goto LABEL_54;
LABEL_55:
if ( ++v37 >= (unsigned int)sub_100720070(*(_QWORD *)(a2 + 1800)) )
goto LABEL_60;
}
v38 = *(_DWORD *)(v39 + 64);
if ( v38 == -1 || v38 <= (int)v31 )
goto LABEL_55;
LABEL_54:
*(_DWORD *)(v39 + 64) = v38 - 6;
goto LABEL_55;
}
LABEL_60:
v41 = *(_QWORD *)(a2 + 1800);
v42 = (cocos2d::CCObject *)operator new(0x58u);
cocos2d::CCObject::CCObject(v42);
v42->__vftable = (cocos2d::CCObject_vtbl *)off_1009423A8;
LODWORD(v42[1].__vftable) = 4;
HIDWORD(v42[1].__vftable) = v31;
v42[1].m_uID = -1;
cocos2d::CCObject::autorelease(v42);
v42[1].m_uReference = v125;
LABEL_61:
v43 = v41;
goto LABEL_62;
}
}
}
LABEL_193:
v117 = v123;
*a1 = *v123;
*(_OWORD *)&v117->__r_.__value_.__l.0 = 0;
v117->__r_.__value_.__r.__words[2] = 0;
return a1;
}