//
// CCAnimateFrameCache::addSpriteFramesWithFile from 0x10056c0d0 to 0x10056c25a (394 bytes)
//
// 2 xrefs:
// > CCPartAnimSprite::initWithAnimDesc @ 0x100373be3
// > LoadingLayer::loadAssets @ 0x1003a35a3
//
// 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
//
cocos2d::CCDictionary *__fastcall CCAnimateFrameCache::addSpriteFramesWithFile(CCAnimateFrameCache *a1, const char *a2)
{
double v2; // xmm0_8
CCAnimateFrameCache *v3; // r14
cocos2d::CCDictionary *m_animateDescriptions; // r15
size_t v5; // rax
size_t v6; // r12
char *v7; // r13
cocos2d::CCDictionary *v8; // r14
size_t v9; // r15
__int64 v10; // r15
__int64 v11; // r14
size_t v12; // rax
size_t v13; // r15
char *v14; // r12
cocos2d::CCDictionary *v15; // r15
cocos2d::CCDictionary *result; // rax
size_t v17; // r13
cocos2d::CCDictionary *v18; // rbx
size_t __dst; // [rsp+10h] [rbp-40h] BYREF
size_t v20; // [rsp+18h] [rbp-38h]
void *__p; // [rsp+20h] [rbp-30h]
v3 = a1;
m_animateDescriptions = a1->m_animateDescriptions;
v5 = strlen(a2);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_24;
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = a1->m_animateDescriptions;
v9 = 26;
if ( (v5 | 7) != 0x17 )
v9 = (v5 | 7) + 1;
v7 = (char *)operator new(v9);
__p = v7;
__dst = v9 + 1;
m_animateDescriptions = v8;
v3 = a1;
v20 = v6;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v5;
v7 = (char *)&__dst + 1;
if ( v5 )
LABEL_8:
memcpy(v7, a2, v6);
v7[v6] = 0;
v10 = cocos2d::CCDictionary::objectForKey_1((__int64)m_animateDescriptions, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( !v10 )
{
v15 = cocos2d::CCDictionary::createWithContentsOfFile(a2);
CCAnimateFrameCache::addDict(v3, v15, a2);
return v15;
}
v11 = (__int64)v3->m_animateDescriptions;
v12 = strlen(a2);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_24:
sub_100006BF0(v2);
v13 = v12;
if ( v12 >= 0x17 )
{
v17 = 26;
if ( (v12 | 7) != 0x17 )
v17 = (v12 | 7) + 1;
v14 = (char *)operator new(v17);
__p = v14;
__dst = v17 + 1;
v20 = v13;
goto LABEL_20;
}
LOBYTE(__dst) = 2 * v12;
v14 = (char *)&__dst + 1;
if ( v12 )
LABEL_20:
memcpy(v14, a2, v13);
v14[v13] = 0;
result = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(v11, (char *)&__dst);
if ( (__dst & 1) != 0 )
{
v18 = result;
operator delete(__p);
return v18;
}
return result;
}