//
// CCAnimateFrameCache::addDict_1 from 0x1005993f0 to 0x100599983 (1427 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 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 12:32:30 +0000
//
_QWORD *__fastcall CCAnimateFrameCache::addDict_1(__int64 a1, _QWORD *a2, const char *a3, double a4)
{
__int64 v5; // r14
size_t v6; // rax
size_t v7; // r15
char *v8; // r12
size_t v9; // r13
_QWORD *v10; // rbx
int v11; // edx
char *v12; // rsi
_QWORD *v13; // rdi
__int64 v14; // rbx
int v15; // r15d
__int64 v16; // rax
const char *CString; // r14
size_t v18; // rax
size_t v19; // rbx
char *v20; // r13
char *v21; // rsi
_QWORD *v22; // r14
__int64 v23; // rax
size_t v24; // r12
_QWORD *v25; // rbx
_QWORD *v26; // rax
int i; // r12d
_QWORD *v28; // r15
char *v29; // rsi
__int64 v30; // rax
__int64 v31; // rax
__int64 v32; // rax
__int64 v34; // [rsp+0h] [rbp-A0h]
int v35; // [rsp+8h] [rbp-98h]
int NumKeys; // [rsp+Ch] [rbp-94h]
__int64 v37; // [rsp+10h] [rbp-90h]
__int64 v38; // [rsp+10h] [rbp-90h]
_QWORD *v39; // [rsp+18h] [rbp-88h]
char v40; // [rsp+20h] [rbp-80h] BYREF
char v41[15]; // [rsp+21h] [rbp-7Fh] BYREF
void *v42; // [rsp+30h] [rbp-70h]
int v43; // [rsp+3Ch] [rbp-64h]
__int64 v44; // [rsp+40h] [rbp-60h] BYREF
size_t v45; // [rsp+48h] [rbp-58h]
void *v46; // [rsp+50h] [rbp-50h]
__int128 __dst; // [rsp+58h] [rbp-48h] BYREF
void *__p; // [rsp+68h] [rbp-38h]
_QWORD *v49; // [rsp+70h] [rbp-30h]
v49 = a2;
v39 = cocos2d::CCDictionary::create();
v34 = a1;
v5 = *(_QWORD *)(a1 + 72);
v6 = strlen(a3);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
*(_QWORD *)&__dst = v9 + 1;
*((_QWORD *)&__dst + 1) = v7;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v6;
v8 = (char *)&__dst + 1;
if ( v6 )
LABEL_8:
memcpy(v8, a3, v7);
v8[v7] = 0;
cocos2d::CCDictionary::setObject(v5, (__int64)v39, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
v10 = v49;
DS_Dictionary::stepIntoSubDictWithKey((__int64)v49, "animationContainer");
NumKeys = DS_Dictionary::getNumKeys((__int64)v10);
if ( NumKeys )
{
v11 = 0;
while ( 1 )
{
v35 = v11;
DS_Dictionary::getKey(&__dst, (__int64)v49, v11);
v12 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
v12 = (char *)__p;
v13 = v49;
DS_Dictionary::stepIntoSubDictWithKey((__int64)v49, v12);
v14 = sub_1007FE900(v13);
cocos2d::CCDictionary::setObject(*(_QWORD *)(v34 + 56), v14, (char *)&__dst);
v37 = v14;
v43 = DS_Dictionary::getNumKeys((__int64)v49);
if ( v43 )
break;
LABEL_31:
DS_Dictionary::stepOutOfSubDict((__int64)v49);
if ( (__dst & 1) != 0 )
operator delete(__p);
v11 = v35 + 1;
if ( v35 + 1 == NumKeys )
goto LABEL_33;
}
v15 = 0;
while ( 1 )
{
v16 = sub_10088E820("sprite_%i", v34);
CString = (const char *)cocos2d::CCString::getCString(v16);
v18 = strlen(CString);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v19 = v18;
if ( v18 >= 0x17 )
break;
LOBYTE(v44) = 2 * v18;
v20 = (char *)&v44 + 1;
if ( v18 )
goto LABEL_29;
BYTE1(v44) = 0;
v21 = (char *)&v44 + 1;
if ( (v44 & 1) != 0 )
goto LABEL_23;
LABEL_24:
DS_Dictionary::stepIntoSubDictWithKey((__int64)v49, v21);
v22 = operator new(0x68u);
cocos2d::CCObject::CCObject((__int64)v22);
*v22 = off_100B71630;
sub_1002782A0(v22 + 7);
sub_1002782A0(v22 + 8);
sub_1002782A0(v22 + 9);
v22[12] = 0;
v22[10] = 0;
*(_QWORD *)((char *)v22 + 85) = 0;
SpriteDescription::initDescription_1(v22, v49);
cocos2d::CCObject::autorelease((__int64)v22);
sub_1007FEBF0(v37, v22);
DS_Dictionary::stepOutOfSubDict((__int64)v49);
if ( (v44 & 1) != 0 )
operator delete(v46);
if ( v43 == ++v15 )
goto LABEL_31;
}
v23 = v18 | 7;
v24 = 26;
if ( (v19 | 7) != 0x17 )
v24 = v23 + 1;
v20 = (char *)operator new(v24);
v46 = v20;
v44 = v24 | 1;
v45 = v19;
LABEL_29:
memmove(v20, CString, v19);
v20[v19] = 0;
v21 = (char *)&v44 + 1;
if ( (v44 & 1) == 0 )
goto LABEL_24;
LABEL_23:
v21 = (char *)v46;
goto LABEL_24;
}
LABEL_33:
v25 = v49;
DS_Dictionary::stepBackToRootSubDict(v49);
if ( DS_Dictionary::stepIntoSubDictWithKey((__int64)v25, "usedTextures") )
{
v26 = cocos2d::CCDictionary::create();
LOBYTE(__dst) = 24;
strcpy((char *)&__dst + 1, "usedTextures");
v38 = (__int64)v26;
cocos2d::CCDictionary::setObject((__int64)v39, (__int64)v26, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
v43 = DS_Dictionary::getNumKeys((__int64)v49);
if ( v43 )
{
for ( i = 0; v43 != i; ++i )
{
DS_Dictionary::getKey(&__dst, (__int64)v49, i);
v28 = cocos2d::CCDictionary::create();
cocos2d::CCDictionary::setObject(v38, (__int64)v28, (char *)&__dst);
v29 = (char *)&__dst + 1;
if ( (__dst & 1) != 0 )
v29 = (char *)__p;
DS_Dictionary::stepIntoSubDictWithKey((__int64)v49, v29);
DS_Dictionary::getStringForKey(&v44, (__int64)v49, "texture", a4);
v30 = sub_10088E600(&v44);
v40 = 14;
strcpy(v41, "texture");
cocos2d::CCDictionary::setObject((__int64)v28, v30, &v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( (v44 & 1) != 0 )
operator delete(v46);
DS_Dictionary::getStringForKey(&v44, (__int64)v49, "tag", a4);
v31 = sub_10088E600(&v44);
v40 = 6;
*(_DWORD *)v41 = 6775156;
cocos2d::CCDictionary::setObject((__int64)v28, v31, &v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( (v44 & 1) != 0 )
operator delete(v46);
DS_Dictionary::getStringForKey(&v44, (__int64)v49, "customID", a4);
if ( (v44 & 1) != 0 )
{
if ( !v45 )
goto LABEL_55;
}
else if ( !((unsigned __int8)v44 >> 1) )
{
goto LABEL_55;
}
v32 = sub_10088E600(&v44);
v40 = 16;
strcpy(v41, "customID");
cocos2d::CCDictionary::setObject((__int64)v28, v32, &v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
LABEL_55:
DS_Dictionary::stepOutOfSubDict((__int64)v49);
if ( (v44 & 1) != 0 )
{
operator delete(v46);
if ( (__dst & 1) != 0 )
LABEL_59:
operator delete(__p);
}
else if ( (__dst & 1) != 0 )
{
goto LABEL_59;
}
}
}
}
return v39;
}