//
// cocos2d::CCSet::addObject from 0x5c15ce to 0x5c164c (126 bytes)
//
// 13 xrefs:
// > BoomScrollLayer::claimTouch @ 0x2e29b0
// > BoomScrollLayer::cancelAndStoleTouch @ 0x2e29ce
// > TableView::claimTouch @ 0x2e996e
// > TableView::cancelAndStoleTouch @ 0x2e998c
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x5afabe
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x5afaea
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x5afb02
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x5afb1e
// > cocos2d::CCActionManager::pauseAllRunningActions @ 0x5b961a
// > cocos2d::CCEGLViewProtocol::getSetOfTouchesEndOrCancel @ 0x5e0a64
// > cocos2d::CCEGLViewProtocol::handleTouchesBegin @ 0x5e0d1c
// > cocos2d::CCEGLViewProtocol::handleTouchesMove @ 0x5e0e3e
// > cocos2d::CCTouchDispatcher::touches @ 0x5fab76
//
// 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::addObject(cocos2d::CCSet *a1, cocos2d::CCObject *a2)
{
std::set *m_pSet; // r6
int v5; // r3
std::_Rb_tree_node_base *M_parent; // r2
std::_Rb_tree_node_base *p_M_header; // r4
std::_Rb_tree_node_base *M_right; // r1
int v9; // r0
_BOOL4 v10; // r7
int v11; // r0
if ( a2 )
cocos2d::CCObject::retain(a2);
m_pSet = a1->m_pSet;
v5 = 1;
M_parent = m_pSet->_M_t._M_impl._M_header._M_parent;
p_M_header = &m_pSet->_M_t._M_impl._M_header;
while ( M_parent )
{
p_M_header = M_parent;
if ( (unsigned int)a2 >= M_parent[1]._M_color )
{
M_right = M_parent->_M_right;
v5 = 0;
}
else
{
M_right = M_parent->_M_left;
v5 = 1;
}
M_parent = M_right;
}
if ( !v5 )
{
v9 = (int)p_M_header;
LABEL_13:
if ( *(_DWORD *)(v9 + 16) >= (unsigned int)a2 )
return;
goto LABEL_14;
}
if ( p_M_header != m_pSet->_M_t._M_impl._M_header._M_left )
{
v9 = sub_762018(p_M_header);
goto LABEL_13;
}
LABEL_14:
v10 = p_M_header == &m_pSet->_M_t._M_impl._M_header || (unsigned int)a2 < p_M_header[1]._M_color;
v11 = operator new(0x14u);
*(_DWORD *)(v11 + 16) = a2;
sub_7620E8(v10, v11, p_M_header, &m_pSet->_M_t._M_impl._M_header);
++m_pSet->_M_t._M_impl._M_node_count;
}