//
// cocos2d::CCSet::removeObject from 0xad2f60 to 0xad30e8 (392 bytes)
//
// 3 xrefs:
// > cocos2d::CCTouchDispatcher::touches @ 0xb3f368
// > cocos2d::CCTouchDispatcher::touches @ 0xb3f3ac
// > ??> @ 0x536e8
//
// 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; // x22
std::_Rb_tree_node_base::_Base_ptr M_parent; // x20
std::_Rb_tree_node_base *p_M_header; // x24
std::_Rb_tree_node_base *v6; // x23
std::_Rb_tree_node_base *v7; // x0
unsigned __int64 v8; // x1
std::_Rb_tree_node_base::_Base_ptr v9; // x0
std::_Rb_tree_node_base *v10; // x19
std::_Rb_tree_node_base *M_left; // x1
std::_Rb_tree_node_base *M_right; // x0
__int64 v13; // x2
std::_Rb_tree_node_base *v14; // x0
void *v15; // x0
m_pSet = a1->m_pSet;
M_parent = m_pSet->_M_t._M_impl._M_header._M_parent;
p_M_header = &m_pSet->_M_t._M_impl._M_header;
if ( M_parent )
{
v6 = &m_pSet->_M_t._M_impl._M_header;
v7 = m_pSet->_M_t._M_impl._M_header._M_parent;
while ( 1 )
{
while ( 1 )
{
v8 = *(_QWORD *)&v7[1]._M_color;
if ( v8 >= (unsigned __int64)a2 )
break;
v7 = v7->_M_right;
if ( !v7 )
goto LABEL_5;
}
if ( v8 <= (unsigned __int64)a2 )
break;
v6 = v7;
v7 = v7->_M_left;
if ( !v7 )
{
LABEL_5:
if ( p_M_header != v6 || v6 != m_pSet->_M_t._M_impl._M_header._M_left )
goto LABEL_7;
do
{
LABEL_15:
std::_Rb_tree,std::less,std::allocator>::_M_erase(
(__int64)m_pSet,
M_parent->_M_right);
v9 = M_parent;
M_parent = M_parent->_M_left;
operator delete(v9);
}
while ( M_parent );
goto LABEL_16;
}
}
v10 = v7;
M_left = v7->_M_left;
M_right = v7->_M_right;
while ( M_left )
{
while ( *(_QWORD *)&M_left[1]._M_color >= (unsigned __int64)a2 )
{
v10 = M_left;
M_left = M_left->_M_left;
if ( !M_left )
goto LABEL_21;
}
M_left = M_left->_M_right;
}
LABEL_21:
while ( M_right )
{
if ( *(_QWORD *)&M_right[1]._M_color <= (unsigned __int64)a2 )
{
M_right = M_right->_M_right;
}
else
{
v6 = M_right;
M_right = M_right->_M_left;
}
}
if ( p_M_header == v6 && v10 == m_pSet->_M_t._M_impl._M_header._M_left )
goto LABEL_15;
for ( ; v10 != v6; --m_pSet->_M_t._M_impl._M_node_count )
{
v13 = sub_CFAB74(v10);
v14 = v10;
v10 = (std::_Rb_tree_node_base *)v13;
v15 = (void *)sub_CFAF34(v14, &m_pSet->_M_t._M_impl._M_header);
operator delete(v15);
}
LABEL_7:
if ( a2 )
goto LABEL_8;
}
else
{
if ( p_M_header != m_pSet->_M_t._M_impl._M_header._M_left )
goto LABEL_7;
LABEL_16:
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;
if ( a2 )
LABEL_8:
cocos2d::CCObject::release(a2);
}
}