//
// cocos2d::CCSet::removeObject from 0x1007b38c0 to 0x1007b3964 (164 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::touches @ 0x1004cc6a9
// > cocos2d::CCTouchDispatcher::touches @ 0x1004cc707
//
// 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::CCSet::removeObject(cocos2d::CCSet *a1, cocos2d::CCObject *a2)
{
std::set *m_pSet; // rax
__int64 *left; // rdi
__int64 *p_pair1; // rbx
__int64 *v5; // rdx
std::__tree_end_node *> *v6; // rdx
std::__tree_end_node *> *v7; // rcx
__int64 *v8; // rdx
bool v9; // zf
m_pSet = a1->m_pSet;
left = (__int64 *)m_pSet->__tree_.__pair1_.__value_.__left_;
if ( left )
{
p_pair1 = (__int64 *)&m_pSet->__tree_.__pair1_;
v5 = (__int64 *)m_pSet->__tree_.__pair1_.__value_.__left_;
do
{
if ( v5[4] >= (unsigned __int64)a2 )
p_pair1 = v5;
v5 = (__int64 *)v5[v5[4] < (unsigned __int64)a2];
}
while ( v5 );
if ( p_pair1 != (__int64 *)&m_pSet->__tree_.__pair1_ && p_pair1[4] <= (unsigned __int64)a2 )
{
v6 = (std::__tree_end_node *> *)p_pair1[1];
if ( v6 )
{
do
{
v7 = v6;
v6 = (std::__tree_end_node *> *)v6->__left_;
}
while ( v6 );
}
else
{
v8 = p_pair1;
do
{
v7 = (std::__tree_end_node *> *)v8[2];
v9 = v7->__left_ == (std::__tree_end_node *>::pointer)v8;
v8 = (__int64 *)v7;
}
while ( !v9 );
}
if ( (__int64 *)m_pSet->__tree_.__begin_node_ == p_pair1 )
m_pSet->__tree_.__begin_node_ = v7;
--m_pSet->__tree_.__pair3_.__value_;
sub_100165F60(left, p_pair1);
operator delete(p_pair1);
}
}
if ( a2 )
cocos2d::CCObject::release(a2);
}