//
// cocos2d::CCComponentContainer::removeAll from 0x5f2874 to 0x5f299e (298 bytes)
//
// 0 xrefs:
//
// 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::CCComponentContainer::removeAll(cocos2d::CCComponentContainer *a1)
{
cocos2d::CCDictionary *m_pComponents; // r3
cocos2d::CCDictElement *m_pElements; // r4
cocos2d::CCDictElement *next; // r5
char *prev; // lr
cocos2d::CCDictionary *v6; // r12
cocos2d::CCDictElement *v7; // r8
UT_hash_table *tbl; // r3
std::ptrdiff_t hho; // r2
char *v10; // r2
cocos2d::CCDictElement *v11; // r12
UT_hash_table *v12; // r1
UT_hash_bucket *buckets; // r2
int v14; // r3
UT_hash_handle *hh_next; // r0
UT_hash_table *v16; // r1
UT_hash_handle *hh_prev; // r3
UT_hash_handle *v18; // r2
cocos2d::CCDictElement *v19; // r3
m_pComponents = a1->m_pComponents;
if ( m_pComponents )
{
m_pElements = m_pComponents->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
prev = (char *)m_pElements->hh.prev;
v6 = a1->m_pComponents;
v7 = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( prev || v7 )
{
tbl = v6->m_pElements->hh.tbl;
hho = tbl->hho;
if ( m_pElements == (cocos2d::CCDictElement *)((char *)tbl->tail - hho) )
tbl->tail = (UT_hash_handle *)&prev[hho];
if ( prev )
*(_DWORD *)&prev[tbl->hho + 8] = v7;
else
v6->m_pElements = v7;
v10 = (char *)m_pElements->hh.next;
v11 = v6->m_pElements;
if ( v10 )
*(_DWORD *)&v10[v11->hh.tbl->hho + 4] = prev;
v12 = v11->hh.tbl;
buckets = v12->buckets;
v14 = m_pElements->hh.hashv & (v12->num_buckets - 1);
buckets[v14].count = v12->buckets[v14].count - 1;
hh_next = m_pElements->hh.hh_next;
v16 = v11->hh.tbl;
if ( buckets[v14].hh_head == &m_pElements->hh )
buckets[v14].hh_head = hh_next;
hh_prev = m_pElements->hh.hh_prev;
if ( hh_prev )
hh_prev->hh_next = hh_next;
v18 = m_pElements->hh.hh_next;
if ( v18 )
v18->hh_prev = hh_prev;
--v16->num_items;
}
else
{
free(v6->m_pElements->hh.tbl->buckets);
free(a1->m_pComponents->m_pElements->hh.tbl);
a1->m_pComponents->m_pElements = nullptr;
}
m_pElements->m_pObject->__vftable[1].~CCObject_0(m_pElements->m_pObject);
cocos2d::CCComponent::setOwner((cocos2d::CCComponent *)m_pElements->m_pObject, nullptr);
cocos2d::CCObject::release(m_pElements->m_pObject);
cocos2d::CCDictElement::~CCDictElement(m_pElements);
operator delete(m_pElements);
if ( next )
v19 = (cocos2d::CCDictElement *)next->hh.next;
else
v19 = nullptr;
m_pElements = next;
next = v19;
}
cocos2d::CCNode::unscheduleUpdate(a1->m_pOwner);
}
}