//
// CCContentManager::addDictDS from 0x180005de0 to 0x180005f42 (354 bytes)
//
// 7 xrefs:
// > cocos2d::CCLabelAtlas::initWithString @ 0x180045faa
// > cocos2d::CCParticleSystem::initWithFile @ 0x1800689f2
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180091321
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x1800914cd
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180091946
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ad87c
//
// 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
//
// Alternative name is '?addDict@CCContentManager@@QEAAPEAVCCDictionary@cocos2d@@PEBD_N@Z'
// Hidden C++ exception states: #wind=2
struct cocos2d::CCDictionary *__fastcall CCContentManager::addDictDS(CCContentManager *this, char *a2)
{
__int64 v4; // rbx
void *v5; // rcx
DS_Dictionary *v7; // rax
DS_Dictionary *v8; // rbx
struct cocos2d::CCDictionary *DictForKey; // rdi
void *v10; // rcx
void *Block[3]; // [rsp+28h] [rbp-40h] BYREF
unsigned __int64 v12; // [rsp+40h] [rbp-28h]
sub_180005910(Block, a2);
v4 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), Block);
if ( v12 > 0xF )
{
v5 = Block[0];
if ( v12 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v5);
}
if ( v4 )
return (struct cocos2d::CCDictionary *)v4;
v7 = (DS_Dictionary *)operator new(0xF0u);
if ( v7 )
v8 = DS_Dictionary::DS_Dictionary(v7);
else
v8 = nullptr;
DS_Dictionary::loadRootSubDictFromFile(v8, a2);
DictForKey = DS_Dictionary::getDictForKey(v8, nullptr, 0);
if ( v8 )
{
DS_Dictionary::~DS_Dictionary(v8);
j_j_free_0(v8);
}
sub_180005910(Block, a2);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 7), DictForKey, Block);
if ( v12 > 0xF )
{
v10 = Block[0];
if ( v12 + 1 >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v10);
}
return DictForKey;
}