//
// cocos2d::VolatileTexture::~VolatileTexture from 0xda5874 to 0xda5a64 (496 bytes)
//
// 3 xrefs:
// > cocos2d::VolatileTexture::removeTexture @ 0xda5aac
// > ??> @ 0xca2a0
// > ??> @ 0xf0ac0
//
// 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:32 +0000
//
// Alternative name is '_ZN7cocos2d15VolatileTextureD1Ev'
void __fastcall cocos2d::VolatileTexture::~VolatileTexture(cocos2d::VolatileTexture *this)
{
__int64 v2; // x1
__int64 v3; // x3
__int64 v4; // x2
__int64 v5; // x0
__int64 v6; // x4
__int64 v7; // x2
__int64 v8; // x3
_DWORD *v9; // x0
char v10; // w0
void **v11; // x19
__int64 *v12; // x0
__int64 v13; // x1
__int64 *v14; // x22
__int64 v15; // [xsp+30h] [xbp+30h] BYREF
void *v16; // [xsp+38h] [xbp+38h]
__int64 v17; // [xsp+40h] [xbp+40h]
v2 = qword_1562350;
v17 = 0;
v15 = (__int64)&v15;
v16 = &v15;
if ( (__int64 *)qword_1562350 == &cocos2d::VolatileTexture::textures )
goto LABEL_14;
v3 = 0;
while ( 1 )
{
while ( this != *(cocos2d::VolatileTexture **)(v2 + 16) )
{
v2 = *(_QWORD *)(v2 + 8);
if ( (__int64 *)v2 == &cocos2d::VolatileTexture::textures )
goto LABEL_13;
}
v4 = *(_QWORD *)(v2 + 8);
if ( (__int64 *)v4 == &cocos2d::VolatileTexture::textures )
{
v5 = *(_QWORD *)(v2 + 8);
goto LABEL_8;
}
v5 = *(_QWORD *)(v2 + 8);
if ( this == *(cocos2d::VolatileTexture **)(v4 + 16) )
break;
LABEL_7:
if ( v2 != v5 )
goto LABEL_8;
LABEL_12:
v2 = *(_QWORD *)(v5 + 8);
if ( (__int64 *)v2 == &cocos2d::VolatileTexture::textures )
goto LABEL_13;
}
while ( 1 )
{
v5 = *(_QWORD *)(v5 + 8);
if ( (__int64 *)v5 == &cocos2d::VolatileTexture::textures )
break;
if ( this != *(cocos2d::VolatileTexture **)(v5 + 16) )
goto LABEL_7;
}
LABEL_8:
v6 = 0;
while ( 1 )
{
++v6;
if ( v4 == v5 )
break;
v4 = *(_QWORD *)(v4 + 8);
}
v17 = v6 + v3;
qword_1562358 -= v6;
v7 = *(_QWORD *)v5;
*(_QWORD *)(*(_QWORD *)v2 + 8LL) = *(_QWORD *)(*(_QWORD *)v5 + 8LL);
**(_QWORD **)(v7 + 8) = *(_QWORD *)v2;
v8 = v15;
*(_QWORD *)(v15 + 8) = v2;
*(_QWORD *)v2 = v8;
*(_QWORD *)(v7 + 8) = &v15;
v15 = v7;
v3 = v17;
if ( (__int64 *)v5 != &cocos2d::VolatileTexture::textures )
goto LABEL_12;
LABEL_13:
if ( v3 )
{
v12 = (__int64 *)v16;
v13 = v15;
*(_QWORD *)(*(_QWORD *)v16 + 8LL) = *(_QWORD *)(v15 + 8);
**(_QWORD **)(v13 + 8) = *v12;
v17 = 0;
if ( v12 != &v15 )
{
do
{
v14 = (__int64 *)v12[1];
operator delete(v12);
v12 = v14;
}
while ( v14 != &v15 );
}
}
LABEL_14:
v9 = *((_DWORD **)this + 1);
if ( v9 )
cocos2d::CCObject::release(v9);
if ( (*((_BYTE *)this + 136) & 1) != 0 )
operator delete(*((void **)this + 19));
if ( (*((_BYTE *)this + 112) & 1) != 0 )
operator delete(*((void **)this + 16));
v10 = *((_BYTE *)this + 48);
v11 = (void **)((char *)this + 48);
if ( (v10 & 1) != 0 )
operator delete(v11[2]);
}