//
// SpriteAnimationManager::loadAnimations from 0x1003234d0 to 0x1003239b4 (1252 bytes)
//
// 1 xrefs:
// > SpriteAnimationManager::initWithOwner @ 0x100322b48
//
// 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
//
__int64 __fastcall SpriteAnimationManager::loadAnimations(cocos2d::CCObject *a1, __int64 a2)
{
ObjectManager *v3; // x0
const char *v4; // x1
cocos2d::CCDictionary *Definition; // x20
__int64 result; // x0
unsigned int i; // w24
cocos2d::CCString *v8; // x28
char *CString; // x0
__int64 v10; // x26
cocos2d::CCString *v11; // x0
__int64 v12; // x25
cocos2d::CCString *v13; // x0
_BOOL4 v14; // w27
cocos2d::CCString *v15; // x0
_BOOL4 v16; // w22
cocos2d::CCString *v17; // x0
bool v18; // w21
__int64 v19; // x0
cocos2d::CCString *v20; // x20
char *v21; // x0
bool v22; // w23
cocos2d::CCString *v23; // x0
float v24; // s8
char *v25; // x0
__int64 v26; // x22
char *v27; // x1
char *v28; // x0
_BYTE *v29; // x20
cocos2d::CCAnimation *v30; // x20
__int64 v31; // x0
__int64 v32; // x23
int v33; // w8
__int64 v34; // x26
cocos2d::CCFiniteTimeAction *v35; // x23
__int64 v36; // x0
cocos2d::CCAnimate *v37; // x0
cocos2d::CCAnimation *v38; // x0
char v39; // w0
__int64 v40; // x1
__int64 v41; // x2
__int64 v42; // x3
__int64 v43; // x4
__int64 v44; // x5
__int64 v45; // x6
__int64 v46; // x7
char *v47; // x0
cocos2d::CCAnimationCache *v48; // [xsp+20h] [xbp-2F0h]
cocos2d::CCDictionary *v49; // [xsp+28h] [xbp-2E8h]
cocos2d::CCArray *v51; // [xsp+40h] [xbp-2D0h]
void *v52[2]; // [xsp+48h] [xbp-2C8h] BYREF
char v53; // [xsp+5Fh] [xbp-2B1h]
void *v54[2]; // [xsp+60h] [xbp-2B0h] BYREF
char v55; // [xsp+77h] [xbp-299h]
void *v56[2]; // [xsp+78h] [xbp-298h] BYREF
char v57; // [xsp+8Fh] [xbp-281h]
void *__p[2]; // [xsp+90h] [xbp-280h] BYREF
char *v59; // [xsp+A0h] [xbp-270h]
_BYTE v60[504]; // [xsp+A8h] [xbp-268h] BYREF
cocos2d::SEL_CallFunc v61; // 0:x1.16
v48 = cocos2d::CCAnimationCache::sharedAnimationCache();
v3 = ObjectManager::instance();
v4 = (const char *)a2;
if ( *(char *)(a2 + 23) < 0 )
v4 = *(const char **)a2;
Definition = ObjectManager::getDefinition(v3, v4);
sub_100009900(__p, "animations");
v49 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(Definition, __p);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
v51 = cocos2d::CCDictionary::allKeys(v49);
result = sub_10024A36C((__int64)v51);
if ( (_DWORD)result )
{
for ( i = 0; i < (unsigned int)result; ++i )
{
v8 = (cocos2d::CCString *)sub_10024A388((__int64)v51, i);
CString = (char *)cocos2d::CCString::getCString(v8);
sub_100009900(__p, CString);
v10 = cocos2d::CCDictionary::objectForKey_1(v49, __p);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
sub_100009900(__p, "prio");
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v10, __p);
v12 = cocos2d::CCString::intValue(v11);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
sub_100009900(__p, "looped");
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v10, __p);
v14 = cocos2d::CCString::boolValue(v13);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
sub_100009900(__p, "usesParts");
v15 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v10, __p);
v16 = cocos2d::CCString::boolValue(v15);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
sub_100009900(__p, "dontPlayNext");
v17 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v10, __p);
v18 = cocos2d::CCString::boolValue(v17);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
sub_100009900(__p, "sound");
v19 = cocos2d::CCDictionary::objectForKey_1(v10, __p);
v20 = (cocos2d::CCString *)v19;
if ( SHIBYTE(v59) < 0 )
{
operator delete(__p[0]);
if ( !v20 )
goto LABEL_31;
}
else if ( !v19 )
{
goto LABEL_31;
}
v21 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(__p, v21);
sub_100009900(v56, "0");
v22 = sub_1000045BC(__p, v56);
if ( v57 < 0 )
operator delete(v56[0]);
if ( SHIBYTE(v59) < 0 )
{
operator delete(__p[0]);
if ( v22 )
goto LABEL_31;
}
else if ( v22 )
{
goto LABEL_31;
}
sub_100009900(__p, "soundDelay");
v23 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v10, __p);
v24 = cocos2d::CCString::floatValue(v23);
if ( SHIBYTE(v59) < 0 )
operator delete(__p[0]);
v25 = (char *)cocos2d::CCString::getCString(v8);
sub_100009900(v54, v25);
SpriteAnimationManager::storeSoundForAnimation(a1, v20, v54, v24);
if ( v55 < 0 )
operator delete(v54[0]);
LABEL_31:
if ( v16 )
v26 = 2;
else
v26 = 1;
*(_OWORD *)__p = xmmword_1006350E0;
v59 = v60;
v27 = (char *)a2;
if ( *(char *)(a2 + 23) < 0 )
v27 = *(char **)a2;
sub_10000CB18((__int64 *)__p, v27, 0);
sub_10000CB18((__int64 *)__p, "_", 0);
v28 = (char *)cocos2d::CCString::getCString(v8);
sub_10000CB18((__int64 *)__p, v28, 0);
v29 = __p[0];
if ( __p[1] < (char *)__p[0] + 1 )
sub_100009ED4((__int64)__p, (size_t)__p[0] + 1);
v29[(_QWORD)v59] = 0;
v30 = cocos2d::CCAnimationCache::animationByName(v48, v59);
sub_100009900(v56, "singleFrame");
v31 = cocos2d::CCDictionary::objectForKey_1(v10, v56);
v32 = v31;
if ( v57 < 0 )
{
operator delete(v56[0]);
if ( v32 )
{
LABEL_40:
v33 = 2;
v34 = (__int64)v30;
v35 = (cocos2d::CCFiniteTimeAction *)v30;
goto LABEL_50;
}
}
else if ( v31 )
{
goto LABEL_40;
}
v36 = sub_10024A388((__int64)v30->m_pFrames, 0);
v34 = v36;
if ( *(_DWORD *)(v36 + 28) == 14 )
v34 = *(_QWORD *)(v36 + 56);
v37 = cocos2d::CCAnimate::create(v30);
v35 = v37;
v37->m_eObjType = 0;
if ( v14 )
{
v38 = (cocos2d::CCAnimation *)cocos2d::CCRepeatForever::create(v37);
LABEL_49:
v30 = v38;
v33 = 0;
goto LABEL_50;
}
if ( !v18 )
{
v61.ptr = (void (*)(void))SpriteAnimationManager::animationFinished;
v61.adj = 0;
v39 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v61);
v38 = (cocos2d::CCAnimation *)sub_10018A494(v35, v40, v41, v42, v43, v44, v45, v46, v39);
goto LABEL_49;
}
v33 = 0;
v30 = (cocos2d::CCAnimation *)v37;
LABEL_50:
v30->m_eObjType = v33;
v47 = (char *)cocos2d::CCString::getCString(v8);
sub_100009900(v52, v47);
SpriteAnimationManager::storeAnimation(a1, v35, v30, v52, v12, v26, v34);
if ( v53 < 0 )
operator delete(v52[0]);
if ( v59 != v60 )
{
if ( v59 )
operator delete[](v59);
}
result = sub_10024A36C((__int64)v51);
}
}
return result;
}