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