//
// cocos2d::CCTMXMapInfo::endElement from 0x805ab8 to 0x805c9c (484 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::CCTMXMapInfo::endElement @ 0x805cbc
//
// 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:24 +0000
//
int __fastcall cocos2d::CCTMXMapInfo::endElement(cocos2d::CCTMXMapInfo *this, void *a2, const char *a3)
{
const char *v3; // r9
size_t v6; // r0
int v7; // r4
int v8; // r7
int v9; // r3
int v10; // r1
int v11; // r3
cocos2d::CCArray *v12; // r0
int Object; // r0
bool v14; // nf
int v15; // r4
size_t v16; // r0
cocos2d *v17; // r0
int v18; // r1
int v19; // r0
cocos2d::ZipUtils *v20; // r3
unsigned __int8 *v21; // r9
size_t v22; // r4
size_t v24; // [sp+0h] [bp-3Ch]
cocos2d::ZipUtils *v25; // [sp+8h] [bp-34h] BYREF
cocos2d::ZipUtils *v26; // [sp+Ch] [bp-30h] BYREF
int v27; // [sp+10h] [bp-2Ch] BYREF
float v28[2]; // [sp+14h] [bp-28h] BYREF
int v29; // [sp+1Ch] [bp-20h] BYREF
size_t v30; // [sp+20h] [bp-1Ch]
int v31; // [sp+24h] [bp-18h]
int v32; // [sp+28h] [bp-14h] BYREF
int v33; // [sp+2Ch] [bp-10h]
cocos2d *v34; // [sp+30h] [bp-Ch]
v29 = 0;
v30 = 0;
v31 = 0;
v6 = strlen(a3);
std::string::__init(&v29, a3, v6);
v7 = (unsigned __int8)v29;
v8 = v29 & 1;
if ( v8 )
{
if ( v30 != 4 )
goto LABEL_21;
}
else if ( (int)(unsigned __int8)v29 >> 1 != 4 )
{
goto LABEL_23;
}
if ( std::string::compare((unsigned __int8 *)&v29, 0, 0xFFFFFFFF, "data", 4u)
|| (v9 = *((_DWORD *)this + 24), v10 = v9 << 30, (v9 & 2) == 0) )
{
if ( v8 )
{
LABEL_21:
if ( v30 != 3 )
goto LABEL_27;
LABEL_24:
if ( !std::string::compare((unsigned __int8 *)&v29, 0, 0xFFFFFFFF, "map", 3u) )
goto LABEL_25;
if ( v8 )
{
LABEL_27:
if ( v30 != 5 )
goto LABEL_32;
LABEL_30:
if ( !std::string::compare((unsigned __int8 *)&v29, 0, 0xFFFFFFFF, "layer", 5u) )
goto LABEL_25;
if ( v8 )
{
LABEL_32:
if ( v30 != 11 )
{
LABEL_37:
v22 = v30;
LABEL_39:
if ( v22 != 6 || std::string::compare((unsigned __int8 *)&v29, 0, 0xFFFFFFFF, "object", 6u) )
return std::string::~string((int)&v29);
LABEL_25:
*((_DWORD *)this + 22) = 0;
return std::string::~string((int)&v29);
}
LABEL_35:
if ( !std::string::compare((unsigned __int8 *)&v29, 0, 0xFFFFFFFF, "objectgroup", 0xBu) )
goto LABEL_25;
if ( v8 )
goto LABEL_37;
LABEL_38:
v22 = v7 >> 1;
goto LABEL_39;
}
LABEL_34:
if ( v7 >> 1 != 11 )
goto LABEL_38;
goto LABEL_35;
}
LABEL_29:
if ( v7 >> 1 != 5 )
goto LABEL_34;
goto LABEL_30;
}
LABEL_23:
if ( v7 >> 1 != 3 )
goto LABEL_29;
goto LABEL_24;
}
v11 = *(_DWORD *)this;
*((_BYTE *)this + 100) = 0;
v12 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *, int))(v11 + 40))(this, v10);
Object = cocos2d::CCArray::lastObject(v12);
v14 = (*((_BYTE *)this + 132) & 1) != 0;
if ( (*((_BYTE *)this + 132) & 1) == 0 )
v3 = (char *)this + 133;
v32 = 0;
if ( v14 )
v3 = *((const char **)this + 35);
v33 = 0;
v34 = nullptr;
v15 = Object;
v16 = strlen(v3);
std::string::__init(&v32, v3, v16);
if ( (v32 & 1) != 0 )
{
v17 = v34;
v18 = v33;
}
else
{
v18 = (int)(unsigned __int8)v32 >> 1;
v17 = (cocos2d *)((char *)&v32 + 1);
}
v19 = base64Decode(v17, (const unsigned __int8 *)v18, (void **)&v25, nullptr);
v20 = v25;
v21 = (unsigned __int8 *)v19;
if ( v25 )
{
if ( (*((_DWORD *)this + 24) & 0xC) == 0 )
goto LABEL_18;
cocos2d::CCSize::CCSize(v28, (const cocos2d::CCSize *)(v15 + 68));
cocos2d::ZipUtils::ccInflateMemoryWithHint(
v25,
v21,
(void **)&v26,
(unsigned __int8 **)vcvts_n_s32_f32(v28[0] * v28[1], 2u),
v24);
v27 = (int)&v27;
if ( v25 )
operator delete[](v25);
v25 = nullptr;
v20 = v26;
if ( v26 )
{
LABEL_18:
*(_DWORD *)(v15 + 76) = v20;
std::string::assign((int *)this + 33, (char *)&unk_B6B226);
}
}
std::string::~string((int)&v32);
return std::string::~string((int)&v29);
}