//
// cocos2d::CCTMXMapInfo::startElement from 0xb3c138 to 0xb3dd1c (7140 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'cocos2d::CCTMXMapInfo::startElement @ 0xb3dd2c
// > ??> @ 0x7db38
// > ??> @ 0x121b390
//
// 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
//
void cocos2d::CCTMXMapInfo::startElement(cocos2d::CCTMXMapInfo *a1, void *a2, const char *a3, const char **a4)
{
__int64 *v5; // x28
__int64 v6; // x21
cocos2d::CCObject *v7; // x3
char *v8; // x1
char **p_m_uID; // x22
cocos2d::CCPoint v10; // x1
void *v11; // x0
char *v12; // x1
char *v13; // x0
char *v14; // x1
char *v15; // x0
void *v16; // x0
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
char *v25; // x0
char *v26; // x0
char *v27; // x0
float v28; // s0
char *v29; // x0
float v30; // s0
char *v31; // x0
float v32; // s0
char *v33; // x0
float v34; // s0
char *v35; // x0
char *v36; // x0
__int64 v37; // x22
__int64 v38; // x1
void *v39; // x0
void *v40; // x0
__int64 v41; // x24
__int64 v42; // x1
void *v43; // x0
unsigned int *v44; // x1
int v45; // w2
unsigned int *v46; // x1
int v47; // w2
void *v48; // x0
__int64 v49; // x1
__int64 *v50; // x0
char *v51; // x0
__int64 v52; // x0
void *v53; // x0
char *v54; // x1
char *v55; // x0
cocos2d::CCFileUtils *v56; // x0
void *v57; // x0
char *v58; // x0
__int64 v59; // x22
size_t v60; // x0
char *v61; // x0
float v62; // s0
char *v63; // x0
float v64; // s0
char *v65; // x0
char *v66; // x0
char *v67; // x0
double v68; // d8
char *v69; // x0
float v70; // s1
float v71; // s0
float v72; // s0
float v73; // s1
cocos2d::CCArray *v74; // x0
cocos2d::CCObject *v75; // x2
char *v76; // x0
char *v77; // x1
unsigned int *v78; // x1
int v79; // w2
__int64 v80; // x22
size_t v81; // x0
int m_unknown2; // w0
char *v83; // x0
char *v84; // x0
char *v85; // x0
float v86; // s0
char *v87; // x0
float v88; // s0
cocos2d::CCArray *v89; // x0
cocos2d::CCObject *v90; // x2
unsigned int *v91; // x1
cocos2d::CCArray *v92; // x0
cocos2d::CCObject *Object; // x22
cocos2d::CCDictionary *v94; // x23
char *v95; // x0
cocos2d::CCDictionary *TileProperties; // x0
unsigned int *v97; // x1
int v98; // w2
const char *v99; // x27
cocos2d::CCArray *v100; // x0
cocos2d::CCObject *v101; // x22
char *v102; // x0
__int64 v103; // x0
void *v104; // x0
char *v105; // x0
unsigned int *v106; // x1
int v107; // w2
unsigned int *v108; // x1
int v109; // w2
__int64 v110; // x22
size_t v111; // x0
char *v112; // x0
float v113; // s0
char *v114; // x0
float v115; // s0
int m_nTag; // s1
cocos2d::CCArray *v117; // x0
cocos2d::CCObject *v118; // x2
char *v119; // x0
cocos2d::CCPoint *v120; // x0
void *v121; // x0
unsigned int *v122; // x3
int v123; // w2
char *v124; // x0
char *v125; // x0
unsigned int *v126; // x1
int v127; // w2
unsigned int *v128; // x1
int v129; // w2
unsigned int *v130; // x1
cocos2d::CCTMXMapInfo_vtbl *v131; // x1
cocos2d::CCArray *v132; // x0
cocos2d::CCObject *v133; // x25
__int64 v134; // x24
char *v135; // x25
cocos2d::CCString *v136; // x19
float *v137; // x25
char *v138; // x24
char *v139; // x0
int v140; // w0
cocos2d::CCString *v141; // x22
char *v142; // x0
int v143; // w22
char *v144; // x0
int v145; // w0
cocos2d::CCString *v146; // x22
cocos2d::CCArray *v147; // x0
cocos2d::CCObject *v148; // x22
cocos2d::CCObject *v149; // x2
int *p_m_uIndexInArray; // x22
size_t v151; // x0
cocos2d::CCPoint *v152; // x0
unsigned int *v153; // x1
int v154; // w2
int m_uOrderOfArrival; // w0
cocos2d::CCDictionary *v156; // x0
cocos2d::CCObject *v157; // x0
__int64 v158; // x23
char *v159; // x24
cocos2d::CCString *v160; // x22
char *v161; // x1
unsigned int *v162; // x3
int v163; // w2
int v164; // w1
cocos2d::CCObject *v165; // x0
cocos2d::CCObject_vtbl *v166; // x1
cocos2d::CCArray *v167; // x0
_QWORD *v168; // x0
__int64 v169; // x2
__int64 (__fastcall ***v170)(); // x22
cocos2d::CCDictionary *v171; // x22
_QWORD *v172; // x0
int v173; // w0
cocos2d::CCString *v174; // x26
_QWORD *v175; // x0
cocos2d::CCObject *v176; // x2
int v177; // w0
cocos2d::CCString *v178; // x26
bool (__fastcall **p_canEncode)(cocos2d::CCObject *__hidden); // x0
char *v180; // x0
cocos2d::CCArray *v181; // x0
cocos2d::CCObject *v182; // x23
cocos2d::CCString *v183; // x22
char *v184; // x0
cocos2d::CCDictionary *v185; // x0
__int64 v186; // x23
char *v187; // x0
cocos2d::CCArray *v188; // x0
cocos2d::CCObject *v189; // x0
cocos2d::CCArray *v190; // x0
cocos2d::CCArray *v191; // x0
cocos2d::CCObject *v192; // x23
_QWORD v193[2]; // [xsp+0h] [xbp+0h] BYREF
__int64 (__fastcall ***v194)(); // [xsp+78h] [xbp+78h]
char *v195; // [xsp+80h] [xbp+80h]
__int64 v196; // [xsp+88h] [xbp+88h]
__int64 *v197; // [xsp+90h] [xbp+90h]
void *v198; // [xsp+98h] [xbp+98h]
void *v199; // [xsp+A0h] [xbp+A0h]
void *v200; // [xsp+A8h] [xbp+A8h]
int v201[2]; // [xsp+B0h] [xbp+B0h]
char *format; // [xsp+B8h] [xbp+B8h]
_BYTE *v203; // [xsp+C0h] [xbp+C0h]
char *v204; // [xsp+C8h] [xbp+C8h]
float *v205; // [xsp+D0h] [xbp+D0h]
char **v206; // [xsp+D8h] [xbp+D8h]
cocos2d::CCObject *v207; // [xsp+E0h] [xbp+E0h]
cocos2d::CCObject *v208; // [xsp+E8h] [xbp+E8h]
char v209; // [xsp+108h] [xbp+108h] BYREF
char *v210; // [xsp+110h] [xbp+110h] BYREF
char *v211; // [xsp+118h] [xbp+118h] BYREF
char *v212; // [xsp+120h] [xbp+120h] BYREF
cocos2d::CCPoint v213; // [xsp+128h] [xbp+128h] BYREF
__int64 v214; // [xsp+130h] [xbp+130h] BYREF
_BYTE v215[368]; // [xsp+138h] [xbp+138h] BYREF
char *v216; // [xsp+2A8h] [xbp+2A8h] BYREF
char *v217; // [xsp+2B0h] [xbp+2B0h]
const char *v218; // [xsp+2B8h] [xbp+2B8h]
__int64 (__fastcall **v219)(); // [xsp+2C0h] [xbp+2C0h] BYREF
const char *v220; // [xsp+2C8h] [xbp+2C8h]
__int64 v221; // [xsp+2D0h] [xbp+2D0h]
__int64 v222; // [xsp+2D8h] [xbp+2D8h]
__int64 v223; // [xsp+2E0h] [xbp+2E0h]
__int64 v224; // [xsp+2E8h] [xbp+2E8h]
__int64 v225; // [xsp+2F0h] [xbp+2F0h]
__int64 v226; // [xsp+2F8h] [xbp+2F8h] BYREF
int v227; // [xsp+300h] [xbp+300h]
__int64 v228; // [xsp+308h] [xbp+308h] BYREF
_QWORD v229[28]; // [xsp+310h] [xbp+310h] BYREF
char v230; // [xsp+3F0h] [xbp+3F0h]
char v231; // [xsp+3F1h] [xbp+3F1h]
__int64 v232; // [xsp+3F8h] [xbp+3F8h]
__int64 v233; // [xsp+400h] [xbp+400h]
__int64 v234; // [xsp+408h] [xbp+408h]
__int64 v235; // [xsp+410h] [xbp+410h]
__int64 v236; // [xsp+418h] [xbp+418h] BYREF
__int64 v237; // [xsp+420h] [xbp+420h]
__int64 v238; // [xsp+428h] [xbp+428h]
__int64 v239; // [xsp+430h] [xbp+430h]
v5 = (__int64 *)&v209;
v208 = (cocos2d::CCObject *)a4;
sub_D153B8((int)&v209, (char *)a3);
v6 = operator new(0x30u);
v7 = v208;
*(_DWORD *)(v6 + 8) = 0;
*(_QWORD *)(v6 + 16) = 0;
*(_QWORD *)(v6 + 40) = 0;
*(_QWORD *)(v6 + 24) = v6 + 8;
*(_QWORD *)(v6 + 32) = v6 + 8;
if ( v7 )
{
v8 = (char *)v7->__vftable;
if ( v7->__vftable )
{
p_m_uID = (char **)&v7->m_uID;
v208 = (cocos2d::CCObject *)&v210;
while ( 1 )
{
sub_D153B8((unsigned int)v193 + 280, v8);
sub_D153B8((unsigned int)v193 + 288, *p_m_uID);
sub_D18D28(&v213);
sub_D18D28(&v214);
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_insert_unique>(
(_QWORD *)v6,
(__int64)&v213);
v16 = (void *)(v214 - 24);
if ( (__int64 *)(v214 - 24) == &qword_124B6B0 )
goto LABEL_4;
if ( &pthread_create )
{
v17 = (unsigned int *)(v214 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(v214 - 8);
*(_DWORD *)(v214 - 8) = v18 - 1;
}
if ( v18 > 0 )
{
LABEL_4:
v10 = v213;
v11 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) == &qword_124B6B0 )
goto LABEL_5;
}
else
{
operator delete(v16);
v10 = v213;
v11 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) == &qword_124B6B0 )
goto LABEL_5;
}
if ( &pthread_create )
{
v19 = (unsigned int *)(*(_QWORD *)&v10 - 8LL);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(*(_QWORD *)&v10 - 8LL);
*(_DWORD *)(*(_QWORD *)&v10 - 8LL) = v20 - 1;
}
if ( v20 <= 0 )
{
operator delete(v11);
v12 = v212;
v13 = v212 - 24;
if ( v212 - 24 == (char *)&qword_124B6B0 )
goto LABEL_6;
goto LABEL_19;
}
LABEL_5:
v12 = v212;
v13 = v212 - 24;
if ( v212 - 24 == (char *)&qword_124B6B0 )
goto LABEL_6;
LABEL_19:
if ( &pthread_create )
{
v21 = (unsigned int *)(v12 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *((_DWORD *)v12 - 2);
*((_DWORD *)v12 - 2) = v22 - 1;
}
if ( v22 > 0 )
{
LABEL_6:
v14 = v211;
v15 = v211 - 24;
if ( v211 - 24 != (char *)&qword_124B6B0 )
goto LABEL_24;
LABEL_7:
p_m_uID += 2;
v8 = *(p_m_uID - 1);
if ( !v8 )
break;
}
else
{
operator delete(v13);
v14 = v211;
v15 = v211 - 24;
if ( v211 - 24 == (char *)&qword_124B6B0 )
goto LABEL_7;
LABEL_24:
if ( &pthread_create )
{
v23 = (unsigned int *)(v14 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v24 - 1;
}
if ( v24 > 0 )
goto LABEL_7;
p_m_uID += 2;
operator delete(v15);
v8 = *(p_m_uID - 1);
if ( !v8 )
break;
}
}
}
}
if ( !(unsigned int)sub_D171E0((int)&v209, "map") )
{
v25 = sub_B3B360("version", v6);
sub_D153B8((int)&v211, v25);
sub_D171E0((int)&v211, "1.0");
v26 = sub_B3B360("orientation", v6);
sub_D153B8((int)&v212, v26);
if ( (unsigned int)sub_D171E0((int)&v212, "orthogonal") )
{
if ( (unsigned int)sub_D171E0((int)&v212, "isometric") )
{
if ( !(unsigned int)sub_D171E0((int)&v212, "hexagonal") )
LODWORD(a1[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable) = 1;
}
else
{
LODWORD(a1[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable) = 2;
}
}
else
{
LODWORD(a1[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable) = 0;
}
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v213);
v27 = sub_B3B360("width", v6);
v28 = atof(v27);
v213.x = v28;
v29 = sub_B3B360("height", v6);
v30 = atof(v29);
v213.y = v30;
cocos2d::CCSize::operator=(
(cocos2d::CCSize *)((char *)&a1[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable + 4),
(float *)&v213);
v31 = sub_B3B360("tilewidth", v6);
v32 = atof(v31);
v213.x = v32;
v33 = sub_B3B360("tileheight", v6);
v34 = atof(v33);
v213.y = v34;
cocos2d::CCSize::operator=((cocos2d::CCSize *)&a1[1].m_nLuaID, (float *)&v213);
a1[1].m_uOrderOfArrival = 1;
v35 = v212 - 24;
if ( v212 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v108 = (unsigned int *)(v212 - 8);
do
v109 = __ldaxr(v108);
while ( __stlxr(v109 - 1, v108) );
}
else
{
v109 = *((_DWORD *)v212 - 2);
*((_DWORD *)v212 - 2) = v109 - 1;
}
if ( v109 <= 0 )
operator delete(v35);
}
v36 = v211 - 24;
if ( v211 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v106 = (unsigned int *)(v211 - 8);
do
v107 = __ldaxr(v106);
while ( __stlxr(v107 - 1, v106) );
}
else
{
v107 = *((_DWORD *)v211 - 2);
*((_DWORD *)v211 - 2) = v107 - 1;
}
if ( v107 <= 0 )
{
LABEL_68:
operator delete(v36);
goto LABEL_34;
}
}
goto LABEL_34;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "tileset") )
{
v51 = sub_B3B360("source", v6);
sub_D153B8((int)&v211, v51);
if ( !(unsigned int)sub_D171E0((int)&v211, &byte_F288A0) )
{
v80 = operator new(0x68u);
cocos2d::CCTMXTilesetInfo::CCTMXTilesetInfo((cocos2d::CCTMXTilesetInfo *)v80);
v208 = (cocos2d::CCObject *)sub_B3B360("name", v6);
v81 = strlen((const char *)v208);
sub_D1798C(v80 + 56, (const char *)v208, v81);
m_unknown2 = a1[2].m_unknown2;
if ( m_unknown2 )
{
*(_DWORD *)(v80 + 64) = m_unknown2;
a1[2].m_unknown2 = 0;
}
else
{
v119 = sub_B3B360("firstgid", v6);
*(_DWORD *)(v80 + 64) = atoi(v119);
}
v83 = sub_B3B360("spacing", v6);
*(_DWORD *)(v80 + 76) = atoi(v83);
v84 = sub_B3B360("margin", v6);
*(_DWORD *)(v80 + 80) = atoi(v84);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v213);
v85 = sub_B3B360("tilewidth", v6);
v86 = atof(v85);
v213.x = v86;
v87 = sub_B3B360("tileheight", v6);
v88 = atof(v87);
v213.y = v88;
cocos2d::CCSize::operator=((cocos2d::CCSize *)(v80 + 68), (float *)&v213);
v89 = a1->getTilesets(a1);
cocos2d::CCArray::addObject(v89, (cocos2d::_ccArray *)v80, v90);
cocos2d::CCObject::release((cocos2d::CCObject *)v80);
goto LABEL_81;
}
if ( sub_D16A88((int)a1 + 136, &word_F2A0A8, -1, 1u) == -1 )
{
sub_D18D28(&v212);
sub_D15FD4(&v212, &word_F2A0A8, 1);
v120 = (cocos2d::CCPoint *)sub_D15E14(&v212, &v211);
v213 = *v120;
*v120 = (cocos2d::CCPoint)&byte_124B6C8;
sub_D163D4(&v211, &v213);
v121 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
{
v162 = (unsigned int *)(*(_QWORD *)&v213 - 8LL);
if ( &pthread_create )
{
do
v163 = __ldaxr(v162);
while ( __stlxr(v163 - 1, v162) );
}
else
{
v163 = *(_DWORD *)(*(_QWORD *)&v213 - 8LL);
*(_DWORD *)(*(_QWORD *)&v213 - 8LL) = v163 - 1;
}
if ( v163 <= 0 )
operator delete(v121);
}
v54 = v212;
v55 = v212 - 24;
if ( v212 - 24 == (char *)&qword_124B6B0 )
goto LABEL_56;
v122 = (unsigned int *)(v212 - 8);
if ( &pthread_create )
{
do
v123 = __ldaxr(v122);
while ( __stlxr(v123 - 1, v122) );
LABEL_121:
if ( v123 <= 0 )
operator delete(v55);
LABEL_56:
v56 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(cocos2d::CCPoint *__return_ptr, cocos2d::CCFileUtils *, char *, _QWORD))v56->createCCArrayWithContentsOfFile)(
&v213,
v56,
v211,
0);
sub_D163D4(&v211, &v213);
v57 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v126 = (unsigned int *)(*(_QWORD *)&v213 - 8LL);
do
v127 = __ldaxr(v126);
while ( __stlxr(v127 - 1, v126) );
}
else
{
v127 = *(_DWORD *)(*(_QWORD *)&v213 - 8LL);
*(_DWORD *)(*(_QWORD *)&v213 - 8LL) = v127 - 1;
}
if ( v127 <= 0 )
operator delete(v57);
}
v58 = sub_B3B360("firstgid", v6);
a1[2].m_unknown2 = atoi(v58);
cocos2d::CCTMXMapInfo::parseXMLFile(a1, v211);
LABEL_81:
v77 = v211;
v36 = v211 - 24;
if ( v211 - 24 == (char *)&qword_124B6B0 )
goto LABEL_34;
if ( &pthread_create )
{
v91 = (unsigned int *)(v211 - 8);
do
v79 = __ldaxr(v91);
while ( __stlxr(v79 - 1, v91) );
goto LABEL_67;
}
goto LABEL_140;
}
}
else
{
v52 = sub_D16A88((int)a1 + 136, &word_F2A0A8, -1, 1u);
sub_D14F84(&v212, &a1[2].m_uID, 0, v52 + 1);
sub_D18D28(&v213);
sub_D15E14(&v213, &v211);
sub_D163D4(&v211, &v213);
v53 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v128 = (unsigned int *)(*(_QWORD *)&v213 - 8LL);
do
v129 = __ldaxr(v128);
while ( __stlxr(v129 - 1, v128) );
}
else
{
v129 = *(_DWORD *)(*(_QWORD *)&v213 - 8LL);
*(_DWORD *)(*(_QWORD *)&v213 - 8LL) = v129 - 1;
}
if ( v129 <= 0 )
operator delete(v53);
}
v54 = v212;
v55 = v212 - 24;
if ( v212 - 24 == (char *)&qword_124B6B0 )
goto LABEL_56;
if ( &pthread_create )
{
v130 = (unsigned int *)(v212 - 8);
do
v123 = __ldaxr(v130);
while ( __stlxr(v123 - 1, v130) );
goto LABEL_121;
}
}
v123 = *((_DWORD *)v54 - 2);
*((_DWORD *)v54 - 2) = v123 - 1;
goto LABEL_121;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "tile") )
{
v92 = a1->getTilesets(a1);
Object = cocos2d::CCArray::lastObject(v92);
v94 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary(v94);
LODWORD(Object) = Object[1].m_uID;
v95 = sub_B3B360("id", v6);
a1[1].m_unknown5 = atoi(v95) + (_DWORD)Object;
TileProperties = cocos2d::CCTMXMapInfo::getTileProperties(a1);
cocos2d::CCDictionary::setObject(TileProperties, v94, (unsigned int)a1[1].m_unknown5);
cocos2d::CCObject::release(v94);
a1[1].m_uOrderOfArrival = 5;
goto LABEL_34;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "layer") )
{
v59 = operator new(0x70u);
cocos2d::CCTMXLayerInfo::CCTMXLayerInfo((cocos2d::CCTMXLayerInfo *)v59);
v208 = (cocos2d::CCObject *)sub_B3B360("name", v6);
v60 = strlen((const char *)v208);
sub_D1798C(v59 + 64, (const char *)v208, v60);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v210);
v61 = sub_B3B360("width", v6);
v62 = atof(v61);
*(float *)&v210 = v62;
v63 = sub_B3B360("height", v6);
v64 = atof(v63);
*((float *)&v210 + 1) = v64;
cocos2d::CCSize::operator=((cocos2d::CCSize *)(v59 + 72), (float *)&v210);
v65 = sub_B3B360("visible", v6);
sub_D153B8((int)&v211, v65);
*(_BYTE *)(v59 + 88) = (unsigned int)sub_D171E0((int)&v211, "0") != 0;
v66 = sub_B3B360("opacity", v6);
sub_D153B8((int)&v212, v66);
if ( (unsigned int)sub_D171E0((int)&v212, &byte_F288A0) )
*(_BYTE *)(v59 + 89) = (unsigned int)(atof(v212) * 255.0);
else
*(_BYTE *)(v59 + 89) = -1;
v67 = sub_B3B360("x", v6);
v68 = atof(v67);
v69 = sub_B3B360("y", v6);
v70 = atof(v69);
v71 = v68;
cocos2d::CCPoint::CCPoint(&v213, v71, v70);
cocos2d::CCPoint::operator=((cocos2d::CCPoint *)(v59 + 100), v72, v73, (float *)&v213);
v74 = a1->getLayers(a1);
cocos2d::CCArray::addObject(v74, (cocos2d::_ccArray *)v59, v75);
cocos2d::CCObject::release((cocos2d::CCObject *)v59);
a1[1].m_uOrderOfArrival = 2;
v76 = v212 - 24;
if ( v212 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v153 = (unsigned int *)(v212 - 8);
do
v154 = __ldaxr(v153);
while ( __stlxr(v154 - 1, v153) );
}
else
{
v154 = *((_DWORD *)v212 - 2);
*((_DWORD *)v212 - 2) = v154 - 1;
}
if ( v154 <= 0 )
operator delete(v76);
}
v77 = v211;
v36 = v211 - 24;
if ( v211 - 24 == (char *)&qword_124B6B0 )
goto LABEL_34;
if ( &pthread_create )
{
v78 = (unsigned int *)(v211 - 8);
do
v79 = __ldaxr(v78);
while ( __stlxr(v79 - 1, v78) );
LABEL_67:
if ( v79 > 0 )
goto LABEL_34;
goto LABEL_68;
}
LABEL_140:
v79 = *((_DWORD *)v77 - 2);
*((_DWORD *)v77 - 2) = v79 - 1;
goto LABEL_67;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "objectgroup") )
{
v110 = operator new(0x58u);
cocos2d::CCTMXObjectGroup::CCTMXObjectGroup((cocos2d::CCTMXObjectGroup *)v110);
v208 = (cocos2d::CCObject *)sub_B3B360("name", v6);
v111 = strlen((const char *)v208);
sub_D1798C(v110 + 80, (const char *)v208, v111);
cocos2d::CCPoint::CCPoint(&v213);
v112 = sub_B3B360("x", v6);
v113 = atof(v112);
v213.x = v113 * *(float *)&a1[1].m_nLuaID;
v114 = sub_B3B360("y", v6);
v115 = atof(v114);
m_nTag = a1[1].m_nTag;
v213.y = v115 * *(float *)&m_nTag;
cocos2d::CCPoint::operator=(
(cocos2d::CCPoint *)(v110 + 56),
v115 * *(float *)&m_nTag,
*(float *)&m_nTag,
(float *)&v213);
v117 = a1->getObjectGroups(a1);
cocos2d::CCArray::addObject(v117, (cocos2d::_ccArray *)v110, v118);
cocos2d::CCObject::release((cocos2d::CCObject *)v110);
a1[1].m_uOrderOfArrival = 3;
goto LABEL_34;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "image") )
{
v99 = (const char *)&word_F2A0A8;
v100 = a1->getTilesets(a1);
v101 = cocos2d::CCArray::lastObject(v100);
v102 = sub_B3B360("source", v6);
sub_D153B8((int)&v211, v102);
if ( sub_D16A88((int)a1 + 136, &word_F2A0A8, -1, 1u) == -1 )
{
p_m_uIndexInArray = &v101[1].m_uIndexInArray;
if ( !*(_QWORD *)(*(_QWORD *)&a1[2].m_nTag - 24LL) )
v99 = &byte_F288A0;
sub_D18D28(&v212);
v151 = strlen(v99);
sub_D15FD4(&v212, v99, v151);
v152 = (cocos2d::CCPoint *)sub_D15E14(&v212, &v211);
v213 = *v152;
*v152 = (cocos2d::CCPoint)&byte_124B6C8;
sub_D163D4(p_m_uIndexInArray, &v213);
v104 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) == &qword_124B6B0 )
{
LABEL_96:
if ( v212 - 24 != (char *)&qword_124B6B0 )
sub_B3AF08(v212 - 24);
v105 = v211 - 24;
if ( v211 - 24 == (char *)&qword_124B6B0 )
goto LABEL_34;
LABEL_99:
sub_B3AF08(v105);
goto LABEL_34;
}
}
else
{
v103 = sub_D16A88((int)a1 + 136, &word_F2A0A8, -1, 1u);
sub_D14F84(&v212, &a1[2].m_uID, 0, v103 + 1);
sub_D18D28(&v213);
sub_D15E14(&v213, &v211);
sub_D163D4(&v101[1].m_uIndexInArray, &v213);
v104 = (void *)(*(_QWORD *)&v213 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) == &qword_124B6B0 )
goto LABEL_96;
}
sub_B3AF08(v104);
goto LABEL_96;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "data") )
{
v124 = sub_B3B360("encoding", v6);
sub_D153B8((int)&v212, v124);
v125 = sub_B3B360("compression", v6);
sub_D153B8((int)&v213, v125);
if ( !(unsigned int)sub_D171E0((int)&v212, "base64") )
{
v164 = LODWORD(a1[1].cocos2d::CCSAXDelegator::__vftable) | 2;
BYTE4(a1[1].cocos2d::CCSAXDelegator::__vftable) = 1;
LODWORD(a1[1].cocos2d::CCSAXDelegator::__vftable) = v164;
if ( (unsigned int)sub_D171E0((int)&v213, "gzip") )
{
if ( !(unsigned int)sub_D171E0((int)&v213, "zlib") )
LODWORD(a1[1].cocos2d::CCSAXDelegator::__vftable) |= 8u;
}
else
{
LODWORD(a1[1].cocos2d::CCSAXDelegator::__vftable) |= 4u;
}
if ( (unsigned int)sub_D171E0((int)&v213, &byte_F288A0) && (unsigned int)sub_D171E0((int)&v213, "gzip") )
sub_D171E0((int)&v213, "zlib");
}
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
goto LABEL_128;
}
if ( !(unsigned int)sub_D171E0((int)&v209, "object") )
{
v131 = a1->cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v206 = &v212;
v236 = 0;
v237 = 0;
v238 = 0;
v239 = 0;
v132 = v131->getObjectGroups(a1);
v133 = cocos2d::CCArray::lastObject(v132);
v208 = (cocos2d::CCObject *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary((cocos2d::CCDictionary *)v208);
v204 = (char *)&v236;
v134 = 0;
v216 = "name";
v219 = (__int64 (__fastcall **)())"height";
v217 = "type";
v205 = (float *)v133;
v218 = "width";
v220 = "gid";
do
{
v135 = (&v216)[v134];
v207 = (cocos2d::CCObject *)sub_B3B360(v135, v6);
v136 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v136, (char *)v207);
cocos2d::CCObject::autorelease(v136);
sub_D153B8((int)&v213, v135);
cocos2d::CCDictionary::setObject((__int64)v208, v136, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
++v134;
}
while ( v134 != 5 );
v137 = v205;
v138 = v204;
v139 = sub_B3B360("x", v6);
if ( v139 )
{
v140 = atoi(v139);
sprintf(v138, "%d", v140 + (int)v137[14]);
v141 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v141, v138);
cocos2d::CCObject::autorelease(v141);
sub_D153B8((int)&v213, "x");
cocos2d::CCDictionary::setObject((__int64)v208, v141, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
}
v142 = sub_B3B360("y", v6);
if ( v142 )
{
v143 = (int)(float)(*(float *)&a1[1].m_uID * *(float *)&a1[1].m_nTag) - (atoi(v142) + (int)v137[15]);
v144 = sub_B3B360("height", v6);
v145 = atoi(v144);
sprintf(v138, "%d", v143 - v145);
v146 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v146, v138);
cocos2d::CCObject::autorelease(v146);
sub_D153B8((int)&v213, "y");
cocos2d::CCDictionary::setObject((__int64)v208, v146, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
}
v147 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(float *))(*(_QWORD *)v137 + 96LL))(v137);
v148 = v208;
cocos2d::CCArray::addObject(v147, (cocos2d::_ccArray *)v208, v149);
cocos2d::CCObject::release(v148);
a1[1].m_uOrderOfArrival = 4;
goto LABEL_34;
}
if ( (unsigned int)sub_D171E0((int)&v209, "property") )
{
if ( (unsigned int)sub_D171E0((int)&v209, "polygon") )
{
sub_D171E0((int)&v209, "polyline");
}
else
{
v165 = cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)&a1[1].m_unknown2);
v166 = v165->__vftable;
v204 = (char *)v165;
v167 = (cocos2d::CCArray *)((__int64 (*)(void))v166[1].~CCObject_0)();
*(_QWORD *)v201 = cocos2d::CCArray::lastObject(v167);
v208 = (cocos2d::CCObject *)sub_B3B360("points", v6);
if ( v208 )
{
v203 = v215;
v207 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCArray::CCArray((cocos2d::CCArray *)v207);
sub_D153B8((int)&v213, (char *)v208);
sub_CF5C38(v215, &v213, 24);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
v206 = &v210;
v195 = &v209;
v210 = &byte_124B6C8;
v208 = (cocos2d::CCObject *)&v212;
v205 = (float *)v229;
format = "%d";
v196 = v6;
while ( 1 )
{
v168 = (_QWORD *)sub_CD7F9C(v203, v206, 32);
if ( (*(_DWORD *)((_BYTE *)v168 + *(_QWORD *)(*v168 - 24LL) + 32) & 5) != 0 )
break;
sub_CCFA58(v205);
v230 = 0;
v194 = &v219;
v229[27] = 0;
v231 = 0;
v232 = 0;
v233 = 0;
v234 = 0;
v235 = 0;
v216 = (char *)&unk_121D998;
v229[0] = &unk_121D9C0;
v217 = nullptr;
v200 = &unk_121D9C0;
sub_CCED04(v229, 0);
v199 = &unk_121D970;
v218 = (const char *)&unk_121D948;
v229[0] = &unk_121D970;
sub_CCED04(v229, 0);
v198 = &unk_121DA38;
v229[0] = off_111E5A8;
v219 = off_111E930;
v220 = nullptr;
v221 = 0;
v222 = 0;
v223 = 0;
v224 = 0;
v225 = 0;
v216 = (char *)off_111E558;
v218 = (const char *)off_111E580;
sub_CEBFFC(&v226);
v197 = (__int64 *)*v206;
v227 = 0;
v169 = *(v197 - 3);
v219 = off_121D820;
sub_D1527C(&v228, v197, v169, &v213);
v170 = v194;
v227 = 24;
sub_CF4060(v194, v228, 0, 0);
sub_CCED04(v205, v170);
v197 = &qword_124B6B0;
v208->__vftable = (cocos2d::CCObject_vtbl *)&byte_124B6C8;
v211 = &byte_124B6C8;
v236 = 0;
v237 = 0;
v238 = 0;
v239 = 0;
v171 = (cocos2d::CCDictionary *)operator new(0x48u);
cocos2d::CCDictionary::CCDictionary(v171);
v172 = (_QWORD *)sub_CD7F9C(&v216, &v211, 44);
if ( (*(_DWORD *)((_BYTE *)v172 + *(_QWORD *)(*v172 - 24LL) + 32) & 5) == 0 )
{
v173 = atoi(v211);
sprintf((char *)&v236, format, (unsigned int)(v173 + (int)*((float *)v204 + 14)));
v174 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v174, (char *)&v236);
cocos2d::CCObject::autorelease(v174);
sub_D153B8((int)&v213, "x");
cocos2d::CCDictionary::setObject((__int64)v171, v174, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != v197 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
}
v175 = (_QWORD *)sub_CD7F9C(&v216, v208, 44);
if ( (*(_DWORD *)((_BYTE *)v175 + *(_QWORD *)(*v175 - 24LL) + 32) & 5) == 0 )
{
v177 = atoi((const char *)v208->__vftable);
sprintf((char *)&v236, format, (unsigned int)(v177 + (int)*((float *)v204 + 15)));
v178 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v178, (char *)&v236);
cocos2d::CCObject::autorelease(v178);
sub_D153B8((int)&v213, "y");
cocos2d::CCDictionary::setObject((__int64)v171, v178, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
}
cocos2d::CCArray::addObject((cocos2d::CCArray *)v207, (cocos2d::_ccArray *)v171, v176);
cocos2d::CCObject::release(v171);
p_canEncode = &v208->__vftable[-1].canEncode;
if ( p_canEncode != (bool (__fastcall **)(cocos2d::CCObject *__hidden))&qword_124B6B0 )
sub_B3AF08(p_canEncode);
if ( v211 - 24 != (char *)&qword_124B6B0 )
sub_B3AF08(v211 - 24);
v216 = (char *)off_111E558;
v229[0] = off_111E5A8;
v218 = (const char *)off_111E580;
v219 = off_121D820;
if ( (__int64 *)(v228 - 24) != &qword_124B6B0 )
sub_B3AF08((void *)(v228 - 24));
v219 = off_111E930;
sub_CEA56C(&v226);
v218 = (const char *)&unk_121D948;
v216 = (char *)&unk_121D998;
v229[0] = off_111DB70;
sub_CCFDF8(v205);
}
v6 = v196;
v5 = (__int64 *)v195;
sub_D153B8((int)&v213, "points");
cocos2d::CCDictionary::setObject(*(__int64 *)v201, v207, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
cocos2d::CCObject::release(v207);
v180 = *v206 - 24;
if ( v180 != (char *)&qword_124B6B0 )
sub_B3AF08(v180);
sub_CF3A68(v203);
}
}
goto LABEL_34;
}
m_uOrderOfArrival = a1[1].m_uOrderOfArrival;
if ( !m_uOrderOfArrival )
goto LABEL_34;
if ( m_uOrderOfArrival == 1 )
{
v208 = (cocos2d::CCObject *)sub_B3B360("value", v6);
v183 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v183, (char *)v208);
v187 = sub_B3B360("name", v6);
sub_D153B8((int)&v212, v187);
v185 = a1->getProperties(a1);
goto LABEL_220;
}
if ( m_uOrderOfArrival == 2 )
{
v181 = a1->getLayers(a1);
v182 = cocos2d::CCArray::lastObject(v181);
v208 = (cocos2d::CCObject *)sub_B3B360("value", v6);
v183 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v183, (char *)v208);
v184 = sub_B3B360("name", v6);
sub_D153B8((int)&v212, v184);
v185 = (cocos2d::CCDictionary *)((__int64 (__fastcall *)(cocos2d::CCObject *))v182->__vftable[1].copyWithZone)(v182);
LABEL_220:
v186 = (__int64)v185;
sub_D153B8((int)&v213, v212);
cocos2d::CCDictionary::setObject(v186, v183, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
cocos2d::CCObject::release(v183);
LABEL_128:
v105 = v212 - 24;
if ( v212 - 24 == (char *)&qword_124B6B0 )
goto LABEL_34;
goto LABEL_99;
}
if ( m_uOrderOfArrival == 3 )
{
v191 = a1->getObjectGroups(a1);
v192 = cocos2d::CCArray::lastObject(v191);
v208 = (cocos2d::CCObject *)sub_B3B360("value", v6);
v160 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v160, (char *)v208);
v208 = (cocos2d::CCObject *)sub_B3B360("name", v6);
v158 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v192->__vftable[1].copyWithZone)(v192);
v161 = (char *)v208;
}
else
{
if ( m_uOrderOfArrival == 4 )
{
v188 = a1->getObjectGroups(a1);
v189 = cocos2d::CCArray::lastObject(v188);
v190 = (cocos2d::CCArray *)((__int64 (__fastcall *)(cocos2d::CCObject *))v189->__vftable[1].~CCObject_0)(v189);
v157 = cocos2d::CCArray::lastObject(v190);
}
else
{
if ( m_uOrderOfArrival != 5 )
goto LABEL_34;
v156 = cocos2d::CCTMXMapInfo::getTileProperties(a1);
v157 = cocos2d::CCDictionary::objectForKey(v156, (unsigned int)a1[1].m_unknown5);
}
v158 = (__int64)v157;
v159 = sub_B3B360("name", v6);
v208 = (cocos2d::CCObject *)sub_B3B360("value", v6);
v160 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v160, (char *)v208);
v161 = v159;
}
sub_D153B8((int)&v213, v161);
cocos2d::CCDictionary::setObject(v158, v160, (const char **)&v213);
if ( (__int64 *)(*(_QWORD *)&v213 - 24LL) != &qword_124B6B0 )
sub_B3AF08((void *)(*(_QWORD *)&v213 - 24LL));
cocos2d::CCObject::release(v160);
LABEL_34:
v37 = *(_QWORD *)(v6 + 16);
if ( v37 )
{
do
{
while ( 1 )
{
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_erase(
v6,
*(_QWORD **)(v37 + 24));
v41 = *(_QWORD *)(v37 + 16);
v42 = *(_QWORD *)(v37 + 40);
v43 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v44 = (unsigned int *)(v42 - 8);
do
v45 = __ldaxr(v44);
while ( __stlxr(v45 - 1, v44) );
}
else
{
v45 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v45 - 1;
}
if ( v45 <= 0 )
break;
}
v38 = *(_QWORD *)(v37 + 32);
v39 = (void *)(v38 - 24);
if ( (__int64 *)(v38 - 24) != &qword_124B6B0 )
goto LABEL_44;
LABEL_37:
v40 = (void *)v37;
v37 = v41;
operator delete(v40);
if ( !v41 )
goto LABEL_49;
}
operator delete(v43);
v38 = *(_QWORD *)(v37 + 32);
v39 = (void *)(v38 - 24);
if ( (__int64 *)(v38 - 24) == &qword_124B6B0 )
goto LABEL_37;
LABEL_44:
if ( &pthread_create )
{
v46 = (unsigned int *)(v38 - 8);
do
v47 = __ldaxr(v46);
while ( __stlxr(v47 - 1, v46) );
}
else
{
v47 = *(_DWORD *)(v38 - 8);
*(_DWORD *)(v38 - 8) = v47 - 1;
}
if ( v47 > 0 )
goto LABEL_37;
operator delete(v39);
v48 = (void *)v37;
v37 = v41;
operator delete(v48);
}
while ( v41 );
}
LABEL_49:
operator delete((void *)v6);
v49 = *v5;
v50 = (__int64 *)(*v5 - 24);
if ( v50 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v97 = (unsigned int *)(v49 - 8);
do
v98 = __ldaxr(v97);
while ( __stlxr(v98 - 1, v97) );
}
else
{
v98 = *(_DWORD *)(v49 - 8);
*(_DWORD *)(v49 - 8) = v98 - 1;
}
if ( v98 <= 0 )
operator delete(v50);
}
}