//
// cocos2d::CCDictionary::removeObjectForElememt from 0x5c08dc to 0x5c099a (190 bytes)
//
// 4 xrefs:
// > cocos2d::CCDictionary::removeObjectForKey @ 0x5c0b7c
// > cocos2d::CCDictionary::removeObjectForKey @ 0x5c0cb6
// > cocos2d::CCSpriteFrameCache::removeUnusedSpriteFrames @ 0x5e9984
// > cocos2d::CCTextureCache::removeUnusedTextures @ 0x5f4de4
//
// 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::removeObjectForElememt(cocos2d::CCDictionary *a1, cocos2d::CCDictElement *a2)
{
char *prev; // r3
cocos2d::CCDictElement *next; // r6
cocos2d::CCDictElement *m_pElements; // r2
UT_hash_table *tbl; // r1
std::ptrdiff_t hho; // r2
char *v9; // r0
cocos2d::CCDictElement *v10; // r1
UT_hash_table *v11; // r1
unsigned int v12; // r3
UT_hash_bucket *buckets; // r2
UT_hash_handle *hh_next; // r0
UT_hash_handle *hh_prev; // r3
UT_hash_handle *v16; // r2
if ( a2 )
{
prev = (char *)a2->hh.prev;
next = (cocos2d::CCDictElement *)a2->hh.next;
m_pElements = a1->m_pElements;
if ( prev || next )
{
tbl = m_pElements->hh.tbl;
hho = tbl->hho;
if ( a2 == (cocos2d::CCDictElement *)((char *)tbl->tail - hho) )
tbl->tail = (UT_hash_handle *)&prev[hho];
if ( prev )
*(_DWORD *)&prev[hho + 8] = next;
else
a1->m_pElements = next;
v9 = (char *)a2->hh.next;
v10 = a1->m_pElements;
if ( v9 )
*(_DWORD *)&v9[v10->hh.tbl->hho + 4] = prev;
v11 = v10->hh.tbl;
v12 = (v11->num_buckets - 1) & a2->hh.hashv;
buckets = v11->buckets;
buckets[v12].count = v11->buckets[v12].count - 1;
hh_next = a2->hh.hh_next;
if ( buckets[v12].hh_head == &a2->hh )
buckets[v12].hh_head = hh_next;
hh_prev = a2->hh.hh_prev;
if ( hh_prev )
hh_prev->hh_next = hh_next;
v16 = a2->hh.hh_next;
if ( v16 )
v16->hh_prev = hh_prev;
--v11->num_items;
}
else
{
free(m_pElements->hh.tbl->buckets);
free(a1->m_pElements->hh.tbl);
a1->m_pElements = nullptr;
}
cocos2d::CCObject::release(a2->m_pObject);
cocos2d::CCDictElement::~CCDictElement(a2);
operator delete(a2);
}
}