//
// CCContentManager::addDict from 0x100184370 to 0x100184511 (417 bytes)
//
// 8 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x10031ce80
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_1 @ 0x10031ceda
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2 @ 0x10031cfe6
// > LoadingLayer::loadAssets @ 0x1003a35b9
// > LoadingLayer::loadAssets @ 0x1003a35cf
// > LoadingLayer::loadAssets @ 0x1003a35e5
// > cocos2d::CCLabelAtlas::initWithString_2 @ 0x100799568
// > cocos2d::CCParticleSystem::initWithFile @ 0x1007c6c8e
//
// 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 CCContentManager::addDict(CCContentManager *a1, const char *a2, bool a3)
{
double v3; // xmm0_8
const char *v5; // rbx
CCContentManager *v6; // r15
size_t v7; // rax
size_t v8; // r13
char *v9; // r12
size_t v10; // r15
cocos2d::CCDictionary *v11; // r14
cocos2d::CCDictionary *v12; // rax
CCContentManager_vtbl *v13; // r15
size_t v14; // rax
size_t v15; // r12
char *v16; // r13
size_t v17; // r15
bool v19; // [rsp+4h] [rbp-4Ch]
CCContentManager_vtbl *v20; // [rsp+8h] [rbp-48h]
CCContentManager_vtbl *v21; // [rsp+8h] [rbp-48h]
size_t __dst; // [rsp+10h] [rbp-40h] BYREF
size_t v23; // [rsp+18h] [rbp-38h]
void *__p; // [rsp+20h] [rbp-30h]
v5 = a2;
v6 = a1;
v7 = strlen(a2);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_26;
v8 = v7;
v20 = a1[1].__vftable;
v19 = a3;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
v9 = (char *)operator new(v10);
__p = v9;
__dst = v10 + 1;
v6 = a1;
v5 = a2;
v23 = v8;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v7;
v9 = (char *)&__dst + 1;
if ( v7 )
LABEL_8:
memcpy(v9, v5, v8);
v9[v8] = 0;
v11 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(v20, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( !v11 )
{
if ( v19 )
v12 = cocos2d::CCDictionary::createWithContentsOfFileThreadSafe(v5);
else
v12 = cocos2d::CCDictionary::createWithContentsOfFile(v5);
v11 = v12;
v13 = v6[1].__vftable;
v14 = strlen(v5);
if ( v14 < 0xFFFFFFFFFFFFFFF8LL )
{
v15 = v14;
if ( v14 >= 0x17 )
{
v21 = v13;
v17 = 26;
if ( (v14 | 7) != 0x17 )
v17 = (v14 | 7) + 1;
v16 = (char *)operator new(v17);
__p = v16;
__dst = v17 + 1;
v13 = v21;
v23 = v15;
}
else
{
LOBYTE(__dst) = 2 * v14;
v16 = (char *)&__dst + 1;
if ( !v14 )
{
LABEL_23:
v16[v15] = 0;
cocos2d::CCDictionary::setObject_1(v13, v11, &__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
return v11;
}
}
memcpy(v16, v5, v15);
goto LABEL_23;
}
LABEL_26:
sub_100006BF0(v3);
}
return v11;
}