//
// cocos2d::CCSet::removeObject from 0x5c16f2 to 0x5c179a (168 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::touches @ 0x5fabd6
// > cocos2d::CCTouchDispatcher::touches @ 0x5fabf2
//
// 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::CCSet::removeObject(cocos2d::CCSet *a1, cocos2d::CCObject *a2)
{
std::set *m_pSet; // r5
std::_Rb_tree_node_base *p_M_header; // r6
std::_Rb_tree_node_base *i; // r4
unsigned int M_color; // r3
std::_Rb_tree_node_base *M_right; // r3
std::_Rb_tree_node_base *M_left; // r2
std::_Rb_tree_node_base *v9; // r3
std::_Rb_tree_node_base *v10; // r0
std::_Rb_tree_node_base *v11; // r2
int v12; // r9
void *v13; // r0
m_pSet = a1->m_pSet;
p_M_header = &m_pSet->_M_t._M_impl._M_header;
for ( i = m_pSet->_M_t._M_impl._M_header._M_parent; ; i = M_right )
{
if ( !i )
{
i = p_M_header;
goto LABEL_20;
}
M_color = i[1]._M_color;
if ( M_color < (unsigned int)a2 )
{
M_right = i->_M_right;
i = p_M_header;
goto LABEL_18;
}
if ( (unsigned int)a2 >= M_color )
break;
M_right = i->_M_left;
LABEL_18:
p_M_header = i;
}
M_left = i->_M_left;
v9 = i->_M_right;
while ( M_left )
{
if ( M_left[1]._M_color >= (unsigned int)a2 )
{
v10 = M_left->_M_left;
}
else
{
v10 = M_left->_M_right;
M_left = i;
}
i = M_left;
M_left = v10;
}
while ( v9 )
{
if ( (unsigned int)a2 < v9[1]._M_color )
{
v11 = v9->_M_left;
}
else
{
v11 = v9->_M_right;
v9 = p_M_header;
}
p_M_header = v9;
v9 = v11;
}
LABEL_20:
if ( i == m_pSet->_M_t._M_impl._M_header._M_left && p_M_header == &m_pSet->_M_t._M_impl._M_header )
{
std::_Rb_tree,std::less,std::allocator>::_M_erase(
(int)m_pSet,
m_pSet->_M_t._M_impl._M_header._M_parent);
m_pSet->_M_t._M_impl._M_header._M_left = p_M_header;
m_pSet->_M_t._M_impl._M_header._M_parent = nullptr;
m_pSet->_M_t._M_impl._M_header._M_right = p_M_header;
m_pSet->_M_t._M_impl._M_node_count = 0;
}
else
{
while ( i != p_M_header )
{
v12 = sub_761FE0(i);
v13 = (void *)sub_7621E4(i, &m_pSet->_M_t._M_impl._M_header);
i = (std::_Rb_tree_node_base *)v12;
operator delete(v13);
--m_pSet->_M_t._M_impl._M_node_count;
}
}
if ( a2 )
cocos2d::CCObject::release(a2);
}