//
// CCAnimateFrameCache::addCustomSpriteFramesWithFile from 0x3c4b38 to 0x3c4fa4 (1132 bytes)
//
// 0 xrefs:
//
// 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:33 +0000
//
cocos2d::CCNode *__fastcall CCAnimateFrameCache::addCustomSpriteFramesWithFile(
CCAnimateFrameCache *this,
const char *a2)
{
int v3; // r6
size_t v4; // r0
int v5; // r6
cocos2d::CCNode *result; // r0
int v7; // r8
cocos2d::CCObject *v8; // r0
cocos2d::CCObject *v9; // r7
size_t v10; // r0
DS_Dictionary *v11; // r6
cocos2d::CCString *DictForKey; // r0
cocos2d::CCString *v13; // r6
const char *CString; // r6
size_t v15; // r0
cocos2d::CCArray *v16; // r0
int v17; // r7
char *v18; // r3
unsigned __int8 *v19; // r7
char *v20; // r2
char *v21; // r6
int v22; // r0
int v23; // r6
int v24; // r8
unsigned int v25; // r7
size_t v26; // r2
unsigned int v27; // r3
char *v28; // r1
size_t v29; // r3
char *v30; // r1
char *v31; // r7
size_t v32; // r0
cocos2d::CCObject *v33; // r0
char *v34; // r2
unsigned int v35; // r3
unsigned __int8 *v36; // r1
unsigned __int8 *v37; // r3
unsigned __int8 *v38; // r6
int v39; // r0
unsigned int v40; // r6
unsigned int v41; // r2
char *v42; // r3
size_t v43; // r7
int v44; // r3
size_t i; // r8
char *v46; // lr
unsigned int v47; // r2
char *v48; // r7
int v49; // r0
const char *v50; // r11
size_t v51; // r0
ObjectManager *v52; // r0
cocos2d::CCDictionary *v53; // r3
cocos2d::CCDictionary *v54; // r9
char *v55; // r2
const char *v56; // r0
const char *v57; // r8
size_t v58; // r0
size_t v59; // r0
unsigned __int8 *v60; // r3
char *v61; // r2
char *v62; // r1
int v63; // r9
char *v64; // r12
char *v65; // r9
int v66; // t1
cocos2d::CCArray *v67; // [sp+8h] [bp-54h]
cocos2d::CCString *v69; // [sp+10h] [bp-4Ch]
cocos2d::CCString *v70; // [sp+14h] [bp-48h]
char v71[4]; // [sp+30h] [bp-2Ch] BYREF
unsigned int v72; // [sp+34h] [bp-28h]
char *v73; // [sp+38h] [bp-24h]
int v74; // [sp+3Ch] [bp-20h] BYREF
unsigned int v75; // [sp+40h] [bp-1Ch]
char *v76; // [sp+44h] [bp-18h]
int v77; // [sp+48h] [bp-14h] BYREF
size_t v78; // [sp+4Ch] [bp-10h]
char *v79; // [sp+50h] [bp-Ch]
v3 = *((_DWORD *)this + 15);
v77 = 0;
v78 = 0;
v79 = nullptr;
v4 = strlen(a2);
std::string::__init(&v77, a2, v4);
v5 = cocos2d::CCDictionary::objectForKey(v3, &v77);
result = (cocos2d::CCNode *)std::string::~string((int)&v77);
if ( v5 )
return result;
v7 = *((_DWORD *)this + 15);
v8 = (cocos2d::CCObject *)cocos2d::CCNode::create(result);
v77 = 0;
v78 = 0;
v79 = nullptr;
v9 = v8;
v10 = strlen(a2);
std::string::__init(&v77, a2, v10);
cocos2d::CCDictionary::setObject(v7, v9);
std::string::~string((int)&v77);
v11 = (DS_Dictionary *)operator new(0xD8u);
DS_Dictionary::DS_Dictionary(v11);
DS_Dictionary::loadRootSubDictFromFile(v11, a2);
DictForKey = (cocos2d::CCString *)DS_Dictionary::getDictForKey(v11, nullptr, 0);
v77 = 0;
v78 = 0;
v79 = nullptr;
v69 = DictForKey;
std::string::__init(&v77, "copies", 6u);
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v69, &v77);
result = (cocos2d::CCNode *)std::string::~string((int)&v77);
if ( !v13 )
return result;
*(_DWORD *)v71 = 0;
v72 = 0;
v73 = nullptr;
CString = (const char *)cocos2d::CCString::getCString(v13);
v15 = strlen(CString);
v16 = (cocos2d::CCArray *)std::string::__init((int *)v71, CString, v15);
v67 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
if ( (v71[0] & 1) == 0 )
{
v17 = (int)(unsigned __int8)v71[0] >> 1;
if ( !v17 )
{
v23 = -1;
goto LABEL_16;
}
v18 = &v71[1];
LABEL_5:
v19 = (unsigned __int8 *)&v18[v17];
v20 = v18;
while ( 1 )
{
v21 = v20;
if ( v20 == (char *)v19 )
break;
v22 = (unsigned __int8)*v20++;
if ( v22 == 32 )
{
v23 = v21 - v18;
goto LABEL_10;
}
}
v23 = -1;
LABEL_10:
if ( (v71[0] & 1) != 0 )
goto LABEL_13;
LABEL_16:
v24 = (int)(unsigned __int8)v71[0] >> 1;
goto LABEL_17;
}
v17 = v72;
v18 = v73;
if ( v72 )
goto LABEL_5;
v23 = -1;
LABEL_13:
v24 = v72;
LABEL_17:
v25 = 0;
while ( 1 )
{
v26 = v23 - v25;
v74 = 0;
v75 = 0;
v76 = nullptr;
if ( (v71[0] & 1) != 0 )
{
v27 = v72;
if ( v25 > v72 )
goto LABEL_22;
v28 = v73;
}
else
{
v27 = (int)(unsigned __int8)v71[0] >> 1;
if ( v25 > v27 )
LABEL_22:
sub_387168();
v28 = &v71[1];
}
v29 = v27 - v25;
v30 = &v28[v25];
if ( v26 >= v29 )
v26 = v29;
std::string::__init(&v74, v30, v26);
if ( (v74 & 1) != 0 )
{
if ( v75 || v25 != v24 )
{
v31 = v76;
LABEL_36:
v77 = 0;
v78 = 0;
v79 = nullptr;
v32 = strlen(v31);
std::string::__init(&v77, v31, v32);
v33 = (cocos2d::CCObject *)cocos2d::CCString::create(&v77);
cocos2d::CCArray::addObject(v67, v33);
std::string::~string((int)&v77);
}
}
else if ( (unsigned __int8)v74 >> 1 || v25 != v24 )
{
v31 = (char *)&v74 + 1;
goto LABEL_36;
}
if ( v23 == -1 )
break;
v25 = v23 + 1;
if ( (v71[0] & 1) != 0 )
{
v34 = v73;
v35 = v72;
}
else
{
v35 = (int)(unsigned __int8)v71[0] >> 1;
v34 = &v71[1];
}
if ( v25 < v35 )
{
v36 = (unsigned __int8 *)&v34[v25];
v37 = (unsigned __int8 *)&v34[v35];
while ( 1 )
{
v38 = v36;
if ( v36 == v37 )
break;
v39 = *v36++;
if ( v39 == 32 )
{
v23 = v38 - (unsigned __int8 *)v34;
goto LABEL_46;
}
}
}
v23 = -1;
LABEL_46:
std::string::~string((int)&v74);
}
v40 = 0;
std::string::~string((int)&v74);
std::string::~string((int)v71);
while ( 1 )
{
result = (cocos2d::CCNode *)cocos2d::CCArray::count(v67);
if ( v40 >= (unsigned int)result )
return result;
v70 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v67, v40);
v56 = (const char *)cocos2d::CCString::getCString(v70);
*(_DWORD *)v71 = 0;
v72 = 0;
v73 = nullptr;
v57 = v56;
v58 = strlen(a2);
std::string::__init((int *)v71, a2, v58);
v74 = 0;
v75 = 0;
v76 = nullptr;
std::string::__init(&v74, "xyz", 3u);
v77 = 0;
v78 = 0;
v79 = nullptr;
v59 = strlen(v57);
std::string::__init(&v77, v57, v59);
for ( i = 0; ; i += v44 )
{
if ( (v71[0] & 1) != 0 )
{
v46 = v73;
v47 = v72;
}
else
{
v47 = (int)(unsigned __int8)v71[0] >> 1;
v46 = &v71[1];
}
if ( (v74 & 1) != 0 )
{
v48 = v76;
v49 = v75;
}
else
{
v49 = (int)(unsigned __int8)v74 >> 1;
v48 = (char *)&v74 + 1;
}
if ( i > v47 || v47 - i < v49 )
break;
if ( v49 )
{
v60 = (unsigned __int8 *)&v46[i];
v61 = &v46[v47];
if ( v61 - &v46[i] >= v49 )
{
LABEL_73:
while ( 1 )
{
v62 = (char *)v60;
if ( v60 == (unsigned __int8 *)&v61[1 - v49] )
break;
v63 = *v60++;
if ( v63 == (unsigned __int8)*v48 )
{
v64 = v48;
v65 = v62;
while ( ++v64 != &v48[v49] )
{
v66 = (unsigned __int8)*++v65;
if ( v66 != (unsigned __int8)*v64 )
goto LABEL_73;
}
goto LABEL_80;
}
}
}
v62 = v61;
LABEL_80:
if ( v62 == v61 )
break;
i = v62 - v46;
}
if ( i == -1 )
break;
if ( (v74 & 1) != 0 )
v41 = v75;
else
v41 = (int)(unsigned __int8)v74 >> 1;
if ( (v77 & 1) != 0 )
{
v42 = v79;
v43 = v78;
}
else
{
v43 = (int)(unsigned __int8)v77 >> 1;
v42 = (char *)&v77 + 1;
}
std::string::replace(v71, i, v41, v42, v43);
if ( (v77 & 1) != 0 )
v44 = v78;
else
v44 = (int)(unsigned __int8)v77 >> 1;
}
std::string::~string((int)&v77);
std::string::~string((int)&v74);
if ( (v71[0] & 1) != 0 )
v50 = v73;
else
v50 = &v71[1];
v74 = 0;
v75 = 0;
v76 = nullptr;
v51 = strlen(v50);
std::string::__init(&v74, v50, v51);
std::string::~string((int)v71);
v77 = 0;
v78 = 0;
v79 = nullptr;
std::string::__init(&v77, "xyz", 3u);
v52 = (ObjectManager *)cocos2d::CCString::create(&v77);
v54 = (cocos2d::CCDictionary *)ObjectManager::replaceAllOccurencesOfString(v52, v70, v69, v53);
std::string::~string((int)&v77);
if ( (v74 & 1) != 0 )
v55 = v76;
else
v55 = (char *)&v74 + 1;
CCAnimateFrameCache::addDict(this, v54, v55);
++v40;
std::string::~string((int)&v74);
}
}