//
// cocos2d::CCAnimationCache::addAnimation from 0xb13918 to 0xb139e8 (208 bytes)
//
// 5 xrefs:
// > SpriteAnimationManager::createAnimations @ 0x58e938
// > SpriteAnimationManager::createAnimations @ 0x58eae8
// > cocos2d::CCAnimationCache::parseVersion1 @ 0xb13d5c
// > cocos2d::CCAnimationCache::parseVersion2 @ 0xb14150
// > ??> @ 0x2b0c8
//
// 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 cocos2d::CCAnimationCache::addAnimation(cocos2d::CCAnimationCache *a1, cocos2d::CCAnimation *a2, const char *a3)
{
cocos2d::CCAnimationCache_vtbl *v3; // x22
char *v5; // x0
unsigned int *v6; // x2
int v7; // w1
const char *v8; // [xsp+40h] [xbp+40h] BYREF
v3 = a1[1].__vftable;
sub_D153B8((int)&v8, (char *)a3);
cocos2d::CCDictionary::setObject((__int64)v3, a2, &v8);
v5 = (char *)(v8 - 24);
if ( v8 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *((_DWORD *)v8 - 2);
*((_DWORD *)v8 - 2) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v5);
}
}