//
// CCAnimatedSprite::cleanupSprite from 0x68c70c to 0x68c7ac (160 bytes)
//
// 2 xrefs:
// > CCAnimatedSprite::loadType @ 0x68cb28
// > ??> @ 0x72d78
//
// 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 12:50:33 +0000
//
__int64 __fastcall CCAnimatedSprite::cleanupSprite(CCAnimatedSprite *this)
{
__int64 v2; // x0
__int64 v3; // x0
SpriteAnimationManager *v4; // x0
__int64 v5; // x0
__int64 result; // x0
v2 = *((_QWORD *)this + 84);
if ( v2 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 736LL))(v2);
v3 = *((_QWORD *)this + 83);
if ( v3 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 736LL))(v3);
v4 = *((SpriteAnimationManager **)this + 81);
if ( !v4 )
goto LABEL_6;
}
else
{
v4 = *((SpriteAnimationManager **)this + 81);
if ( !v4 )
goto LABEL_8;
}
SpriteAnimationManager::doCleanup(v4);
LABEL_6:
v5 = *((_QWORD *)this + 83);
if ( v5 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 528LL))(v5, 1);
LABEL_8:
result = *((_QWORD *)this + 84);
if ( result )
result = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)result + 528LL))(result, 1);
*((_DWORD *)this + 170) = 0;
*((_QWORD *)this + 81) = 0;
*((_QWORD *)this + 83) = 0;
*((_QWORD *)this + 84) = 0;
*((_QWORD *)this + 82) = 0;
return result;
}