//
// cocos2d::CCDictionary::removeAllObjects from 0x18000aa20 to 0x18000abc2 (418 bytes)
//
// 10 xrefs:
// > cocos2d::CCTextureCache::removeAllTextures @ 0x180005f54
// > cocos2d::CCDictionary::~CCDictionary @ 0x1800096c3
// > sub_1800096F0 @ 0x18000975c
// > cocos2d::CCLabelBMFont::purgeCachedData @ 0x180047940
// > cocos2d::CCSpriteFrameCache::removeSpriteFrames @ 0x180091c81
// > cocos2d::CCSpriteFrameCache::removeSpriteFrames @ 0x180091c8a
// > ??> @ 0x180131d4c
// > ??> @ 0x180131d5c
// > ??> @ 0x1801438a8
// > ??> @ 0x1801add2c
//
// 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 __fastcall cocos2d::CCDictionary::removeAllObjects(cocos2d::CCDictionary *this)
{
cocos2d::CCDictElement *m_pElements; // rdi
cocos2d::CCDictElement *i; // rsi
char *prev; // r8
cocos2d::CCDictElement *v5; // r10
UT_hash_table *tbl; // r9
std::ptrdiff_t hho; // r11
char *v8; // r9
cocos2d::CCDictElement *next; // r8
char *v10; // r9
UT_hash_table *v11; // rdx
__int64 v12; // r9
UT_hash_table *v13; // rdx
UT_hash_handle *hh_prev; // rdx
UT_hash_handle *hh_next; // rcx
m_pElements = this->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
prev = (char *)m_pElements->hh.prev;
if ( prev || m_pElements->hh.next )
{
v5 = this->m_pElements;
tbl = v5->hh.tbl;
hho = tbl->hho;
if ( m_pElements == (cocos2d::CCDictElement *)((char *)tbl->tail - hho) )
{
tbl->tail = (UT_hash_handle *)&prev[hho];
v5 = this->m_pElements;
}
v8 = (char *)m_pElements->hh.prev;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( v8 )
{
*(_QWORD *)&v8[v5->hh.tbl->hho + 16] = next;
next = this->m_pElements;
}
else
{
this->m_pElements = next;
}
v10 = (char *)m_pElements->hh.next;
if ( v10 )
*(_QWORD *)&v10[next->hh.tbl->hho + 8] = m_pElements->hh.prev;
v11 = this->m_pElements->hh.tbl;
v12 = m_pElements->hh.hashv & (v11->num_buckets - 1);
--v11->buckets[v12].count;
v13 = this->m_pElements->hh.tbl;
if ( v13->buckets[v12].hh_head == &m_pElements->hh )
v13->buckets[v12].hh_head = m_pElements->hh.hh_next;
hh_prev = m_pElements->hh.hh_prev;
if ( hh_prev )
hh_prev->hh_next = m_pElements->hh.hh_next;
hh_next = m_pElements->hh.hh_next;
if ( hh_next )
hh_next->hh_prev = m_pElements->hh.hh_prev;
--this->m_pElements->hh.tbl->num_items;
}
else
{
free(this->m_pElements->hh.tbl->buckets);
free(this->m_pElements->hh.tbl);
this->m_pElements = nullptr;
}
cocos2d::CCObject::release(m_pElements->m_pObject);
j_j_free_0(m_pElements);
m_pElements = i;
if ( !i )
break;
}
}
}