//
// cocos2d::CCAnimationCache::addAnimation from 0xd850c4 to 0xd851bc (248 bytes)
//
// 5 xrefs:
// > SpriteAnimationManager::createAnimations @ 0x6b0a90
// > SpriteAnimationManager::createAnimations @ 0x6b0bf4
// > cocos2d::CCAnimationCache::parseVersion1 @ 0xd85574
// > cocos2d::CCAnimationCache::parseVersion2 @ 0xd858dc
// > ??> @ 0x416f8
//
// 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:12 +0000
//
__int64 __fastcall cocos2d::CCAnimationCache::addAnimation(
cocos2d::CCAnimationCache *this,
cocos2d::CCAnimation *a2,
const char *a3)
{
__int64 v5; // x25
size_t v6; // x0
size_t v7; // x19
char *v8; // x3
unsigned __int64 v10; // x0
__int64 v11; // [xsp+50h] [xbp+50h] BYREF
size_t v12; // [xsp+58h] [xbp+58h]
void *v13; // [xsp+60h] [xbp+60h]
v11 = 0;
v5 = *((_QWORD *)this + 7);
v12 = 0;
v13 = nullptr;
v6 = strlen(a3);
v7 = v6;
if ( v6 > 0x16 )
{
v10 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = v10 | 1;
v8 = (char *)operator new(v10);
v13 = v8;
v12 = v7;
}
else
{
LOBYTE(v11) = 2 * v6;
v8 = (char *)&v11 + 1;
if ( !v6 )
goto LABEL_3;
}
v8 = (char *)memcpy(v8, a3, v7);
LABEL_3:
v8[v7] = 0;
cocos2d::CCDictionary::setObject(v5, a2, (__int64)&v11);
if ( (v11 & 1) != 0 )
operator delete(v13);
return _stack_chk_guard;
}