//
// CCContentManager::addDict from 0xdb4890 to 0xdb4a74 (484 bytes)
//
// 8 xrefs:
// > LoadingLayer::loadAssets @ 0x6ee01c
// > LoadingLayer::loadAssets @ 0x6ee030
// > LoadingLayer::loadAssets @ 0x6ee044
// > cocos2d::CCLabelAtlas::initWithString @ 0xd548a8
// > cocos2d::CCParticleSystem::initWithFile @ 0xd72114
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0xd8b958
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0xd8c564
// > ??> @ 0xa7e30
//
// This function is hookable on this platform (idp: arm, 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 13:08:41 +0000
//
cocos2d::CCObject *__fastcall CCContentManager::addDict(CCContentManager *this, char *a2)
{
size_t v4; // x0
size_t v5; // x19
__int64 v6; // x25
char *v7; // x3
__int64 v8; // x19
cocos2d::CCObject *result; // x0
unsigned __int64 v10; // x0
DS_Dictionary *v11; // x21
cocos2d::CCObject *DictForKey; // x19
char *v13; // x0
char *v14; // x2
size_t v15; // x0
__int64 v16; // x21
unsigned __int64 v17; // [xsp+50h] [xbp+50h] BYREF
size_t v18; // [xsp+58h] [xbp+58h]
void *v19; // [xsp+60h] [xbp+60h]
v17 = 0;
v18 = 0;
v19 = nullptr;
v4 = strlen(a2);
v5 = v4;
v6 = *((_QWORD *)this + 7);
if ( v4 > 0x16 )
{
v10 = (v4 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v17 = v10 | 1;
v7 = (char *)operator new(v10);
v19 = v7;
v18 = v5;
}
else
{
LOBYTE(v17) = 2 * v4;
v7 = (char *)&v17 + 1;
if ( !v4 )
{
BYTE1(v17) = 0;
v8 = cocos2d::CCDictionary::objectForKey(v6, (__int64)&v17);
if ( (v17 & 1) == 0 )
goto LABEL_4;
LABEL_8:
operator delete(v19);
result = (cocos2d::CCObject *)v8;
if ( v8 )
return result;
goto LABEL_9;
}
}
*((_BYTE *)memcpy(v7, a2, v5) + v5) = 0;
v8 = cocos2d::CCDictionary::objectForKey(v6, (__int64)&v17);
if ( (v17 & 1) != 0 )
goto LABEL_8;
LABEL_4:
result = (cocos2d::CCObject *)v8;
if ( v8 )
return result;
LABEL_9:
v11 = (DS_Dictionary *)operator new(0xF0u);
DS_Dictionary::DS_Dictionary(v11);
DS_Dictionary::loadRootSubDictFromFile(v11, a2);
DictForKey = (cocos2d::CCObject *)DS_Dictionary::getDictForKey(v11, nullptr, 0);
v13 = *((char **)v11 + 26);
if ( v13 )
{
v14 = *((char **)v11 + 27);
if ( v13 != v14 )
*((_QWORD *)v11 + 27) = &v14[8 * ~((unsigned __int64)(v14 - 8 - v13) >> 3)];
operator delete(v13);
}
pugi::xml_document::~xml_document(v11);
operator delete(v11);
v17 = 0;
v18 = 0;
v19 = nullptr;
v15 = strlen(a2);
v16 = *((_QWORD *)this + 7);
std::string::__init((__int64 *)&v17, a2, v15);
cocos2d::CCDictionary::setObject(v16, DictForKey, (__int64)&v17);
if ( (v17 & 1) != 0 )
operator delete(v19);
return DictForKey;
}