//
// cocos2d::extension::AssetsManager::~AssetsManager from 0x180001670 to 0x180001831 (449 bytes)
//
// 4 xrefs:
// > sub_1800013C0 @ 0x18000141e
// > sub_1800013C0 @ 0x1800013dc
// > ??> @ 0x18002fdf8
// > ??> @ 0x180049060
//
// 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 __fastcall cocos2d::extension::AssetsManager::~AssetsManager(cocos2d::extension::AssetsManager *this)
{
cocos2d::CCObject *v2; // rcx
unsigned __int64 v3; // rdx
_QWORD *v4; // rcx
unsigned __int64 v5; // rdx
_QWORD *v6; // rcx
unsigned __int64 v7; // rdx
_QWORD *v8; // rcx
unsigned __int64 v9; // rdx
_QWORD *v10; // rcx
unsigned __int64 v11; // rdx
void *v12; // rcx
*(_QWORD *)this = &cocos2d::extension::AssetsManager::`vftable';
v2 = *((cocos2d::CCObject **)this + 22);
if ( v2 )
cocos2d::CCObject::release(v2);
v3 = *((_QWORD *)this + 20);
if ( v3 > 0xF )
{
v4 = *((_QWORD **)this + 17);
if ( v3 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v4 - *(v4 - 1) - 8 > 0x1F )
goto LABEL_29;
v4 = (_QWORD *)*(v4 - 1);
}
j_j_free(v4);
}
*((_QWORD *)this + 19) = 0;
*((_QWORD *)this + 20) = 15;
*((_BYTE *)this + 136) = 0;
v5 = *((_QWORD *)this + 16);
if ( v5 > 0xF )
{
v6 = *((_QWORD **)this + 13);
if ( v5 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v6 - *(v6 - 1) - 8 > 0x1F )
goto LABEL_29;
v6 = (_QWORD *)*(v6 - 1);
}
j_j_free(v6);
}
*((_QWORD *)this + 15) = 0;
*((_QWORD *)this + 16) = 15;
*((_BYTE *)this + 104) = 0;
v7 = *((_QWORD *)this + 12);
if ( v7 > 0xF )
{
v8 = *((_QWORD **)this + 9);
if ( v7 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v8 - *(v8 - 1) - 8 > 0x1F )
goto LABEL_29;
v8 = (_QWORD *)*(v8 - 1);
}
j_j_free(v8);
}
*((_QWORD *)this + 11) = 0;
*((_QWORD *)this + 12) = 15;
*((_BYTE *)this + 72) = 0;
v9 = *((_QWORD *)this + 8);
if ( v9 > 0xF )
{
v10 = *((_QWORD **)this + 5);
if ( v9 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v10 - *(v10 - 1) - 8 > 0x1F )
goto LABEL_29;
v10 = (_QWORD *)*(v10 - 1);
}
j_j_free(v10);
}
*((_QWORD *)this + 7) = 0;
*((_QWORD *)this + 8) = 15;
*((_BYTE *)this + 40) = 0;
v11 = *((_QWORD *)this + 4);
if ( v11 > 0xF )
{
v12 = *((void **)this + 1);
if ( v11 + 1 < 0x1000 )
{
LABEL_27:
j_j_free(v12);
goto LABEL_28;
}
if ( (unsigned __int64)v12 - *((_QWORD *)v12 - 1) - 8 <= 0x1F )
{
v12 = *((void **)v12 - 1);
goto LABEL_27;
}
LABEL_29:
invalid_parameter_noinfo_noreturn();
}
LABEL_28:
*((_QWORD *)this + 3) = 0;
*((_QWORD *)this + 4) = 15;
*((_BYTE *)this + 8) = 0;
}