//
// SpriteAnimationManager::createAnimations from 0x3d868c to 0x3d8d56 (1738 bytes)
//
// 2 xrefs:
// > ObjectManager::setup @ 0x3d6e0e
// > SpriteAnimationManager::initWithOwner @ 0x3d9412
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:46:46 +0000
//
unsigned int __fastcall SpriteAnimationManager::createAnimations(char *a1)
{
ObjectManager *v2; // r0
const char *v3; // r1
unsigned int result; // r0
ObjectManager *v5; // r0
int v6; // r2
int v7; // r3
const char *v8; // r1
cocos2d::CCAnimationCache *v9; // r0
ObjectManager *v10; // r0
const char *v11; // r1
int Definition; // r6
unsigned int v13; // r11
cocos2d::CCString *v14; // r0
const char *CString; // r0
const char *v16; // r7
size_t v17; // r0
int v18; // r0
int v19; // r6
cocos2d::CCString *v20; // r7
cocos2d::CCArray *v21; // r0
cocos2d::CCString *v22; // r7
int v23; // r7
cocos2d::CCString *v24; // r0
char *v25; // r0
const char *v26; // r1
char *v27; // r2
int v28; // r7
cocos2d::CCString *v29; // r0
const char *v30; // r7
size_t v31; // r0
cocos2d::CCSpriteFrameCache *v32; // r0
cocos2d::CCSpriteFrameCache *v33; // r0
char *v34; // r1
cocos2d::CCAnimation *v35; // r7
int v36; // r3
char *v37; // r7
size_t v38; // r0
const char *v39; // r1
char *v40; // r2
cocos2d::CCString *v41; // r0
const char *v42; // r0
cocos2d::CCString *v43; // r0
int v44; // r7
cocos2d::CCString *v45; // r0
int v46; // r6
cocos2d::CCSpriteFrameCache *v47; // r0
float v48; // r2
int i; // r5
cocos2d::CCSpriteFrameCache *v50; // r10
cocos2d::CCString *v51; // r0
const char *v52; // r0
cocos2d::CCObject *v53; // r1
int v54; // r3
cocos2d::CCObject *v55; // r0
char *v56; // r5
cocos2d::CCString *v57; // r0
const char *v58; // r6
size_t v59; // r0
size_t v60; // r0
cocos2d::CCArray *v61; // r0
cocos2d::CCArray *v62; // r10
int v63; // r3
unsigned __int8 *v64; // r2
unsigned __int8 *v65; // r3
unsigned __int8 *v66; // r1
unsigned __int8 *v67; // r5
int v68; // r6
int v69; // r5
int v70; // r7
unsigned int v71; // r6
size_t v72; // r2
unsigned int v73; // r3
std::logic_error *exception; // r4
char *v75; // r1
size_t v76; // r3
char *v77; // r1
char *v78; // r6
size_t v79; // r0
cocos2d::CCObject *v80; // r0
unsigned __int8 *v81; // r2
unsigned int v82; // r3
unsigned __int8 *v83; // r1
unsigned __int8 *v84; // r3
unsigned __int8 *v85; // r5
int v86; // r0
unsigned int j; // r5
cocos2d::CCString *v88; // r0
cocos2d::CCSpriteFrameCache *v89; // r0
cocos2d::CCSpriteFrameCache *v90; // r6
cocos2d::CCSpriteFrameCache *v91; // r9
cocos2d::CCString *v92; // r0
const char *v93; // r0
cocos2d::CCObject *v94; // r1
cocos2d::CCObject *v95; // r0
cocos2d::CCAnimation *v96; // r5
const char *v97; // r1
char *v98; // r2
cocos2d::CCString *v99; // r0
const char *v100; // r0
int v101; // [sp+4h] [bp-E8h]
cocos2d::CCArray *v102; // [sp+8h] [bp-E4h]
cocos2d::CCArray *v103; // [sp+Ch] [bp-E0h]
cocos2d::CCAnimationCache *v104; // [sp+10h] [bp-DCh]
cocos2d::CCDictionary *v105; // [sp+14h] [bp-D8h]
cocos2d::CCArray *v106; // [sp+18h] [bp-D4h]
int v107[2]; // [sp+3Ch] [bp-B0h] BYREF
char *v108; // [sp+44h] [bp-A8h]
int v109[3]; // [sp+48h] [bp-A4h] BYREF
int v110[3]; // [sp+54h] [bp-98h] BYREF
int v111[3]; // [sp+60h] [bp-8Ch] BYREF
int v112[2]; // [sp+6Ch] [bp-80h] BYREF
char *v113; // [sp+74h] [bp-78h]
int v114[3]; // [sp+78h] [bp-74h] BYREF
int v115[3]; // [sp+84h] [bp-68h] BYREF
int v116[3]; // [sp+90h] [bp-5Ch] BYREF
int v117[3]; // [sp+9Ch] [bp-50h] BYREF
int v118; // [sp+A8h] [bp-44h] BYREF
int v119; // [sp+ACh] [bp-40h]
char *v120; // [sp+B0h] [bp-3Ch]
int v121[3]; // [sp+B4h] [bp-38h] BYREF
int v122; // [sp+C0h] [bp-2Ch] BYREF
unsigned int v123; // [sp+C4h] [bp-28h]
char *v124; // [sp+C8h] [bp-24h]
int v125; // [sp+CCh] [bp-20h] BYREF
int v126; // [sp+D0h] [bp-1Ch]
char *v127; // [sp+D4h] [bp-18h]
int v128; // [sp+D8h] [bp-14h] BYREF
int v129; // [sp+DCh] [bp-10h]
char *v130; // [sp+E0h] [bp-Ch]
v2 = (ObjectManager *)ObjectManager::instance((ObjectManager *)a1);
if ( (*a1 & 1) != 0 )
v3 = *((const char **)a1 + 2);
else
v3 = a1 + 1;
result = ObjectManager::animLoaded(v2, v3);
if ( !result )
{
v5 = (ObjectManager *)ObjectManager::instance(nullptr);
v7 = (unsigned __int8)*a1;
if ( (v7 & 1) != 0 )
v8 = *((const char **)a1 + 2);
else
v8 = a1 + 1;
v9 = (cocos2d::CCAnimationCache *)ObjectManager::setLoaded(v5, v8, v6, v7);
v104 = (cocos2d::CCAnimationCache *)cocos2d::CCAnimationCache::sharedAnimationCache(v9);
v10 = (ObjectManager *)ObjectManager::instance(v104);
if ( (*a1 & 1) != 0 )
v11 = *((const char **)a1 + 2);
else
v11 = a1 + 1;
v128 = 0;
v129 = 0;
v130 = nullptr;
Definition = ObjectManager::getDefinition(v10, v11);
std::string::__init(&v128, "animations", 0xAu);
v105 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(Definition, &v128);
std::string::~string((int)&v128);
v13 = 0;
v106 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v105);
while ( 1 )
{
result = cocos2d::CCArray::count(v106);
if ( v13 >= result )
return result;
v14 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v106, v13);
CString = (const char *)cocos2d::CCString::getCString(v14);
v107[0] = 0;
v107[1] = 0;
v108 = nullptr;
v16 = CString;
v17 = strlen(CString);
std::string::__init(v107, v16, v17);
v18 = cocos2d::CCDictionary::objectForKey(v105, v107);
memset(v109, 0, sizeof(v109));
v19 = v18;
std::string::__init(v109, "delay", 5u);
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, v109);
v21 = (cocos2d::CCArray *)std::string::~string((int)v109);
if ( v20 )
{
v21 = (cocos2d::CCArray *)cocos2d::CCString::floatValue(v20);
v103 = v21;
}
else
{
v103 = nullptr;
}
v102 = (cocos2d::CCArray *)cocos2d::CCArray::create(v21);
memset(v110, 0, sizeof(v110));
std::string::__init(v110, "usesParts", 9u);
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, v110);
std::string::~string((int)v110);
if ( v22 )
v101 = cocos2d::CCString::boolValue(v22);
else
v101 = 0;
memset(v111, 0, sizeof(v111));
std::string::__init(v111, "animFrameName", 0xDu);
v23 = cocos2d::CCDictionary::objectForKey(v19, v111);
std::string::~string((int)v111);
v112[0] = 0;
v112[1] = 0;
v113 = nullptr;
if ( v23 )
{
v24 = (cocos2d::CCString *)v23;
}
else
{
if ( (*a1 & 1) != 0 )
v26 = *((const char **)a1 + 2);
else
v26 = a1 + 1;
if ( (v107[0] & 1) != 0 )
v27 = v108;
else
v27 = (char *)v107 + 1;
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%s",
v26,
v27,
LOBYTE(v107[0]));
}
v25 = (char *)cocos2d::CCString::getCString(v24);
std::string::assign(v112, v25);
memset(v114, 0, sizeof(v114));
std::string::__init(v114, "singleFrame", 0xBu);
v28 = cocos2d::CCDictionary::objectForKey(v19, v114);
std::string::~string((int)v114);
if ( v28 )
{
memset(v115, 0, sizeof(v115));
std::string::__init(v115, "singleFrame", 0xBu);
v29 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, v115);
v30 = (const char *)cocos2d::CCString::getCString(v29);
v128 = 0;
v129 = 0;
v130 = nullptr;
v31 = strlen(v30);
std::string::__init(&v128, v30, v31);
v32 = (cocos2d::CCSpriteFrameCache *)std::string::~string((int)v115);
if ( v101 )
{
v37 = (char *)((unsigned __int8)v128 << 31);
if ( (v128 & 1) == 0 )
v37 = (char *)&v128 + 1;
v116[0] = 0;
if ( (v128 & 1) != 0 )
v37 = v130;
v116[1] = 0;
v116[2] = 0;
v38 = strlen(v37);
std::string::__init(v116, v37, v38);
v35 = (cocos2d::CCAnimation *)cocos2d::CCString::create(v116);
std::string::~string((int)v116);
v36 = 1;
}
else
{
v33 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v32);
if ( (v128 & 1) != 0 )
v34 = v130;
else
v34 = (char *)&v128 + 1;
v35 = (cocos2d::CCAnimation *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v33, v34);
v36 = 2;
}
*((_DWORD *)v35 + 6) = v36;
if ( (*a1 & 1) != 0 )
v39 = *((const char **)a1 + 2);
else
v39 = a1 + 1;
if ( (v107[0] & 1) != 0 )
v40 = v108;
else
v40 = (char *)v107 + 1;
v41 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%s",
v39,
v40,
LOBYTE(v107[0]));
v42 = (const char *)cocos2d::CCString::getCString(v41);
cocos2d::CCAnimationCache::addAnimation(v104, v35, v42);
std::string::~string((int)&v128);
goto LABEL_128;
}
memset(v117, 0, sizeof(v117));
std::string::__init(v117, "other", 5u);
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, v117);
v44 = cocos2d::CCString::boolValue(v43);
std::string::~string((int)v117);
if ( !v44 )
{
v118 = 0;
v119 = 0;
v120 = nullptr;
std::string::__init(&v118, "frames", 6u);
v45 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, &v118);
v46 = cocos2d::CCString::intValue(v45);
v47 = (cocos2d::CCSpriteFrameCache *)std::string::~string((int)&v118);
for ( i = 1; i <= v46; ++i )
{
if ( v101 )
{
v54 = LOBYTE(v112[0]) << 31;
if ( (v112[0] & 1) != 0 )
v55 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
v113,
i,
v54);
else
v55 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
(const char *)v112 + 1,
i,
v54);
v53 = v55;
*((_DWORD *)v55 + 6) = 1;
}
else
{
v50 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v47);
if ( (v112[0] & 1) != 0 )
v51 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
v113,
i);
else
v51 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
(const char *)v112 + 1,
i);
v52 = (const char *)cocos2d::CCString::getCString(v51);
v53 = (cocos2d::CCObject *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v50, v52);
*((_DWORD *)v53 + 6) = 2;
}
v47 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCArray::addObject(v102, v53);
}
goto LABEL_121;
}
v56 = (char *)v121;
memset(v121, 0, sizeof(v121));
std::string::__init(v121, "frames", 6u);
v57 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v19, v121);
v58 = (const char *)cocos2d::CCString::getCString(v57);
v118 = 0;
v119 = 0;
v120 = nullptr;
v59 = strlen(v58);
std::string::__init(&v118, v58, v59);
std::string::~string((int)v121);
if ( (v118 & 1) == 0 )
v56 = (char *)&v118 + 1;
v122 = 0;
if ( (v118 & 1) != 0 )
v56 = v120;
v123 = 0;
v124 = nullptr;
v60 = strlen(v56);
v61 = (cocos2d::CCArray *)std::string::__init(&v122, v56, v60);
v62 = (cocos2d::CCArray *)cocos2d::CCArray::create(v61);
if ( (v122 & 1) != 0 )
{
v63 = v123;
v64 = (unsigned __int8 *)v124;
if ( !v123 )
{
v69 = -1;
goto LABEL_74;
}
}
else
{
v63 = (int)(unsigned __int8)v122 >> 1;
if ( !v63 )
{
v69 = -1;
LABEL_77:
v70 = (int)(unsigned __int8)v122 >> 1;
goto LABEL_78;
}
v64 = (unsigned __int8 *)&v122 + 1;
}
v65 = &v64[v63];
v66 = v64;
while ( 1 )
{
v67 = v66;
if ( v66 == v65 )
break;
v68 = *v66++;
if ( v68 == 32 )
{
v69 = v67 - v64;
goto LABEL_71;
}
}
v69 = -1;
LABEL_71:
if ( (v122 & 1) == 0 )
goto LABEL_77;
LABEL_74:
v70 = v123;
LABEL_78:
v71 = 0;
while ( 1 )
{
v72 = v69 - v71;
v125 = 0;
v126 = 0;
v127 = nullptr;
if ( (v122 & 1) != 0 )
{
v73 = v123;
if ( v71 > v123 )
goto LABEL_83;
v75 = v124;
}
else
{
v73 = (int)(unsigned __int8)v122 >> 1;
if ( v71 > v73 )
{
LABEL_83:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v75 = (char *)&v122 + 1;
}
v76 = v73 - v71;
v77 = &v75[v71];
if ( v72 >= v76 )
v72 = v76;
std::string::__init(&v125, v77, v72);
if ( (v125 & 1) != 0 )
{
if ( v126 || v71 != v70 )
{
v78 = v127;
LABEL_97:
v128 = 0;
v129 = 0;
v130 = nullptr;
v79 = strlen(v78);
std::string::__init(&v128, v78, v79);
v80 = (cocos2d::CCObject *)cocos2d::CCString::create(&v128);
cocos2d::CCArray::addObject(v62, v80);
std::string::~string((int)&v128);
}
}
else if ( (unsigned __int8)v125 >> 1 || v71 != v70 )
{
v78 = (char *)&v125 + 1;
goto LABEL_97;
}
if ( v69 == -1 )
break;
v71 = v69 + 1;
if ( (v122 & 1) != 0 )
{
v81 = (unsigned __int8 *)v124;
v82 = v123;
}
else
{
v82 = (int)(unsigned __int8)v122 >> 1;
v81 = (unsigned __int8 *)&v122 + 1;
}
if ( v71 < v82 )
{
v83 = &v81[v71];
v84 = &v81[v82];
while ( 1 )
{
v85 = v83;
if ( v83 == v84 )
break;
v86 = *v83++;
if ( v86 == 32 )
{
v69 = v85 - v81;
goto LABEL_107;
}
}
}
v69 = -1;
LABEL_107:
std::string::~string((int)&v125);
}
std::string::~string((int)&v125);
std::string::~string((int)&v122);
for ( j = 0; j < cocos2d::CCArray::count(v62); ++j )
{
v88 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v62, j);
v89 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCString::intValue(v88);
v90 = v89;
if ( v101 )
{
if ( (v112[0] & 1) != 0 )
v95 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
v113,
v89);
else
v95 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
(const char *)v112 + 1,
v89);
v94 = v95;
*((_DWORD *)v95 + 6) = 1;
}
else
{
v91 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v89);
if ( (v112[0] & 1) != 0 )
v92 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
v113,
v90);
else
v92 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%03d.png",
(const char *)v112 + 1,
v90);
v93 = (const char *)cocos2d::CCString::getCString(v92);
v94 = (cocos2d::CCObject *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v91, v93);
*((_DWORD *)v94 + 6) = 2;
}
cocos2d::CCArray::addObject(v102, v94);
}
std::string::~string((int)&v118);
LABEL_121:
v96 = (cocos2d::CCAnimation *)cocos2d::CCAnimation::createWithSpriteFrames(v102, v103, v48);
if ( (*a1 & 1) != 0 )
v97 = *((const char **)a1 + 2);
else
v97 = a1 + 1;
if ( (v107[0] & 1) != 0 )
v98 = v108;
else
v98 = (char *)v107 + 1;
v99 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s_%s",
v97,
v98,
LOBYTE(v107[0]) << 31);
v100 = (const char *)cocos2d::CCString::getCString(v99);
cocos2d::CCAnimationCache::addAnimation(v104, v96, v100);
LABEL_128:
++v13;
std::string::~string((int)v112);
std::string::~string((int)v107);
}
}
return result;
}