//
// cocos2d::CCDictionary::removeAllObjects from 0xad1358 to 0xad14ec (404 bytes)
//
// 29 xrefs:
// > AchievementManager::resetAchievements @ 0x553c54
// > CCAnimateFrameCache::removeSpriteFrames @ 0x571bc4
// > CCAnimateFrameCache::removeSpriteFrames @ 0x571bcc
// > CCAnimateFrameCache::removeSpriteFrames @ 0x571bdc
// > SpriteAnimationManager::doCleanup @ 0x590b0c
// > PlayerObject::resetCollisionLog @ 0x622f10
// > PlayerObject::resetCollisionLog @ 0x622f18
// > PlayerObject::resetCollisionLog @ 0x622f20
// > PlayerObject::resetCollisionLog @ 0x622f28
// > GameLevelManager::resetAllTimers @ 0x6f3180
// > GameLevelManager::resetGauntlets @ 0x6f5d50
// > GameStatsManager::resetUserCoins @ 0x7b455c
// > GameStatsManager::resetUserCoins @ 0x7b456c
// > GJBaseGameLayer::clearPickedUpItems @ 0x85a6bc
// > GJBaseGameLayer::refreshKeyframeAnims @ 0x8650d8
// > GJBaseGameLayer::orderSpawnObjects @ 0x869808
// > GJBaseGameLayer::preUpdateVisibility @ 0x882b6c
// > GJEffectManager::reset @ 0x8b7bd0
// > GJEffectManager::reset @ 0x8b7bd8
// > GJEffectManager::reset @ 0x8b7be0
// > SetGroupIDLayer::updateGroupIDButtons @ 0x976404
// > cocos2d::CCDictionary::~CCDictionary @ 0xad150c
// > cocos2d::FNTConfigRemoveCache @ 0xae2d7c
// > cocos2d::CCSpriteFrameCache::removeSpriteFrames @ 0xb1b068
// > cocos2d::CCSpriteFrameCache::removeSpriteFrames @ 0xb1b070
// > cocos2d::CCProfiler::releaseAllTimers @ 0xb1e840
// > cocos2d::CCTextureCache::removeAllTextures @ 0xb341b4
// > CCContentManager::clearCache @ 0xb41488
// > ??> @ 0x53898
//
// 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
//
void cocos2d::CCDictionary::removeAllObjects(cocos2d::CCDictionary *a1)
{
cocos2d::CCDictElement *m_pElements; // x19
char *prev; // x0
cocos2d::CCDictElement *next; // x21
cocos2d::CCDictElement *v5; // x2
UT_hash_table *v6; // x5
UT_hash_handle *p_hh; // x3
std::ptrdiff_t v8; // x1
char *v9; // x4
UT_hash_table *v10; // x4
UT_hash_bucket *buckets; // x5
__int64 v12; // x1
UT_hash_handle *hh_head; // x6
UT_hash_handle *hh_next; // x2
UT_hash_handle *hh_prev; // x0
cocos2d::CCObject *m_pObject; // x0
UT_hash_table *tbl; // x2
UT_hash_handle *hho; // x4
m_pElements = a1->m_pElements;
if ( m_pElements )
{
prev = (char *)m_pElements->hh.prev;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
v5 = m_pElements;
if ( prev )
goto LABEL_3;
LABEL_15:
if ( next )
{
tbl = v5->hh.tbl;
p_hh = &m_pElements->hh;
hho = (UT_hash_handle *)tbl->hho;
if ( m_pElements == (cocos2d::CCDictElement *)((char *)tbl->tail - (char *)hho) )
tbl->tail = hho;
a1->m_pElements = next;
v5 = next;
v9 = (char *)next;
LABEL_6:
*(_QWORD *)&v9[v5->hh.tbl->hho + 8] = prev;
while ( 1 )
{
v10 = v5->hh.tbl;
buckets = v10->buckets;
v12 = (v10->num_buckets - 1) & p_hh->hashv;
hh_head = v10->buckets[v12].hh_head;
--v10->buckets[v12].count;
hh_next = p_hh->hh_next;
if ( hh_head == p_hh )
buckets[v12].hh_head = hh_next;
hh_prev = p_hh->hh_prev;
if ( hh_prev )
{
hh_prev->hh_next = hh_next;
hh_next = p_hh->hh_next;
}
if ( hh_next )
hh_next->hh_prev = hh_prev;
m_pObject = m_pElements->m_pObject;
--v10->num_items;
cocos2d::CCObject::release(m_pObject);
cocos2d::CCDictElement::~CCDictElement(m_pElements);
operator delete(m_pElements);
if ( !next )
break;
m_pElements = next;
v5 = a1->m_pElements;
next = (cocos2d::CCDictElement *)next->hh.next;
prev = (char *)m_pElements->hh.prev;
if ( !prev )
goto LABEL_15;
LABEL_3:
v6 = v5->hh.tbl;
p_hh = &m_pElements->hh;
v8 = v6->hho;
if ( m_pElements == (cocos2d::CCDictElement *)((char *)v6->tail - v8) )
v6->tail = (UT_hash_handle *)&prev[v8];
*(_QWORD *)&prev[v8 + 16] = m_pElements->hh.next;
v9 = (char *)m_pElements->hh.next;
if ( v9 )
goto LABEL_6;
}
}
else
{
free(v5->hh.tbl->buckets);
free(a1->m_pElements->hh.tbl);
a1->m_pElements = nullptr;
cocos2d::CCObject::release(m_pElements->m_pObject);
cocos2d::CCDictElement::~CCDictElement(m_pElements);
operator delete(m_pElements);
}
}
}