//
// cocos2d::CCTMXMapInfo::startElement from 0x805f30 to 0x807430 (5376 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::CCTMXMapInfo::startElement @ 0x8074c4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:01:26 +0000
//
int __fastcall cocos2d::CCTMXMapInfo::startElement(
cocos2d::CCTMXMapInfo *this,
void *a2,
const char *a3,
const char **a4)
{
size_t v7; // r0
int **v8; // r11
int v9; // r8
int v10; // r6
const char *v11; // r8
const char *v12; // r0
size_t v13; // r0
const char *v14; // r8
size_t v15; // r0
int *v16; // r0
_DWORD *v17; // r0
size_t v18; // r1
char *v19; // r2
char *v20; // r1
_UNKNOWN **v21; // r2
int *v22; // r2
int *v23; // r3
char *v24; // r0
char *v25; // r5
size_t v26; // r0
char *v27; // r0
char *v28; // r5
size_t v29; // r0
int v30; // r5
int v31; // r8
int v32; // r3
size_t v33; // r5
char *v34; // r0
float v35; // s15
char *v36; // r0
float v37; // s15
char *v38; // r0
float v39; // s15
char *v40; // r0
float v41; // s15
char **v42; // r0
char **v43; // r5
char *v44; // r0
char *v45; // r6
size_t v46; // r0
int v47; // r7
int v48; // r6
char *v49; // r9
char *v50; // r7
int v51; // t1
char *v52; // r8
int v53; // r6
char *v54; // r6
int v55; // t1
int v56; // r3
char *v57; // r1
size_t v58; // r2
_DWORD *v59; // r3
size_t v60; // r1
char *v61; // r2
int v62; // r0
size_t v63; // r1
char *v64; // r2
cocos2d::CCFileUtils *v65; // r0
int v66; // r1
char *v67; // r2
int v68; // r0
size_t v69; // r1
char *v70; // r2
char *v71; // r0
int v72; // r0
char v73; // r3
const char *v74; // r1
cocos2d::CCString *v75; // r6
char *v76; // r0
int v77; // r3
char *v78; // r0
char *v79; // r0
char *v80; // r0
char *v81; // r0
float v82; // s15
char *v83; // r0
float v84; // s15
cocos2d::CCArray *v85; // r0
cocos2d::CCArray *v86; // r0
int Object; // r5
cocos2d::CCDictionary *v88; // r6
int v89; // r5
char *v90; // r0
cocos2d::CCDictionary *TileProperties; // r0
int v92; // r3
int v93; // r6
char *v94; // r0
char *v95; // r0
float v96; // s15
char *v97; // r0
float v98; // s15
char *v99; // r0
char *v100; // r8
size_t v101; // r0
int v102; // r3
bool v103; // r0
char *v104; // r0
char *v105; // r8
size_t v106; // r0
int v107; // r8
const char *v108; // r0
unsigned int v109; // r3
char *v110; // r0
double v111; // d8
char *v112; // r0
float v113; // s15
float v114; // s14
cocos2d::CCArray *v115; // r0
int v116; // r5
char *v117; // r0
char *v118; // r0
float v119; // s15
char *v120; // r0
float v121; // s15
cocos2d::CCArray *v122; // r0
cocos2d::CCArray *v123; // r0
int v124; // r6
char *v125; // r0
char *v126; // r5
size_t v127; // r0
int v128; // r5
char *v129; // r9
int v130; // r3
char *v131; // r8
int v132; // t1
char *v133; // r9
int v134; // r5
char *v135; // r5
int v136; // t1
int v137; // r3
int v138; // r3
int v139; // r3
char *v140; // r2
char *v141; // r1
size_t v142; // r2
_DWORD *v143; // r3
size_t v144; // r1
char *v145; // r2
size_t v146; // r1
char *v147; // r2
char *v148; // r0
char *v149; // r6
size_t v150; // r0
char *v151; // r0
char *v152; // r6
size_t v153; // r0
int v154; // r3
int v155; // r6
int v156; // r9
int v157; // r6
size_t v158; // r3
int v159; // r10
cocos2d::CCArray *v160; // r0
float *v161; // r7
cocos2d::CCDictionary *v162; // r6
const char *v163; // r9
char *v164; // r8
size_t v165; // r0
char *v166; // r0
int v167; // r0
cocos2d::CCString *v168; // r9
char *v169; // r0
int v170; // r5
char *v171; // r0
int v172; // r0
cocos2d::CCString *v173; // r5
cocos2d::CCArray *v174; // r0
int v175; // r3
char *v176; // r5
cocos2d::CCString *v177; // r0
const char *v178; // r1
char *v179; // r0
char *v180; // r8
size_t v181; // r0
int v182; // r8
const char *v183; // r7
size_t v184; // r0
cocos2d::CCArray *v185; // r0
int v186; // r5
char *v187; // r4
cocos2d::CCString *v188; // r8
char *v189; // r0
char *v190; // r6
size_t v191; // r0
int v192; // r0
int v193; // r7
size_t v194; // r0
cocos2d::CCArray *v195; // r0
int v196; // r4
char *v197; // r6
cocos2d::CCString *v198; // r5
char *v199; // r6
int v200; // r8
cocos2d::CCArray *v201; // r0
int v202; // r0
cocos2d::CCArray *v203; // r0
cocos2d::CCDictionary *v204; // r0
char *v205; // r4
size_t v206; // r0
bool v207; // zf
float *v208; // r7
cocos2d::CCArray *v209; // r0
char *v210; // r8
cocos2d::CCArray *v211; // r6
size_t v212; // r0
_DWORD *v213; // r0
cocos2d::CCDictionary *v214; // r5
_DWORD *v215; // r0
const char *v216; // r0
int v217; // r0
cocos2d::CCString *v218; // r9
_DWORD *v219; // r0
const char *v220; // r0
int v221; // r0
cocos2d::CCString *v222; // r9
char *v224; // [sp+0h] [bp-1CCh]
cocos2d::CCObject *v225; // [sp+Ch] [bp-1C0h]
int *v226; // [sp+14h] [bp-1B8h]
int v227; // [sp+14h] [bp-1B8h]
float v228[2]; // [sp+38h] [bp-194h] BYREF
float v229; // [sp+40h] [bp-18Ch] BYREF
float v230; // [sp+44h] [bp-188h]
int v231; // [sp+48h] [bp-184h] BYREF
int v232; // [sp+4Ch] [bp-180h]
int v233; // [sp+50h] [bp-17Ch]
_DWORD v234[3]; // [sp+54h] [bp-178h] BYREF
_DWORD v235[2]; // [sp+60h] [bp-16Ch] BYREF
const char *v236; // [sp+68h] [bp-164h]
_DWORD v237[2]; // [sp+6Ch] [bp-160h] BYREF
const char *v238; // [sp+74h] [bp-158h]
int v239; // [sp+78h] [bp-154h] BYREF
size_t v240; // [sp+7Ch] [bp-150h]
char *v241; // [sp+80h] [bp-14Ch]
char *v242; // [sp+84h] [bp-148h] BYREF
char *v243; // [sp+88h] [bp-144h]
_UNKNOWN **v244; // [sp+8Ch] [bp-140h]
_UNKNOWN **v245; // [sp+90h] [bp-13Ch] BYREF
_BYTE v246[4]; // [sp+94h] [bp-138h] BYREF
int v247; // [sp+98h] [bp-134h]
int v248; // [sp+9Ch] [bp-130h]
int v249; // [sp+A0h] [bp-12Ch]
int v250; // [sp+A4h] [bp-128h]
int v251; // [sp+A8h] [bp-124h]
int v252; // [sp+ACh] [bp-120h]
int v253; // [sp+B0h] [bp-11Ch]
int v254; // [sp+B4h] [bp-118h]
int v255; // [sp+B8h] [bp-114h]
int v256; // [sp+BCh] [bp-110h]
int v257; // [sp+C0h] [bp-10Ch]
_DWORD v258[20]; // [sp+C4h] [bp-108h] BYREF
char v259[4]; // [sp+114h] [bp-B8h] BYREF
size_t v260; // [sp+118h] [bp-B4h]
char *v261; // [sp+11Ch] [bp-B0h]
char *v262; // [sp+120h] [bp-ACh] BYREF
char *v263; // [sp+124h] [bp-A8h] BYREF
_UNKNOWN **v264; // [sp+128h] [bp-A4h]
int v265; // [sp+12Ch] [bp-A0h]
int v266; // [sp+130h] [bp-9Ch]
int v267; // [sp+134h] [bp-98h]
int v268; // [sp+138h] [bp-94h]
int v269; // [sp+13Ch] [bp-90h]
int v270; // [sp+140h] [bp-8Ch]
int v271; // [sp+144h] [bp-88h]
int v272; // [sp+148h] [bp-84h]
int v273; // [sp+14Ch] [bp-80h]
int v274; // [sp+150h] [bp-7Ch]
_DWORD v275[20]; // [sp+154h] [bp-78h] BYREF
char v276[32]; // [sp+1A4h] [bp-28h] BYREF
v231 = 0;
v232 = 0;
v233 = 0;
v7 = strlen(a3);
std::string::__init(&v231, a3, v7);
v8 = (int **)operator new(0xCu);
v8[1] = nullptr;
v8[2] = nullptr;
*v8 = (int *)(v8 + 1);
if ( a4 && *a4 )
{
while ( 1 )
{
v11 = *a4;
if ( !*a4 )
break;
v12 = *a4;
v239 = 0;
v240 = 0;
v241 = nullptr;
v13 = strlen(v12);
std::string::__init(&v239, v11, v13);
v14 = a4[1];
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v15 = strlen(v14);
std::string::__init((int *)&v242, v14, v15);
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
if ( (v239 & 1) != 0 )
{
std::string::__init((int *)v259, v241, v240);
}
else
{
*(_DWORD *)v259 = v239;
v260 = v240;
v261 = v241;
}
v262 = nullptr;
v263 = nullptr;
v264 = nullptr;
if ( ((unsigned __int8)v242 & 1) != 0 )
{
std::string::__init((int *)&v262, v244, (size_t)v243);
}
else
{
v262 = v242;
v263 = v243;
v264 = v244;
}
v16 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__find_equal(
(int)v8,
(int **)&v229,
(unsigned __int8 *)v259);
if ( !*v16 )
{
v226 = v16;
v17 = (_DWORD *)operator new(0x28u);
v18 = v260;
v19 = v261;
v17[4] = *(_DWORD *)v259;
v17[5] = v18;
v17[6] = v19;
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v20 = v263;
v21 = v264;
v17[7] = v262;
v17[8] = v20;
v17[9] = v21;
v262 = nullptr;
v263 = nullptr;
v22 = (int *)LODWORD(v229);
v264 = nullptr;
*v17 = 0;
v17[1] = 0;
v17[2] = v22;
*v226 = (int)v17;
v23 = (int *)**v8;
if ( v23 )
*v8 = v23;
std::__tree_balance_after_insert *>(v8[1], (_DWORD *)*v226);
v8[2] = (int *)((char *)v8[2] + 1);
}
a4 += 2;
std::string::~string((int)&v262);
std::string::~string((int)v259);
std::string::~string((int)&v242);
std::string::~string((int)&v239);
}
}
v9 = (unsigned __int8)v231;
v10 = v231 & 1;
if ( v10 )
{
if ( v232 != 3 )
goto LABEL_42;
}
else if ( (int)(unsigned __int8)v231 >> 1 != 3 )
{
goto LABEL_44;
}
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "map", 3u) )
{
v24 = sub_805974("version", (int)v8);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v25 = v24;
v26 = strlen(v24);
std::string::__init((int *)&v242, v25, v26);
v27 = sub_805974("orientation", (int)v8);
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v28 = v27;
v29 = strlen(v27);
std::string::__init((int *)v259, v28, v29);
v30 = (unsigned __int8)v259[0];
v31 = v259[0] & 1;
if ( v31 )
{
if ( v260 != 10 )
goto LABEL_28;
}
else if ( (int)(unsigned __int8)v259[0] >> 1 != 10 )
{
goto LABEL_30;
}
if ( !std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, "orthogonal", 0xAu) )
{
*((_DWORD *)this + 14) = 0;
LABEL_40:
cocos2d::CCSize::CCSize(&v229);
v34 = sub_805974("width", (int)v8);
v35 = atof(v34);
v229 = v35;
v36 = sub_805974("height", (int)v8);
v37 = atof(v36);
v230 = v37;
cocos2d::CCSize::operator=((float *)this + 15, &v229);
v38 = sub_805974("tilewidth", (int)v8);
v39 = atof(v38);
v229 = v39;
v40 = sub_805974("tileheight", (int)v8);
v41 = atof(v40);
v230 = v41;
cocos2d::CCSize::operator=((float *)this + 17, &v229);
*((_DWORD *)this + 22) = 1;
std::string::~string((int)v259);
v42 = &v242;
LABEL_92:
std::string::~string((int)v42);
goto LABEL_245;
}
if ( v31 )
{
LABEL_28:
if ( v260 != 9 )
{
LABEL_34:
v33 = v260;
goto LABEL_36;
}
LABEL_31:
if ( !std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, "isometric", 9u) )
{
v32 = 2;
LABEL_39:
*((_DWORD *)this + 14) = v32;
goto LABEL_40;
}
if ( v31 )
goto LABEL_34;
LABEL_35:
v33 = v30 >> 1;
LABEL_36:
if ( v33 != 9 || std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, "hexagonal", 9u) )
goto LABEL_40;
v32 = 1;
goto LABEL_39;
}
LABEL_30:
if ( v30 >> 1 != 9 )
goto LABEL_35;
goto LABEL_31;
}
if ( v10 )
{
LABEL_42:
if ( v232 != 7 )
goto LABEL_94;
goto LABEL_45;
}
LABEL_44:
if ( v9 >> 1 != 7 )
goto LABEL_96;
LABEL_45:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "tileset", 7u) )
{
v43 = (char **)&v239;
v44 = sub_805974("source", (int)v8);
v239 = 0;
v240 = 0;
v241 = nullptr;
v45 = v44;
v46 = strlen(v44);
std::string::__init(&v239, v45, v46);
if ( (v239 & 1) != 0 )
v47 = v240;
else
v47 = (int)(unsigned __int8)v239 >> 1;
if ( v47 || std::string::compare((unsigned __int8 *)&v239, 0, 0xFFFFFFFF, &unk_B6B226, 0) )
{
v48 = *((unsigned __int8 *)this + 108);
if ( (v48 & 1) != 0 )
{
v49 = *((char **)this + 29);
}
else
{
v49 = (char *)this + 109;
v47 = v48 >> 1;
}
if ( (v48 & 1) != 0 )
v47 = *((_DWORD *)this + 28);
v50 = &v49[v47];
do
{
if ( v50 == v49 )
goto LABEL_71;
v51 = (unsigned __int8)*--v50;
}
while ( !memchr("/", v51, 1u) );
if ( v50 - v49 == -1 )
{
LABEL_71:
std::operator+((unsigned int *)&v242, (unsigned __int8 *)this + 120, "/");
if ( (v239 & 1) != 0 )
{
v57 = v241;
v58 = v240;
}
else
{
v58 = (int)(unsigned __int8)v239 >> 1;
v57 = (char *)&v239 + 1;
}
v59 = std::string::append(&v242, v57, v58);
v60 = v59[1];
v61 = (char *)v59[2];
*(_DWORD *)v259 = *v59;
v260 = v60;
v261 = v61;
*v59 = 0;
v59[1] = 0;
v59[2] = 0;
if ( (v239 & 1) != 0 )
{
*v241 = 0;
v240 = 0;
}
else
{
LOWORD(v239) = 0;
}
goto LABEL_76;
}
if ( (v48 & 1) != 0 )
{
v52 = *((char **)this + 29);
v53 = *((_DWORD *)this + 28);
}
else
{
v52 = (char *)this + 109;
v53 = v48 >> 1;
}
v54 = &v52[v53];
while ( v54 != v52 )
{
v55 = (unsigned __int8)*--v54;
if ( memchr("/", v55, 1u) )
{
v56 = v54 - v52;
goto LABEL_68;
}
}
v56 = -1;
LABEL_68:
v224 = (char *)this + 108;
std::string::basic_string((int *)&v242, (unsigned __int8 *)this + 108, 0, v56 + 1);
std::operator+((int *)v259, (unsigned __int8 *)&v242, (unsigned __int8 *)&v239);
if ( (v239 & 1) != 0 )
{
*v241 = 0;
v240 = 0;
}
else
{
LOWORD(v239) = 0;
}
LABEL_76:
std::string::reserve(&v239, 0);
v62 = *(_DWORD *)v259;
v63 = v260;
v64 = v261;
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v239 = v62;
v240 = v63;
v241 = v64;
std::string::~string((int)v259);
v65 = (cocos2d::CCFileUtils *)std::string::~string((int)&v242);
v66 = cocos2d::CCFileUtils::sharedFileUtils(v65);
if ( (v239 & 1) != 0 )
v67 = v241;
else
v67 = (char *)&v239 + 1;
(*(void (__fastcall **)(char *, int, char *, _DWORD, char *))(*(_DWORD *)v66 + 24))(v259, v66, v67, 0, v224);
if ( (v239 & 1) != 0 )
{
*v241 = 0;
v240 = 0;
}
else
{
LOWORD(v239) = 0;
}
std::string::reserve(&v239, 0);
v68 = *(_DWORD *)v259;
v69 = v260;
v70 = v261;
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v239 = v68;
v240 = v69;
v241 = v70;
std::string::~string((int)v259);
v71 = sub_805974("firstgid", (int)v8);
v72 = atoi(v71);
v73 = v239;
*((_DWORD *)this + 37) = v72;
if ( (v73 & 1) != 0 )
v74 = v241;
else
v74 = (char *)&v239 + 1;
cocos2d::CCTMXMapInfo::parseXMLFile(this, v74);
goto LABEL_91;
}
v75 = (cocos2d::CCString *)operator new(0x68u);
cocos2d::CCTMXTilesetInfo::CCTMXTilesetInfo(v75);
v76 = sub_805974("name", (int)v8);
std::string::assign((int *)v75 + 13, v76);
v77 = *((_DWORD *)this + 37);
if ( v77 )
{
*((_DWORD *)v75 + 16) = v77;
*((_DWORD *)this + 37) = 0;
}
else
{
v78 = sub_805974("firstgid", (int)v8);
*((_DWORD *)v75 + 16) = atoi(v78);
}
v79 = sub_805974("spacing", (int)v8);
*((_DWORD *)v75 + 19) = atoi(v79);
v80 = sub_805974("margin", (int)v8);
*((_DWORD *)v75 + 20) = atoi(v80);
cocos2d::CCSize::CCSize(&v229);
v81 = sub_805974("tilewidth", (int)v8);
v82 = atof(v81);
v229 = v82;
v83 = sub_805974("tileheight", (int)v8);
v84 = atof(v83);
v230 = v84;
cocos2d::CCSize::operator=((float *)v75 + 17, &v229);
v85 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 48))(this);
cocos2d::CCArray::addObject(v85, v75);
goto LABEL_90;
}
if ( !v10 )
{
LABEL_96:
if ( v9 >> 1 != 4 )
goto LABEL_102;
goto LABEL_97;
}
LABEL_94:
if ( v232 != 4 )
goto LABEL_100;
LABEL_97:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "tile", 4u) )
{
v86 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 48))(this);
Object = cocos2d::CCArray::lastObject(v86);
v88 = (cocos2d::CCDictionary *)operator new(0x3Cu);
cocos2d::CCDictionary::CCDictionary(v88);
v89 = *(_DWORD *)(Object + 64);
v90 = sub_805974("id", (int)v8);
*((_DWORD *)this + 23) = atoi(v90) + v89;
TileProperties = (cocos2d::CCDictionary *)cocos2d::CCTMXMapInfo::getTileProperties(this);
cocos2d::CCDictionary::setObject(TileProperties, v88, *((_DWORD *)this + 23));
cocos2d::CCObject::release(v88);
v92 = 5;
LABEL_127:
*((_DWORD *)this + 22) = v92;
goto LABEL_245;
}
if ( v10 )
{
LABEL_100:
if ( v232 != 5 )
goto LABEL_122;
goto LABEL_103;
}
LABEL_102:
if ( v9 >> 1 != 5 )
goto LABEL_124;
LABEL_103:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "layer", 5u) )
{
v93 = operator new(0x64u);
cocos2d::CCTMXLayerInfo::CCTMXLayerInfo((cocos2d::CCTMXLayerInfo *)v93);
v94 = sub_805974("name", (int)v8);
std::string::assign((int *)(v93 + 56), v94);
cocos2d::CCSize::CCSize(v228);
v95 = sub_805974("width", (int)v8);
v96 = atof(v95);
v228[0] = v96;
v97 = sub_805974("height", (int)v8);
v98 = atof(v97);
v228[1] = v98;
cocos2d::CCSize::operator=((float *)(v93 + 68), v228);
v43 = &v242;
v99 = sub_805974("visible", (int)v8);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v100 = v99;
v101 = strlen(v99);
std::string::__init((int *)&v242, v100, v101);
if ( ((unsigned __int8)v242 & 1) != 0 )
v102 = (int)v243;
else
v102 = (int)(unsigned __int8)v242 >> 1;
v103 = v102 == 1 && std::string::compare((unsigned __int8 *)&v242, 0, 0xFFFFFFFF, "0", 1u) == 0;
*(_BYTE *)(v93 + 80) = !v103;
v104 = sub_805974("opacity", (int)v8);
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v105 = v104;
v106 = strlen(v104);
std::string::__init((int *)v259, v105, v106);
v107 = v259[0] & 1;
if ( v107 )
{
if ( v260 )
{
LABEL_116:
v108 = v261;
LABEL_118:
v109 = (unsigned int)(atof(v108) * 255.0);
LABEL_120:
*(_BYTE *)(v93 + 81) = v109;
v110 = sub_805974("x", (int)v8);
v111 = atof(v110);
v112 = sub_805974("y", (int)v8);
v113 = atof(v112);
v114 = v111;
cocos2d::CCPoint::CCPoint(&v229, v114, v113);
cocos2d::CCPoint::operator=((float *)(v93 + 92), &v229);
v115 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 40))(this);
cocos2d::CCArray::addObject(v115, (cocos2d::CCObject *)v93);
cocos2d::CCObject::release((_DWORD *)v93);
*((_DWORD *)this + 22) = 2;
LABEL_186:
std::string::~string((int)v259);
goto LABEL_91;
}
}
else if ( (unsigned __int8)v259[0] >> 1 )
{
goto LABEL_117;
}
if ( !std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, &unk_B6B226, 0) )
{
LOBYTE(v109) = -1;
goto LABEL_120;
}
if ( v107 )
goto LABEL_116;
LABEL_117:
v108 = &v259[1];
goto LABEL_118;
}
if ( !v10 )
{
LABEL_124:
if ( v9 >> 1 != 11 )
goto LABEL_131;
goto LABEL_125;
}
LABEL_122:
if ( v232 != 11 )
goto LABEL_129;
LABEL_125:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "objectgroup", 0xBu) )
{
v116 = operator new(0x50u);
cocos2d::CCTMXObjectGroup::CCTMXObjectGroup((cocos2d::CCTMXObjectGroup *)v116);
v117 = sub_805974("name", (int)v8);
std::string::assign((int *)(v116 + 68), v117);
cocos2d::CCPoint::CCPoint(&v229);
v118 = sub_805974("x", (int)v8);
v119 = atof(v118);
v229 = v119 * *((float *)this + 17);
v120 = sub_805974("y", (int)v8);
v121 = atof(v120);
v230 = v121 * *((float *)this + 18);
cocos2d::CCPoint::operator=((float *)(v116 + 52), &v229);
v122 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 56))(this);
cocos2d::CCArray::addObject(v122, (cocos2d::CCObject *)v116);
cocos2d::CCObject::release((_DWORD *)v116);
v92 = 3;
goto LABEL_127;
}
if ( v10 )
{
LABEL_129:
if ( v232 != 5 )
goto LABEL_164;
goto LABEL_132;
}
LABEL_131:
if ( v9 >> 1 != 5 )
goto LABEL_166;
LABEL_132:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "image", 5u) )
{
v123 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 48))(this);
v124 = cocos2d::CCArray::lastObject(v123);
v125 = sub_805974("source", (int)v8);
v239 = 0;
v240 = 0;
v241 = nullptr;
v126 = v125;
v127 = strlen(v125);
std::string::__init(&v239, v126, v127);
v128 = *((unsigned __int8 *)this + 108);
if ( (v128 & 1) != 0 )
{
v129 = *((char **)this + 29);
v130 = *((_DWORD *)this + 28);
}
else
{
v129 = (char *)this + 109;
v130 = v128 >> 1;
}
v131 = &v129[v130];
do
{
if ( v131 == v129 )
goto LABEL_151;
v132 = (unsigned __int8)*--v131;
}
while ( !memchr("/", v132, 1u) );
if ( v131 - v129 == -1 )
{
LABEL_151:
v138 = *((unsigned __int8 *)this + 120);
if ( (v138 & 1) != 0 )
v139 = *((_DWORD *)this + 31);
else
v139 = v138 >> 1;
if ( v139 )
v140 = "/";
else
v140 = (char *)&unk_B6B226;
std::operator+((unsigned int *)&v242, (unsigned __int8 *)this + 120, v140);
if ( (v239 & 1) != 0 )
{
v141 = v241;
v142 = v240;
}
else
{
v142 = (int)(unsigned __int8)v239 >> 1;
v141 = (char *)&v239 + 1;
}
v143 = std::string::append(&v242, v141, v142);
v144 = v143[1];
v145 = (char *)v143[2];
*(_DWORD *)v259 = *v143;
v260 = v144;
v261 = v145;
*v143 = 0;
v143[1] = 0;
v143[2] = 0;
if ( (*(_BYTE *)(v124 + 84) & 1) != 0 )
{
**(_BYTE **)(v124 + 92) = 0;
*(_DWORD *)(v124 + 88) = 0;
}
else
{
*(_BYTE *)(v124 + 85) = 0;
*(_BYTE *)(v124 + 84) = 0;
}
goto LABEL_162;
}
if ( (v128 & 1) != 0 )
{
v133 = *((char **)this + 29);
v134 = *((_DWORD *)this + 28);
}
else
{
v133 = (char *)this + 109;
v134 = v128 >> 1;
}
v135 = &v133[v134];
while ( v135 != v133 )
{
v136 = (unsigned __int8)*--v135;
if ( memchr("/", v136, 1u) )
{
v137 = v135 - v133;
goto LABEL_148;
}
}
v137 = -1;
LABEL_148:
std::string::basic_string((int *)&v242, (unsigned __int8 *)this + 108, 0, v137 + 1);
std::operator+((int *)v259, (unsigned __int8 *)&v242, (unsigned __int8 *)&v239);
if ( (*(_BYTE *)(v124 + 84) & 1) != 0 )
{
**(_BYTE **)(v124 + 92) = 0;
*(_DWORD *)(v124 + 88) = 0;
}
else
{
*(_BYTE *)(v124 + 85) = 0;
*(_BYTE *)(v124 + 84) = 0;
}
LABEL_162:
std::string::reserve((int *)(v124 + 84), 0);
v146 = v260;
v147 = v261;
*(_DWORD *)(v124 + 84) = *(_DWORD *)v259;
*(_DWORD *)(v124 + 88) = v146;
*(_DWORD *)(v124 + 92) = v147;
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
std::string::~string((int)v259);
std::string::~string((int)&v242);
v42 = (char **)&v239;
goto LABEL_92;
}
if ( !v10 )
{
LABEL_166:
if ( v9 >> 1 != 4 )
goto LABEL_190;
goto LABEL_167;
}
LABEL_164:
if ( v232 != 4 )
goto LABEL_188;
LABEL_167:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "data", 4u) )
{
v43 = &v242;
v148 = sub_805974("encoding", (int)v8);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v149 = v148;
v150 = strlen(v148);
std::string::__init((int *)&v242, v149, v150);
v151 = sub_805974("compression", (int)v8);
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v152 = v151;
v153 = strlen(v151);
std::string::__init((int *)v259, v152, v153);
if ( ((unsigned __int8)v242 & 1) != 0 )
v154 = (int)v243;
else
v154 = (int)(unsigned __int8)v242 >> 1;
if ( v154 != 6 || std::string::compare((unsigned __int8 *)&v242, 0, 0xFFFFFFFF, "base64", 6u) )
goto LABEL_186;
v155 = *((_DWORD *)this + 24);
v156 = (unsigned __int8)v259[0];
*((_DWORD *)this + 24) = v155 | 2;
*((_BYTE *)this + 100) = 1;
if ( (v156 & 1) != 0 )
{
if ( v260 != 4 )
{
LABEL_180:
v158 = v260;
goto LABEL_182;
}
}
else if ( v156 >> 1 != 4 )
{
goto LABEL_181;
}
if ( !std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, "gzip", 4u) )
{
v157 = v155 | 6;
LABEL_185:
*((_DWORD *)this + 24) = v157;
goto LABEL_186;
}
if ( (v156 & 1) != 0 )
goto LABEL_180;
LABEL_181:
v158 = v156 >> 1;
LABEL_182:
if ( v158 != 4 || std::string::compare((unsigned __int8 *)v259, 0, 0xFFFFFFFF, "zlib", 4u) )
goto LABEL_186;
v157 = v155 | 0xA;
goto LABEL_185;
}
if ( v10 )
{
LABEL_188:
if ( v232 != 6 )
goto LABEL_200;
goto LABEL_191;
}
LABEL_190:
if ( v9 >> 1 != 6 )
goto LABEL_202;
LABEL_191:
v159 = std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "object", 6u);
if ( !v159 )
{
memset(v276, 0, sizeof(v276));
v160 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 56))(this);
v161 = (float *)cocos2d::CCArray::lastObject(v160);
v162 = (cocos2d::CCDictionary *)operator new(0x3Cu);
cocos2d::CCDictionary::CCDictionary(v162);
*(char **)v259 = off_D20058[0];
v260 = (size_t)off_D2005C[0];
v261 = off_D20060[0];
v262 = off_D20064[0];
v263 = off_D20068;
do
{
v163 = *(const char **)&v259[4 * v159++];
v164 = sub_805974(v163, (int)v8);
v225 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCString::CCString(v225, v164);
cocos2d::CCObject::autorelease(v225);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v165 = strlen(v163);
std::string::__init((int *)&v242, v163, v165);
cocos2d::CCDictionary::setObject((int)v162, v225, (int)&v242);
std::string::~string((int)&v242);
}
while ( v159 != 5 );
v166 = sub_805974("x", (int)v8);
if ( v166 )
{
v167 = atoi(v166);
sub_993BD0(v276, "%d", (int)v161[13] + v167);
v168 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v168, v276);
cocos2d::CCObject::autorelease(v168);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
std::string::__init((int *)&v242, "x", 1u);
cocos2d::CCDictionary::setObject((int)v162, v168, (int)&v242);
std::string::~string((int)&v242);
}
v169 = sub_805974("y", (int)v8);
if ( v169 )
{
v170 = (int)(float)(*((float *)this + 16) * *((float *)this + 18)) - (atoi(v169) + (int)v161[14]);
v171 = sub_805974("height", (int)v8);
v172 = atoi(v171);
sub_993BD0(v276, "%d", v170 - v172);
v173 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v173, v276);
cocos2d::CCObject::autorelease(v173);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
std::string::__init((int *)&v242, "y", 1u);
cocos2d::CCDictionary::setObject((int)v162, v173, (int)&v242);
std::string::~string((int)&v242);
}
v174 = (cocos2d::CCArray *)(*(int (__fastcall **)(float *))(*(_DWORD *)v161 + 48))(v161);
cocos2d::CCArray::addObject(v174, v162);
cocos2d::CCObject::release(v162);
v92 = 4;
goto LABEL_127;
}
if ( !v10 )
{
LABEL_202:
if ( v9 >> 1 != 8 )
goto LABEL_226;
goto LABEL_203;
}
LABEL_200:
if ( v232 == 8 )
{
LABEL_203:
if ( !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "property", 8u) )
{
v175 = *((_DWORD *)this + 22);
if ( !v175 )
goto LABEL_245;
if ( v175 != 1 )
{
if ( v175 != 2 )
{
if ( v175 == 3 )
{
v195 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 56))(this);
v196 = cocos2d::CCArray::lastObject(v195);
v197 = sub_805974("value", (int)v8);
v198 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v198, v197);
v199 = sub_805974("name", (int)v8);
v200 = (*(int (__fastcall **)(int))(*(_DWORD *)v196 + 40))(v196);
}
else
{
if ( v175 == 4 )
{
v201 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 56))(this);
v202 = cocos2d::CCArray::lastObject(v201);
v203 = (cocos2d::CCArray *)(*(int (__fastcall **)(int))(*(_DWORD *)v202 + 48))(v202);
v200 = cocos2d::CCArray::lastObject(v203);
v199 = sub_805974("name", (int)v8);
}
else
{
if ( v175 != 5 )
goto LABEL_245;
v204 = (cocos2d::CCDictionary *)cocos2d::CCTMXMapInfo::getTileProperties(this);
v200 = cocos2d::CCDictionary::objectForKey(v204, *((_DWORD *)this + 23));
v199 = sub_805974("name", (int)v8);
}
v205 = sub_805974("value", (int)v8);
v198 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v198, v205);
}
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v206 = strlen(v199);
std::string::__init((int *)v259, v199, v206);
cocos2d::CCDictionary::setObject(v200, v198, (int)v259);
std::string::~string((int)v259);
cocos2d::CCObject::release(v198);
goto LABEL_245;
}
v185 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 40))(this);
v186 = cocos2d::CCArray::lastObject(v185);
v187 = sub_805974("value", (int)v8);
v188 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v188, v187);
v189 = sub_805974("name", (int)v8);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v190 = v189;
v191 = strlen(v189);
std::string::__init((int *)&v242, v190, v191);
v192 = (*(int (__fastcall **)(int))(*(_DWORD *)v186 + 40))(v186);
if ( ((unsigned __int8)v242 & 1) == 0 )
v190 = (char *)&v242 + 1;
*(_DWORD *)v259 = 0;
if ( ((unsigned __int8)v242 & 1) != 0 )
v190 = (char *)v244;
v260 = 0;
v261 = nullptr;
v193 = v192;
v194 = strlen(v190);
std::string::__init((int *)v259, v190, v194);
cocos2d::CCDictionary::setObject(v193, v188, (int)v259);
std::string::~string((int)v259);
cocos2d::CCObject::release(v188);
v42 = &v242;
goto LABEL_92;
}
v176 = sub_805974("value", (int)v8);
v177 = (cocos2d::CCString *)operator new(0x40u);
v178 = v176;
v43 = &v242;
v75 = v177;
cocos2d::CCString::CCString(v177, v178);
v179 = sub_805974("name", (int)v8);
v242 = nullptr;
v243 = nullptr;
v244 = nullptr;
v180 = v179;
v181 = strlen(v179);
std::string::__init((int *)&v242, v180, v181);
v182 = (*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)this + 64))(this);
if ( ((unsigned __int8)v242 & 1) != 0 )
v183 = (const char *)v244;
else
v183 = (char *)&v242 + 1;
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v184 = strlen(v183);
std::string::__init((int *)v259, v183, v184);
cocos2d::CCDictionary::setObject(v182, v75, (int)v259);
std::string::~string((int)v259);
LABEL_90:
cocos2d::CCObject::release(v75);
LABEL_91:
v42 = v43;
goto LABEL_92;
}
if ( v10 )
goto LABEL_225;
LABEL_226:
v207 = v9 >> 1 == 7;
goto LABEL_227;
}
LABEL_225:
v207 = v232 == 7;
LABEL_227:
if ( v207 && !std::string::compare((unsigned __int8 *)&v231, 0, 0xFFFFFFFF, "polygon", 7u) )
{
v208 = (float *)cocos2d::CCArray::lastObject(*((cocos2d::CCArray **)this + 21));
v209 = (cocos2d::CCArray *)(*(int (__fastcall **)(float *))(*(_DWORD *)v208 + 48))(v208);
v227 = cocos2d::CCArray::lastObject(v209);
v210 = sub_805974("points", (int)v8);
if ( v210 )
{
v211 = (cocos2d::CCArray *)operator new(0x38u);
cocos2d::CCArray::CCArray(v211);
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
v212 = strlen(v210);
std::string::__init((int *)v259, v210, v212);
v243 = nullptr;
v258[0] = &unk_C99358;
v242 = (char *)&unk_C99344;
std::ios_base::init((std::ios_base *)v258, &v245);
v258[19] = -1;
v258[18] = 0;
v242 = (char *)&off_C993D4;
v258[0] = &off_C993FC;
v244 = &off_C993E8;
v245 = &off_C99178;
std::locale::locale((std::locale *)v246);
v245 = &off_C992D8;
v257 = 24;
v247 = 0;
v248 = 0;
v249 = 0;
v250 = 0;
v251 = 0;
v252 = 0;
v253 = 0;
v254 = 0;
v255 = 0;
v256 = 0;
std::stringbuf::str((int)&v245, (unsigned __int8 *)v259);
std::string::~string((int)v259);
memset(v234, 0, sizeof(v234));
while ( 1 )
{
v213 = std::getline,std::allocator>(&v242, (int)v234, 32);
if ( (*(_DWORD *)((char *)v213 + *(_DWORD *)(*v213 - 12) + 16) & 5) != 0 )
break;
v275[0] = &unk_C99358;
*(_DWORD *)v259 = &unk_C99344;
v260 = 0;
std::ios_base::init((std::ios_base *)v275, &v262);
v275[19] = -1;
*(_DWORD *)v259 = &off_C993D4;
v275[0] = &off_C993FC;
v261 = (char *)&off_C993E8;
v275[18] = 0;
v262 = (char *)&off_C99178;
std::locale::locale((std::locale *)&v263);
v264 = nullptr;
v265 = 0;
v262 = (char *)&off_C992D8;
v266 = 0;
v274 = 24;
v267 = 0;
v268 = 0;
v269 = 0;
v270 = 0;
v271 = 0;
v272 = 0;
v273 = 0;
std::stringbuf::str((int)&v262, (unsigned __int8 *)v234);
v235[0] = 0;
v235[1] = 0;
v236 = nullptr;
v237[0] = 0;
v237[1] = 0;
v238 = nullptr;
memset(v276, 0, sizeof(v276));
v214 = (cocos2d::CCDictionary *)operator new(0x3Cu);
cocos2d::CCDictionary::CCDictionary(v214);
v215 = std::getline,std::allocator>(v259, (int)v235, 44);
if ( (*(_DWORD *)((char *)v215 + *(_DWORD *)(*v215 - 12) + 16) & 5) == 0 )
{
if ( (v235[0] & 1) != 0 )
v216 = v236;
else
v216 = (char *)v235 + 1;
v217 = atoi(v216);
sub_993BD0(v276, "%d", (int)v208[13] + v217);
v218 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v218, v276);
cocos2d::CCObject::autorelease(v218);
v239 = 0;
v240 = 0;
v241 = nullptr;
std::string::__init(&v239, "x", 1u);
cocos2d::CCDictionary::setObject((int)v214, v218, (int)&v239);
std::string::~string((int)&v239);
}
v219 = std::getline,std::allocator>(v259, (int)v237, 44);
if ( (*(_DWORD *)((char *)v219 + *(_DWORD *)(*v219 - 12) + 16) & 5) == 0 )
{
if ( (v237[0] & 1) != 0 )
v220 = v238;
else
v220 = (char *)v237 + 1;
v221 = atoi(v220);
sub_993BD0(v276, "%d", (int)v208[14] + v221);
v222 = (cocos2d::CCString *)operator new(0x40u);
cocos2d::CCString::CCString(v222, v276);
cocos2d::CCObject::autorelease(v222);
v239 = 0;
v240 = 0;
v241 = nullptr;
std::string::__init(&v239, "y", 1u);
cocos2d::CCDictionary::setObject((int)v214, v222, (int)&v239);
std::string::~string((int)&v239);
}
cocos2d::CCArray::addObject(v211, v214);
cocos2d::CCObject::release(v214);
std::string::~string((int)v237);
std::string::~string((int)v235);
std::basic_stringstream,std::allocator>::~basic_stringstream(v259);
}
*(_DWORD *)v259 = 0;
v260 = 0;
v261 = nullptr;
std::string::__init((int *)v259, "points", 6u);
cocos2d::CCDictionary::setObject(v227, v211, (int)v259);
std::string::~string((int)v259);
cocos2d::CCObject::release(v211);
std::string::~string((int)v234);
std::basic_stringstream,std::allocator>::~basic_stringstream(&v242);
}
}
LABEL_245:
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::destroy(
(int)v8,
v8[1]);
v8[2] = nullptr;
*v8 = (int *)(v8 + 1);
v8[1] = nullptr;
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::destroy(
(int)v8,
nullptr);
operator delete(v8);
return std::string::~string((int)&v231);
}