//
// cocos2d::CCAnimationCache::parseVersion1 from 0x18008d810 to 0x18008db52 (834 bytes)
//
// 3 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0x18008d6c9
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bfd60
//
// 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:07 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall cocos2d::CCAnimationCache::parseVersion1(
cocos2d::CCAnimationCache *this,
struct cocos2d::CCDictionary *a2)
{
cocos2d::CCSpriteFrameCache *v3; // rdi
__int64 v4; // r12
__int64 v5; // r15
__m128i si128; // xmm9
__m128i v7; // xmm10
__m128i v8; // xmm8
__int64 v9; // rbx
cocos2d::CCArray *v10; // r13
void *v11; // r8
cocos2d::CCString *v12; // rax
float v13; // xmm7_4
void *v14; // rcx
unsigned int v15; // eax
struct cocos2d::CCArray *v16; // r14
unsigned int *v17; // rbx
__int64 v18; // rcx
cocos2d::CCString **v19; // rbx
cocos2d::CCString **i; // rbp
const char *CString; // rax
struct cocos2d::CCSpriteFrame *v22; // rsi
cocos2d::CCAnimationFrame *v23; // rax
cocos2d::CCAnimationFrame *v24; // rdi
struct cocos2d::CCSpriteFrame *v25; // rbx
cocos2d::CCSpriteFrameCache *v26; // rax
cocos2d::CCSpriteFrameCache *v27; // [rsp+30h] [rbp-D8h]
void *Block[2]; // [rsp+40h] [rbp-C8h] BYREF
__m128i v29; // [rsp+50h] [rbp-B8h]
__int128 v30; // [rsp+60h] [rbp-A8h] BYREF
__m128i v31; // [rsp+70h] [rbp-98h]
v3 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v27 = v3;
if ( a2 )
{
v4 = *((_QWORD *)a2 + 7);
if ( v4 )
{
v5 = *(_QWORD *)(v4 + 288);
si128 = _mm_load_si128((const __m128i *)&xmmword_180106010);
v7 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
v8 = _mm_load_si128((const __m128i *)&xmmword_180109E30);
while ( 1 )
{
v9 = *(_QWORD *)(v4 + 264);
*(_OWORD *)Block = 0;
v29 = v8;
strcpy((char *)Block, "frames");
v10 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v9, (__int64)Block);
if ( v29.m128i_i64[1] > 0xFuLL )
{
v11 = Block[0];
if ( (unsigned __int64)(v29.m128i_i64[1] + 1) >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v11);
}
v29 = v7;
LOBYTE(Block[0]) = 0;
v30 = 0;
v31 = si128;
strcpy((char *)&v30, "delay");
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v9, (__int64)&v30);
v13 = cocos2d::CCString::floatValue(v12);
if ( v31.m128i_i64[1] > 0xFuLL )
{
v14 = (void *)v30;
if ( (unsigned __int64)(v31.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *(void **)(v30 - 8);
if ( (unsigned __int64)(v30 - (_QWORD)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v14);
}
if ( v10 )
{
v15 = cocos2d::CCArray::count(v10);
v16 = cocos2d::CCArray::createWithCapacity(v15);
cocos2d::CCObject::retain(v16);
v17 = *((unsigned int **)v10 + 7);
v18 = *v17;
if ( (_DWORD)v18 )
{
v19 = *((cocos2d::CCString ***)v17 + 2);
for ( i = &v19[v18 - 1]; v19 <= i; ++v19 )
{
if ( !*v19 )
break;
CString = cocos2d::CCString::getCString(*v19);
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v3, CString);
if ( v22 )
{
v23 = (cocos2d::CCAnimationFrame *)sub_1800E4AC0(0x50u);
if ( v23 )
v24 = cocos2d::CCAnimationFrame::CCAnimationFrame(v23);
else
v24 = nullptr;
cocos2d::CCAnimationFrame::initWithSpriteFrame(v24, v22, 1.0, nullptr);
cocos2d::CCArray::addObject(v16, v24);
cocos2d::CCObject::release(v24);
v3 = v27;
}
}
}
if ( (unsigned int)cocos2d::CCArray::count(v16) )
{
cocos2d::CCArray::count(v16);
cocos2d::CCArray::count(v10);
v25 = cocos2d::CCAnimation::create(v16, v13, 1u);
v26 = cocos2d::CCAnimationCache::sharedAnimationCache();
cocos2d::CCSpriteFrameCache::addSpriteFrame(v26, v25, (char *)v4);
cocos2d::CCObject::release(v16);
}
}
v4 = v5;
if ( !v5 )
break;
v5 = *(_QWORD *)(v5 + 288);
}
}
}
}