//
// cocos2d::CCAnimationCache::addAnimationsWithDictionary from 0x18008d380 to 0x18008d6f5 (885 bytes)
//
// 3 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithFile @ 0x18008d75c
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bfd3c
//
// 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 11:22:06 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall cocos2d::CCAnimationCache::addAnimationsWithDictionary(
cocos2d::CCAnimationCache *this,
struct cocos2d::CCDictionary *a2,
const char *a3)
{
cocos2d::CCAnimationCache *v5; // r14
struct cocos2d::CCDictionary *v6; // rdi
void *v7; // r8
__int64 v8; // rbx
void *v9; // r8
cocos2d::CCString *v10; // rax
int v11; // r13d
void *v12; // r8
__int64 v13; // rsi
void *v14; // r8
unsigned int *v15; // rsi
__int64 v16; // rax
cocos2d::CCString **v17; // rsi
cocos2d::CCString **v18; // r15
cocos2d::CCString *v19; // r14
struct cocos2d::CCFileUtils *v20; // rdi
__int64 v21; // rbx
const char *CString; // rax
const char *v23; // rax
const char *v24; // rbx
cocos2d::CCSpriteFrameCache *v25; // rax
int v26; // r13d
struct cocos2d::CCDictionary *v27; // [rsp+30h] [rbp-59h]
void *v29[2]; // [rsp+40h] [rbp-49h] BYREF
__m128i v30; // [rsp+50h] [rbp-39h]
void *v31[2]; // [rsp+60h] [rbp-29h] BYREF
__m128i v32; // [rsp+70h] [rbp-19h]
void *Block[2]; // [rsp+80h] [rbp-9h] BYREF
__m128i si128; // [rsp+90h] [rbp+7h]
v5 = this;
sub_180005A10(Block, "animations");
v6 = (struct cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey((__int64)a2, (__int64)Block);
v27 = v6;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v7 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v7);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(Block[0]) = 0;
if ( v6 )
{
v31[1] = (void *)29541;
v32 = _mm_load_si128((const __m128i *)&xmmword_1800F1940);
v31[0] = (void *)0x69747265706F7270LL;
v8 = cocos2d::CCDictionary::objectForKey((__int64)a2, (__int64)v31);
if ( v32.m128i_i64[1] > 0xFuLL )
{
v9 = v31[0];
if ( (unsigned __int64)(v32.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)v31[0] - 1);
if ( (unsigned __int64)((char *)v31[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v9);
}
v32 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(v31[0]) = 0;
if ( !v8 )
goto LABEL_35;
*(_OWORD *)v29 = 0;
v30 = _mm_load_si128((const __m128i *)&xmmword_180109E30);
strcpy((char *)v29, "format");
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v8, (__int64)v29);
v11 = cocos2d::CCString::uintValue(v10);
if ( v30.m128i_i64[1] > 0xFuLL )
{
v12 = v29[0];
if ( (unsigned __int64)(v30.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)v29[0] - 1);
if ( (unsigned __int64)((char *)v29[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v12);
}
v30 = _mm_load_si128((const __m128i *)&xmmword_180106040);
strcpy((char *)v29, "spritesheets");
BYTE5(v29[1]) = 0;
HIWORD(v29[1]) = 0;
v13 = cocos2d::CCDictionary::objectForKey(v8, (__int64)v29);
if ( v30.m128i_i64[1] > 0xFuLL )
{
v14 = v29[0];
if ( (unsigned __int64)(v30.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)v29[0] - 1);
if ( (unsigned __int64)((char *)v29[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v14);
}
v30 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(v29[0]) = 0;
if ( v13 )
{
v15 = *(unsigned int **)(v13 + 56);
v16 = *v15;
if ( (_DWORD)v16 )
{
v17 = *((cocos2d::CCString ***)v15 + 2);
v18 = &v17[v16 - 1];
if ( v17 <= v18 )
{
do
{
v19 = *v17;
if ( !*v17 )
break;
if ( a3 )
{
v20 = cocos2d::CCFileUtils::sharedFileUtils();
v21 = *(_QWORD *)v20;
CString = cocos2d::CCString::getCString(v19);
v23 = (const char *)(*(__int64 (__fastcall **)(struct cocos2d::CCFileUtils *, const char *, const char *))(v21 + 72))(
v20,
CString,
a3);
}
else
{
v23 = cocos2d::CCString::getCString(*v17);
}
v24 = v23;
v25 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v25, v24);
++v17;
}
while ( v17 <= v18 );
v6 = v27;
v5 = this;
}
}
}
v26 = v11 - 1;
if ( v26 )
{
if ( v26 == 1 )
cocos2d::CCAnimationCache::parseVersion2(v5, v6);
}
else
{
LABEL_35:
cocos2d::CCAnimationCache::parseVersion1(v5, v6);
}
}
}