//
// cocos2d::CCDictionary::removeObjectForElememt from 0x18000abd0 to 0x18000ad41 (369 bytes)
//
// 7 xrefs:
// > cocos2d::CCDictionary::removeObjectForKey @ 0x18000b0d1
// > cocos2d::CCDictionary::removeObjectForKey @ 0x18000b286
// > cocos2d::CCDictionary::removeObjectForKey @ 0x18000b299
// > cocos2d::CCSpriteFrameCache::removeUnusedSpriteFrames @ 0x18009274b
// > cocos2d::CCTextureCache::removeUnusedTextures @ 0x1800a9a18
// > ??> @ 0x1801438a8
// > ??> @ 0x1801add50
//
// 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::removeObjectForElememt(
cocos2d::CCDictionary *this,
struct cocos2d::CCDictElement *a2)
{
char *prev; // rdx
UT_hash_table *tbl; // r9
std::ptrdiff_t hho; // r10
char *v7; // r9
cocos2d::CCDictElement *next; // rdx
char *v9; // r9
UT_hash_table *v10; // rcx
__int64 v11; // r9
UT_hash_table *v12; // rcx
UT_hash_handle *hh_prev; // rcx
UT_hash_handle *hh_next; // rcx
if ( a2 )
{
prev = (char *)a2->hh.prev;
if ( __PAIR128__(a2->hh.next, (unsigned __int64)prev) == 0 )
{
free(this->m_pElements->hh.tbl->buckets);
free(this->m_pElements->hh.tbl);
this->m_pElements = nullptr;
}
else
{
tbl = this->m_pElements->hh.tbl;
hho = tbl->hho;
if ( a2 == (struct cocos2d::CCDictElement *)((char *)tbl->tail - hho) )
tbl->tail = (UT_hash_handle *)&prev[hho];
v7 = (char *)a2->hh.prev;
next = (cocos2d::CCDictElement *)a2->hh.next;
if ( v7 )
*(_QWORD *)&v7[this->m_pElements->hh.tbl->hho + 16] = next;
else
this->m_pElements = next;
v9 = (char *)a2->hh.next;
if ( v9 )
*(_QWORD *)&v9[this->m_pElements->hh.tbl->hho + 8] = a2->hh.prev;
v10 = this->m_pElements->hh.tbl;
v11 = a2->hh.hashv & (v10->num_buckets - 1);
--v10->buckets[v11].count;
v12 = this->m_pElements->hh.tbl;
if ( v12->buckets[v11].hh_head == &a2->hh )
v12->buckets[v11].hh_head = a2->hh.hh_next;
hh_prev = a2->hh.hh_prev;
if ( hh_prev )
hh_prev->hh_next = a2->hh.hh_next;
hh_next = a2->hh.hh_next;
if ( hh_next )
hh_next->hh_prev = a2->hh.hh_prev;
--this->m_pElements->hh.tbl->num_items;
}
cocos2d::CCObject::release(a2->m_pObject);
j_j_free_0(a2);
}
}