//
// cocos2d::CCAnimationCache::parseVersion1 from 0x10046d520 to 0x10046d785 (613 bytes)
//
// 1 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0x10046ddd0
//
// 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
//
void __fastcall cocos2d::CCAnimationCache::parseVersion1(cocos2d::CCAnimationCache *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCDictElement *m_pElements; // r15
__int64 m_pObject; // r13
__int64 v4; // r12
cocos2d::CCString *v5; // rax
unsigned int v6; // eax
cocos2d::CCArray *v7; // r13
unsigned int *v8; // rax
cocos2d::CCString **v9; // rbx
unsigned __int64 v10; // r12
const char *CString; // rax
cocos2d::CCSpriteFrame *v12; // rax
cocos2d::CCSpriteFrame *v13; // r15
cocos2d::CCAnimationFrame *v14; // r14
cocos2d::CCAnimation *v15; // rax
cocos2d::CCAnimationCache *v16; // rdi
cocos2d::CCAnimation *v17; // rbx
_QWORD *v18; // r12
void *v19; // r14
cocos2d::CCSpriteFrameCache *v20; // [rsp+8h] [rbp-68h]
const char *v21; // [rsp+10h] [rbp-60h]
cocos2d::CCDictElement *v22; // [rsp+18h] [rbp-58h]
__int64 v23; // [rsp+20h] [rbp-50h]
float v24; // [rsp+2Ch] [rbp-44h]
char v25[16]; // [rsp+30h] [rbp-40h] BYREF
void *__p; // [rsp+40h] [rbp-30h]
v20 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( a2 )
{
m_pElements = a2->m_pElements;
while ( m_pElements )
{
m_pObject = (__int64)m_pElements->m_pObject;
v21 = (const char *)m_pElements;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
v25[0] = 12;
strcpy(&v25[1], "frames");
v4 = cocos2d::CCDictionary::objectForKey_1(m_pObject, v25);
if ( (v25[0] & 1) != 0 )
operator delete(__p);
strcpy(v25, "\ndelay");
v5 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(m_pObject, (__int64)v25);
v24 = cocos2d::CCString::floatValue(v5);
if ( (v25[0] & 1) != 0 )
operator delete(__p);
if ( v4 )
{
v22 = m_pElements;
v6 = sub_100720070(v4);
v7 = (cocos2d::CCArray *)sub_10071FD00(v6);
cocos2d::CCObject::retain(v7);
v23 = v4;
v8 = *(unsigned int **)(v4 + 56);
if ( *v8 )
{
v9 = *((cocos2d::CCString ***)v8 + 2);
v10 = (unsigned __int64)&v9[*v8 - 1];
do
{
if ( !*v9 )
break;
CString = cocos2d::CCString::getCString(*v9);
v12 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v20, CString);
if ( v12 )
{
v13 = v12;
v14 = (cocos2d::CCAnimationFrame *)operator new(0x50u);
cocos2d::CCAnimationFrame::CCAnimationFrame((__int64)v14);
cocos2d::CCAnimationFrame::initWithSpriteFrame(v14, v13, 1.0, nullptr);
sub_10071FCD0(v7, v14);
cocos2d::CCObject::release(v14);
}
++v9;
}
while ( (unsigned __int64)v9 <= v10 );
}
m_pElements = v22;
if ( (unsigned int)sub_100720070(v7) )
{
sub_100720070(v7);
sub_100720070(v23);
v15 = cocos2d::CCAnimation::create(v7, v24, 1u);
v16 = (cocos2d::CCAnimationCache *)qword_1009A4FA8;
if ( !qword_1009A4FA8 )
{
v17 = v15;
v18 = operator new(0x40u);
cocos2d::CCObject::CCObject(v18);
*v18 = off_100939850;
v18[7] = 0;
qword_1009A4FA8 = (__int64)v18;
v19 = operator new(0x48u);
cocos2d::CCDictionary::CCDictionary((__int64)v19);
v18[7] = v19;
v16 = (cocos2d::CCAnimationCache *)qword_1009A4FA8;
v15 = v17;
}
cocos2d::CCAnimationCache::addAnimation(v16, v15, v21);
cocos2d::CCObject::release(v7);
}
}
}
}
}