//
// cocos2d::CCApplication::~CCApplication from 0x180072bf0 to 0x180072cd7 (231 bytes)
//
// 4 xrefs:
// > sub_180072CF0 @ 0x180072d4e
// > sub_180072CF0 @ 0x180072d0c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b43bc
//
// 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::CCApplication::~CCApplication(cocos2d::CCApplication *this)
{
unsigned __int64 v2; // rdx
_QWORD *v3; // rcx
std::size_t m_capacity; // rdx
char *m_bigStorage; // rcx
this->__vftable = (cocos2d::CCApplication_vtbl *)&cocos2d::CCApplication::`vftable';
cocos2d::CCApplication::sm_pSharedApplication = nullptr;
j_j_free_0(*((void **)this + 13));
j_j_free_0(*((void **)this + 14));
v2 = *((_QWORD *)this + 12);
if ( v2 > 0xF )
{
v3 = *((_QWORD **)this + 9);
if ( v2 + 1 >= 0x1000 )
{
if ( (unsigned __int64)v3 - *(v3 - 1) - 8 > 0x1F )
goto LABEL_12;
v3 = (_QWORD *)*(v3 - 1);
}
j_j_free_0(v3);
}
*((_QWORD *)this + 11) = 0;
*((_QWORD *)this + 12) = 15;
*((_BYTE *)this + 72) = 0;
m_capacity = this->m_startupScriptFilename.m_data.m_capacity;
if ( m_capacity > 0xF )
{
m_bigStorage = this->m_startupScriptFilename.m_data.m_bigStorage;
if ( m_capacity + 1 < 0x1000 )
{
LABEL_10:
j_j_free_0(m_bigStorage);
goto LABEL_11;
}
if ( (unsigned __int64)&m_bigStorage[-*((_QWORD *)m_bigStorage - 1) - 8] <= 0x1F )
{
m_bigStorage = *((char **)m_bigStorage - 1);
goto LABEL_10;
}
LABEL_12:
invalid_parameter_noinfo_noreturn();
}
LABEL_11:
this->m_startupScriptFilename.m_data.m_size = 0;
this->m_startupScriptFilename.m_data.m_capacity = 15;
this->m_startupScriptFilename.m_data.m_smallStorage._Elems[0] = 0;
this->__vftable = (cocos2d::CCApplication_vtbl *)&cocos2d::CCApplicationProtocol::`vftable';
}