//
// CCContentManager::addDict from 0x100163760 to 0x100163901 (417 bytes)
//
// 8 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x100308130
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_1 @ 0x10030818a
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2 @ 0x100308296
// > LoadingLayer::loadAssets @ 0x10038cbd9
// > LoadingLayer::loadAssets @ 0x10038cbef
// > LoadingLayer::loadAssets @ 0x10038cc05
// > cocos2d::CCLabelAtlas::initWithString_2 @ 0x100879d28
// > cocos2d::CCParticleSystem::initWithFile @ 0x1008ae52e
//
// 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:25:08 +0000
//
__int64 __fastcall CCContentManager::addDict(__int64 a1, const char *a2, char a3)
{
char *v4; // rbx
__int64 v5; // r15
size_t v6; // rax
size_t v7; // r13
char *v8; // r12
size_t v9; // r15
__int64 v10; // r14
__int64 v11; // rax
__int64 v12; // r15
size_t v13; // rax
size_t v14; // r12
char *v15; // r13
size_t v16; // r15
char v18; // [rsp+4h] [rbp-4Ch]
__int64 v19; // [rsp+8h] [rbp-48h]
__int64 v20; // [rsp+8h] [rbp-48h]
size_t __dst; // [rsp+10h] [rbp-40h] BYREF
size_t v22; // [rsp+18h] [rbp-38h]
void *__p; // [rsp+20h] [rbp-30h]
v4 = (char *)a2;
v5 = a1;
v6 = strlen(a2);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_26;
v7 = v6;
v19 = *(_QWORD *)(a1 + 56);
v18 = a3;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
__dst = v9 + 1;
v5 = a1;
v4 = (char *)a2;
v22 = v7;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v6;
v8 = (char *)&__dst + 1;
if ( v6 )
LABEL_8:
memcpy(v8, v4, v7);
v8[v7] = 0;
v10 = cocos2d::CCDictionary::objectForKey(v19, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( !v10 )
{
if ( v18 )
v11 = cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(v4);
else
v11 = cocos2d::CCDictionary::createWithContentsOfFile(v4);
v10 = v11;
v12 = *(_QWORD *)(v5 + 56);
v13 = strlen(v4);
if ( v13 < 0xFFFFFFFFFFFFFFF8LL )
{
v14 = v13;
if ( v13 >= 0x17 )
{
v20 = v12;
v16 = 26;
if ( (v13 | 7) != 0x17 )
v16 = (v13 | 7) + 1;
v15 = (char *)operator new(v16);
__p = v15;
__dst = v16 + 1;
v12 = v20;
v22 = v14;
}
else
{
LOBYTE(__dst) = 2 * v13;
v15 = (char *)&__dst + 1;
if ( !v13 )
{
LABEL_23:
v15[v14] = 0;
cocos2d::CCDictionary::setObject(v12, v10, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
return v10;
}
}
memcpy(v15, v4, v14);
goto LABEL_23;
}
LABEL_26:
sub_100003630();
}
return v10;
}