//
// SpriteAnimationManager::createAnimations from 0x1007212c0 to 0x1007220d9 (3609 bytes)
//
// 2 xrefs:
// > SpriteAnimationManager::initWithOwner @ 0x100721213
// > ObjectManager::setup @ 0x1007962e0
//
// 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
//
char __fastcall SpriteAnimationManager::createAnimations(__int64 a1, double a2)
{
ObjectManager *v2; // rax
unsigned int v3; // eax
ObjectManager *v4; // rax
const char *v5; // rsi
ObjectManager *v6; // rax
const char *v7; // rsi
cocos2d::CCDictionary *Definition; // rax
cocos2d::CCArray *v9; // r12
unsigned int v10; // r15d
cocos2d::CCString *v11; // rax
const char *CString; // r14
size_t v13; // rax
size_t v14; // rbx
char *v15; // r15
size_t v16; // r12
__int64 v17; // rbx
cocos2d::CCString *v18; // r14
cocos2d::CCString *v19; // r14
int v20; // eax
cocos2d::CCString *v21; // r14
const char *v22; // rax
cocos2d::CCString *v23; // rax
__int64 v24; // r14
cocos2d::CCString *v25; // rax
const char *v26; // rbx
size_t v27; // rax
size_t v28; // r14
char *v29; // r15
const char *v30; // rbx
size_t v31; // rax
size_t v32; // r14
char *v33; // r15
cocos2d::CCString *v34; // rax
bool v35; // r14
cocos2d::CCString *v36; // rax
const char *v37; // rbx
size_t v38; // rax
size_t v39; // r14
char *v40; // r15
char *v41; // rbx
size_t v42; // rax
size_t v43; // r12
cocos2d::CCSpriteFrameCache *v44; // rax
const char *v45; // rsi
cocos2d::CCSpriteFrame *v46; // rbx
int v47; // eax
cocos2d::CCString *v48; // rax
int v49; // ebx
int v50; // ebx
int v51; // r14d
__int64 v52; // rax
int v53; // eax
size_t v54; // r12
cocos2d::CCString *v55; // rax
const char *v56; // rax
size_t v57; // r13
size_t v58; // r14
char *v59; // r15
size_t v60; // r13
char *v61; // rax
unsigned __int64 v62; // rdi
unsigned __int64 v63; // rsi
char *v64; // rdx
__int64 v65; // rbx
unsigned __int64 v66; // r13
bool v67; // zf
unsigned __int64 v68; // r14
char *v69; // r15
size_t v70; // r14
char *v71; // r13
char v72; // al
const char *v73; // r14
size_t v74; // r12
size_t v75; // rax
size_t v76; // r15
char *v77; // r13
size_t v78; // r12
cocos2d::CCObject *v79; // rax
__int64 v80; // r14
char *v81; // rax
unsigned __int64 v82; // rsi
char *v83; // rdx
unsigned __int64 v84; // rdi
unsigned int i; // r14d
cocos2d::CCString *v86; // rax
cocos2d::CCSpriteFrame *v87; // rax
int v88; // ecx
cocos2d::CCSpriteFrameCache *v89; // r13
cocos2d::CCString *v90; // rax
const char *v91; // rax
int v92; // ebx
int v93; // r14d
cocos2d::CCSpriteFrameCache *v94; // r15
cocos2d::CCString *v95; // rax
const char *v96; // rax
cocos2d::CCSpriteFrame *v97; // rax
int v98; // eax
cocos2d::CCAnimation *v99; // rbx
cocos2d::CCString *v100; // rax
const char *v101; // rax
unsigned __int64 v103; // [rsp+0h] [rbp-120h]
cocos2d::CCDictionary *v104; // [rsp+8h] [rbp-118h]
cocos2d::CCAnimationCache *v105; // [rsp+10h] [rbp-110h]
unsigned int v106; // [rsp+1Ch] [rbp-104h]
char v107[8]; // [rsp+20h] [rbp-100h] BYREF
size_t v108; // [rsp+28h] [rbp-F8h]
char *v109; // [rsp+30h] [rbp-F0h]
cocos2d::CCObject *v110; // [rsp+38h] [rbp-E8h]
__int64 v111; // [rsp+40h] [rbp-E0h]
unsigned __int64 v112; // [rsp+48h] [rbp-D8h]
cocos2d::CCArray *v113; // [rsp+50h] [rbp-D0h]
float v114; // [rsp+5Ch] [rbp-C4h]
std::string v115; // [rsp+60h] [rbp-C0h] BYREF
_QWORD __dst[2]; // [rsp+80h] [rbp-A0h] BYREF
void *v117; // [rsp+90h] [rbp-90h]
__int64 v118; // [rsp+98h] [rbp-88h] BYREF
unsigned __int64 v119; // [rsp+A0h] [rbp-80h]
void *v120; // [rsp+A8h] [rbp-78h]
cocos2d::CCArray *v121; // [rsp+B0h] [rbp-70h]
__int64 v122; // [rsp+B8h] [rbp-68h]
_QWORD v123[2]; // [rsp+C0h] [rbp-60h] BYREF
void *v124; // [rsp+D0h] [rbp-50h]
int v125; // [rsp+DCh] [rbp-44h]
__int128 __s; // [rsp+E0h] [rbp-40h] BYREF
void *__p; // [rsp+F0h] [rbp-30h]
v2 = ObjectManager::instance();
if ( (*(_BYTE *)a1 & 1) != 0 )
{
LOBYTE(v3) = ObjectManager::animLoaded(v2, *(const char **)(a1 + 16));
if ( (_BYTE)v3 )
return v3;
}
else
{
LOBYTE(v3) = ObjectManager::animLoaded(v2, (const char *)(a1 + 1));
if ( (_BYTE)v3 )
return v3;
}
v4 = ObjectManager::instance();
if ( (*(_BYTE *)a1 & 1) != 0 )
v5 = *(const char **)(a1 + 16);
else
v5 = (const char *)(a1 + 1);
ObjectManager::setLoaded(v4, v5);
v105 = cocos2d::CCAnimationCache::sharedAnimationCache();
v6 = ObjectManager::instance();
if ( (*(_BYTE *)a1 & 1) != 0 )
v7 = *(const char **)(a1 + 16);
else
v7 = (const char *)(a1 + 1);
Definition = ObjectManager::getDefinition(v6, v7);
LOBYTE(__s) = 20;
strcpy((char *)&__s + 1, "animations");
v104 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1((__int64)Definition, (char *)&__s);
if ( (__s & 1) != 0 )
operator delete(__p);
v9 = cocos2d::CCDictionary::allKeys(v104);
v3 = sub_100720070((__int64)v9);
if ( v3 )
{
v111 = a1 + 1;
v10 = 0;
v121 = v9;
v122 = a1;
while ( 1 )
{
v11 = (cocos2d::CCString *)sub_1007200C0((__int64)v9, v10);
CString = cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a2);
v14 = v13;
v106 = v10;
if ( v13 >= 0x17 )
break;
LOBYTE(__dst[0]) = 2 * v13;
v15 = (char *)__dst + 1;
if ( v13 )
goto LABEL_23;
LABEL_24:
v15[v14] = 0;
v17 = cocos2d::CCDictionary::objectForKey_1((__int64)v104, (char *)__dst);
strcpy((char *)&__s, "\ndelay");
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
if ( (__s & 1) != 0 )
operator delete(__p);
if ( v18 )
v114 = cocos2d::CCString::floatValue(v18);
else
v114 = 0.0;
v113 = (cocos2d::CCArray *)sub_10071F9E0();
LOBYTE(__s) = 18;
strcpy((char *)&__s + 1, "usesParts");
v19 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
if ( (__s & 1) != 0 )
operator delete(__p);
if ( v19 )
{
LOBYTE(v20) = cocos2d::CCString::boolValue(v19);
v125 = v20;
}
else
{
v125 = 0;
}
LOBYTE(__s) = 26;
strcpy((char *)&__s + 1, "animFrameName");
v21 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
if ( (__s & 1) != 0 )
operator delete(__p);
a2 = 0.0;
memset(&v115, 0, sizeof(v115));
if ( v21 )
{
v22 = cocos2d::CCString::getCString(v21);
}
else
{
v23 = (cocos2d::CCString *)sub_1007AB580("%s_%s", v103);
v22 = cocos2d::CCString::getCString(v23);
}
std::string::assign(&v115, v22);
LOBYTE(__s) = 22;
strcpy((char *)&__s + 1, "singleFrame");
v24 = cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
if ( (__s & 1) != 0 )
operator delete(__p);
if ( v24 )
{
LOBYTE(v123[0]) = 22;
strcpy((char *)v123 + 1, "singleFrame");
v25 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)v123);
v26 = cocos2d::CCString::getCString(v25);
v27 = strlen(v26);
if ( v27 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v28 = v27;
if ( v27 >= 0x17 )
{
v43 = (v27 | 7) + 1;
if ( (v27 | 7) == 0x17 )
v43 = 26;
v29 = (char *)operator new(v43);
__p = v29;
*(_QWORD *)&__s = v43 | 1;
*((_QWORD *)&__s + 1) = v28;
v9 = v121;
}
else
{
LOBYTE(__s) = 2 * v27;
v29 = (char *)&__s + 1;
v9 = v121;
if ( !v27 )
{
BYTE1(__s) = 0;
if ( (v123[0] & 1) != 0 )
goto LABEL_46;
goto LABEL_47;
}
}
memmove(v29, v26, v28);
v29[v28] = 0;
if ( (v123[0] & 1) != 0 )
LABEL_46:
operator delete(v124);
LABEL_47:
if ( (_BYTE)v125 )
{
v30 = (char *)&__s + 1;
if ( (__s & 1) != 0 )
v30 = (const char *)__p;
v31 = strlen(v30);
if ( v31 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v32 = v31;
if ( v31 >= 0x17 )
{
v54 = (v31 | 7) + 1;
if ( (v31 | 7) == 0x17 )
v54 = 26;
v33 = (char *)operator new(v54);
v124 = v33;
v123[0] = v54 | 1;
v123[1] = v32;
v9 = v121;
}
else
{
LOBYTE(v123[0]) = 2 * v31;
v33 = (char *)v123 + 1;
if ( !v31 )
{
LABEL_83:
v33[v32] = 0;
v46 = (cocos2d::CCSpriteFrame *)sub_1007AB360(v123);
if ( (v123[0] & 1) != 0 )
operator delete(v124);
v47 = 1;
LABEL_86:
v46->m_eObjType = v47;
v55 = (cocos2d::CCString *)sub_1007AB580("%s_%s", v103);
v56 = cocos2d::CCString::getCString(v55);
cocos2d::CCAnimationCache::addAnimation(v105, (cocos2d::CCAnimation *)v46, v56);
if ( (__s & 1) != 0 )
operator delete(__p);
goto LABEL_172;
}
}
memmove(v33, v30, v32);
goto LABEL_83;
}
v44 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v45 = (char *)&__s + 1;
if ( (__s & 1) != 0 )
v45 = (const char *)__p;
v46 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v44, v45);
v47 = 2;
goto LABEL_86;
}
strcpy((char *)&__s, "\nother");
v34 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
v35 = cocos2d::CCString::boolValue(v34);
v9 = v121;
if ( (__s & 1) != 0 )
operator delete(__p);
if ( v35 )
{
LOBYTE(__s) = 12;
strcpy((char *)&__s + 1, "frames");
v36 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
v37 = cocos2d::CCString::getCString(v36);
v38 = strlen(v37);
if ( v38 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v39 = v38;
if ( v38 >= 0x17 )
{
v57 = (v38 | 7) + 1;
if ( (v38 | 7) == 0x17 )
v57 = 26;
v40 = (char *)operator new(v57);
v109 = v40;
*(_QWORD *)v107 = v57 | 1;
v108 = v39;
}
else
{
v107[0] = 2 * v38;
v40 = &v107[1];
if ( !v38 )
{
v107[1] = 0;
if ( (__s & 1) == 0 )
goto LABEL_61;
LABEL_92:
operator delete(__p);
v41 = &v107[1];
if ( (v107[0] & 1) == 0 )
goto LABEL_93;
LABEL_62:
v41 = v109;
v42 = strlen(v109);
if ( v42 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_183;
goto LABEL_94;
}
}
memmove(v40, v37, v39);
v40[v39] = 0;
if ( (__s & 1) != 0 )
goto LABEL_92;
LABEL_61:
v41 = &v107[1];
if ( (v107[0] & 1) != 0 )
goto LABEL_62;
LABEL_93:
v42 = strlen(&v107[1]);
if ( v42 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_183:
sub_100006BF0(0.0);
LABEL_94:
v58 = v42;
if ( v42 >= 0x17 )
{
v60 = (v42 | 7) + 1;
if ( (v42 | 7) == 0x17 )
v60 = 26;
v59 = (char *)operator new(v60);
v120 = v59;
v118 = v60 | 1;
v119 = v58;
}
else
{
LOBYTE(v118) = 2 * v42;
v59 = (char *)&v118 + 1;
if ( !v42 )
{
LABEL_101:
v59[v58] = 0;
v110 = sub_10071F9E0();
if ( (v118 & 1) != 0 )
{
v61 = (char *)v120;
v62 = v119;
v103 = v119;
if ( v119 )
{
LABEL_103:
v63 = v62;
v64 = v61;
do
{
if ( *v64 == 32 )
goto LABEL_107;
++v64;
--v63;
}
while ( v63 );
v64 = &v61[v62];
LABEL_107:
v65 = v64 - v61;
if ( v64 == &v61[v62] )
v65 = -1;
LABEL_112:
v66 = 0;
while ( 2 )
{
if ( (v118 & 1) != 0 )
{
v68 = v119;
if ( v119 < v66 )
LABEL_177:
sub_1000547C0();
v69 = (char *)v120;
}
else
{
v68 = (unsigned __int8)v118 >> 1;
v69 = (char *)&v118 + 1;
if ( v66 > v68 )
goto LABEL_177;
}
v70 = v68 - v66;
if ( v70 >= v65 - v66 )
v70 = v65 - v66;
if ( v70 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v112 = v66;
if ( v70 >= 0x17 )
{
v74 = (v70 | 7) + 1;
if ( (v70 | 7) == 0x17 )
v74 = 26;
v71 = (char *)operator new(v74);
__p = v71;
*(_QWORD *)&__s = v74 | 1;
*((_QWORD *)&__s + 1) = v70;
v9 = v121;
}
else
{
LOBYTE(__s) = 2 * v70;
v71 = (char *)&__s + 1;
if ( !v70 )
{
BYTE1(__s) = 0;
v72 = __s;
if ( (__s & 1) == 0 )
{
LABEL_125:
v66 = v112;
if ( v72 || v112 != v103 )
{
v73 = (char *)&__s + 1;
goto LABEL_135;
}
LABEL_145:
v80 = -1;
if ( v65 != -1 )
{
if ( (v118 & 1) != 0 )
{
v81 = (char *)v120;
v82 = v119;
v66 = v65 + 1;
if ( v119 <= v65 + 1 )
goto LABEL_146;
}
else
{
v82 = (unsigned __int8)v118 >> 1;
v81 = (char *)&v118 + 1;
v66 = v65 + 1;
if ( v82 <= v65 + 1 )
goto LABEL_146;
}
v83 = &v81[v66];
v84 = v82 + ~v65;
while ( *v83 != 32 )
{
++v83;
if ( !--v84 )
{
v83 = &v81[v82];
break;
}
}
v80 = v83 - v81;
if ( v83 == &v81[v82] )
v80 = -1;
}
LABEL_146:
if ( (__s & 1) != 0 )
operator delete(__p);
v67 = v65 == -1;
v65 = v80;
if ( v67 )
{
if ( (v118 & 1) != 0 )
operator delete(v120);
for ( i = 0; i < (unsigned int)sub_100720070((__int64)v110); ++i )
{
v86 = (cocos2d::CCString *)sub_1007200C0((__int64)v110, i);
cocos2d::CCString::intValue(v86);
if ( (_BYTE)v125 )
{
v87 = (cocos2d::CCSpriteFrame *)sub_1007AB580("%s_%03d.png", v103);
v88 = 1;
}
else
{
v89 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v90 = (cocos2d::CCString *)sub_1007AB580("%s_%03d.png", v103);
v91 = cocos2d::CCString::getCString(v90);
v87 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v89, v91);
v88 = 2;
}
v87->m_eObjType = v88;
sub_10071FCD0((__int64)v113, v87);
}
if ( (v107[0] & 1) != 0 )
operator delete(v109);
goto LABEL_171;
}
continue;
}
LABEL_132:
v66 = v112;
if ( !*((_QWORD *)&__s + 1) && v112 == v103 )
goto LABEL_145;
v73 = (const char *)__p;
LABEL_135:
v75 = strlen(v73);
if ( v75 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v76 = v75;
if ( v75 >= 0x17 )
{
v78 = (v75 | 7) + 1;
if ( (v75 | 7) == 0x17 )
v78 = 26;
v77 = (char *)operator new(v78);
v124 = v77;
v123[0] = v78 | 1;
v123[1] = v76;
v9 = v121;
}
else
{
LOBYTE(v123[0]) = 2 * v75;
v77 = (char *)v123 + 1;
if ( !v75 )
{
LABEL_143:
v77[v76] = 0;
v79 = (cocos2d::CCObject *)sub_1007AB360(v123);
sub_10071FCD0((__int64)v110, v79);
v66 = v112;
if ( (v123[0] & 1) != 0 )
operator delete(v124);
goto LABEL_145;
}
}
memmove(v77, v73, v76);
goto LABEL_143;
}
}
break;
}
memmove(v71, &v69[v112], v70);
v71[v70] = 0;
v72 = __s;
if ( (__s & 1) == 0 )
goto LABEL_125;
goto LABEL_132;
}
}
else
{
v62 = (unsigned __int8)v118 >> 1;
v61 = (char *)&v118 + 1;
v103 = v62;
if ( (unsigned __int8)v118 >> 1 )
goto LABEL_103;
}
v65 = -1;
goto LABEL_112;
}
}
memmove(v59, v41, v58);
goto LABEL_101;
}
LOBYTE(__s) = 12;
strcpy((char *)&__s + 1, "frames");
v48 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(v17, (char *)&__s);
v49 = cocos2d::CCString::intValue(v48);
if ( (__s & 1) != 0 )
operator delete(__p);
if ( v49 > 0 )
{
if ( (_BYTE)v125 )
{
v50 = -v49;
v51 = 1;
do
{
v52 = sub_1007AB580("%s_%03d.png", v103);
*(_DWORD *)(v52 + 28) = 1;
sub_10071FCD0((__int64)v113, (cocos2d::CCObject *)v52);
v53 = v50 + v51++ + 1;
}
while ( v53 != 1 );
}
else
{
v92 = -v49;
v93 = 1;
do
{
v94 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v95 = (cocos2d::CCString *)sub_1007AB580("%s_%03d.png", v103);
v96 = cocos2d::CCString::getCString(v95);
v97 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v94, v96);
v97->m_eObjType = 2;
sub_10071FCD0((__int64)v113, v97);
v98 = v92 + v93++ + 1;
}
while ( v98 != 1 );
}
}
LABEL_171:
*(_QWORD *)&a2 = LODWORD(v114);
v99 = cocos2d::CCAnimation::createWithSpriteFrames(v113, v114);
v100 = (cocos2d::CCString *)sub_1007AB580("%s_%s", v103);
v101 = cocos2d::CCString::getCString(v100);
cocos2d::CCAnimationCache::addAnimation(v105, v99, v101);
LABEL_172:
if ( (*(_BYTE *)&v115.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v115.__r_.__value_.__l.__data_);
if ( (__dst[0] & 1) != 0 )
operator delete(v117);
v10 = v106 + 1;
v3 = sub_100720070((__int64)v9);
if ( v106 + 1 >= v3 )
return v3;
}
v16 = (v13 | 7) + 1;
if ( (v13 | 7) == 0x17 )
v16 = 26;
v15 = (char *)operator new(v16);
v117 = v15;
__dst[0] = v16 + 1;
__dst[1] = v14;
LABEL_23:
memmove(v15, CString, v14);
goto LABEL_24;
}
return v3;
}