//
// cocos2d::CCTMXTiledMap::buildWithMapInfo from 0xdacf24 to 0xdad134 (528 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXTiledMap::initWithTMXFile @ 0xdad184
// > cocos2d::CCTMXTiledMap::initWithXML @ 0xdad26c
// > ??> @ 0xd8ad8
//
// This function is hookable on this platform (idp: arm, 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 13:08:36 +0000
//
__int64 __fastcall cocos2d::CCTMXTiledMap::buildWithMapInfo(cocos2d::CCTMXTiledMap *this, cocos2d::CCTMXMapInfo *a2)
{
_DWORD *v4; // x0
__int64 v5; // x0
_DWORD *v6; // x0
__int64 v7; // x0
_DWORD *v8; // x0
__int64 TileProperties; // x0
cocos2d::CCArray *v10; // x0
cocos2d::CCArray *v11; // x20
unsigned int *v13; // x0
cocos2d::CCTMXLayerInfo **v14; // x20
cocos2d::CCTMXLayerInfo **v15; // x22
cocos2d::CCTMXLayerInfo *v16; // x1
unsigned int v17; // w25
cocos2d::CCTMXLayer *v18; // x26
__int64 v19; // x26
const cocos2d::CCSize *v20; // x0
float v21; // s1
float v22; // s0
__int64 v23; // x2
float v24; // [xsp+50h] [xbp+50h] BYREF
float v25; // [xsp+54h] [xbp+54h]
cocos2d::CCSize::operator=((float *)this + 79, (float *)a2 + 17);
cocos2d::CCSize::operator=((float *)this + 81, (float *)a2 + 19);
v4 = *((_DWORD **)this + 42);
*((_DWORD *)this + 83) = *((_DWORD *)a2 + 16);
if ( v4 )
cocos2d::CCObject::release(v4);
v5 = (*(__int64 (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_QWORD *)a2 + 112LL))(a2);
*((_QWORD *)this + 42) = v5;
if ( v5 )
cocos2d::CCObject::retain(v5);
v6 = *((_DWORD **)this + 43);
if ( v6 )
cocos2d::CCObject::release(v6);
v7 = (*(__int64 (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_QWORD *)a2 + 128LL))(a2);
*((_QWORD *)this + 43) = v7;
if ( v7 )
cocos2d::CCObject::retain(v7);
v8 = *((_DWORD **)this + 44);
if ( v8 )
cocos2d::CCObject::release(v8);
TileProperties = cocos2d::CCTMXMapInfo::getTileProperties(a2);
*((_QWORD *)this + 44) = TileProperties;
if ( TileProperties )
cocos2d::CCObject::retain(TileProperties);
v10 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_QWORD *)a2 + 80LL))(a2);
v11 = v10;
if ( v10 )
{
if ( (unsigned int)cocos2d::CCArray::count(v10) )
{
v13 = *((unsigned int **)v11 + 7);
if ( *v13 )
{
v14 = *((cocos2d::CCTMXLayerInfo ***)v13 + 2);
v15 = &v14[*v13 - 1];
if ( v14 <= v15 )
{
v16 = *v14;
v17 = 0;
if ( *v14 )
{
if ( *((_BYTE *)v16 + 104) )
goto LABEL_23;
while ( v15 >= ++v14 )
{
v16 = *v14;
if ( !*v14 )
break;
if ( *((_BYTE *)v16 + 104) )
{
LABEL_23:
v18 = cocos2d::CCTMXTiledMap::parseLayer(this, v16, a2);
(*(void (__fastcall **)(cocos2d::CCTMXTiledMap *, cocos2d::CCTMXLayer *, _QWORD, _QWORD))(*(_QWORD *)this + 472LL))(
this,
v18,
v17,
v17);
v19 = (*(__int64 (__fastcall **)(cocos2d::CCTMXLayer *))(*(_QWORD *)v18 + 328LL))(v18);
v20 = (const cocos2d::CCSize *)(*(__int64 (__fastcall **)(cocos2d::CCTMXTiledMap *))(*(_QWORD *)this + 328LL))(this);
cocos2d::CCSize::CCSize(&v24, v20);
v21 = *(float *)v19;
if ( v24 >= *(float *)v19 )
v21 = v24;
v22 = *(float *)(v19 + 4);
v24 = v21;
if ( v25 >= v22 )
v22 = v25;
v23 = *(_QWORD *)this;
++v17;
v25 = v22;
(*(void (__fastcall **)(cocos2d::CCTMXTiledMap *, float *))(v23 + 320))(this, &v24);
}
}
}
}
}
}
}
return _stack_chk_guard;
}