//
// cocos2d::CCSet::addObject from 0x18000f8e0 to 0x18000f9bd (221 bytes)
//
// 11 xrefs:
// > cocos2d::CCActionManager::pauseAllRunningActions @ 0x180038212
// > cocos2d::CCEGLViewProtocol::getSetOfTouchesEndOrCancel @ 0x18006b7d3
// > cocos2d::CCEGLViewProtocol::handleTouchesBegin @ 0x18006bb1f
// > cocos2d::CCEGLViewProtocol::handleTouchesMove @ 0x18006bdfb
// > cocos2d::CCTouchDispatcher::touches @ 0x1800b3394
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x1800c0c9b
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x1800c0cca
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x1800c0cff
// > cocos2d::CCScheduler::pauseAllTargetsWithMinPriority @ 0x1800c0d29
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ae014
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCSet::addObject(cocos2d::CCSet *this, struct cocos2d::CCObject *a2)
{
std::set *m_pSet; // rsi
std::_Tree_val>::_Nodeptr Myhead; // rdi
std::_Tree_node::_Nodeptr Parent; // rax
std::_Tree_val>::_Nodeptr v7; // rcx
std::_Tree_val>::_Nodeptr *v8; // rax
__int128 v9; // [rsp+20h] [rbp-38h] BYREF
__int128 v10; // [rsp+30h] [rbp-28h]
if ( a2 )
cocos2d::CCObject::retain(a2);
m_pSet = this->m_pSet;
Myhead = m_pSet->_Mypair._Myval2._Myval2._Myhead;
Parent = m_pSet->_Mypair._Myval2._Myval2._Myhead->_Parent;
*(_QWORD *)&v10 = Parent;
DWORD2(v10) = 0;
v7 = Myhead;
while ( !Parent->_Isnil )
{
*(_QWORD *)&v10 = Parent;
if ( Parent->_Myval >= a2 )
{
DWORD2(v10) = 1;
v7 = Parent;
Parent = Parent->_Left;
}
else
{
DWORD2(v10) = 0;
Parent = Parent->_Right;
}
}
if ( v7->_Isnil || a2 < v7->_Myval )
{
if ( m_pSet->_Mypair._Myval2._Myval2._Mysize == 0x666666666666666LL )
std::vector::_Xlen();
v8 = (std::_Tree_val>::_Nodeptr *)operator new(0x28u);
v8[4] = (std::_Tree_val>::_Nodeptr)a2;
*v8 = Myhead;
v8[1] = Myhead;
v8[2] = Myhead;
*((_WORD *)v8 + 12) = 0;
v9 = v10;
sub_18000F590(m_pSet, (__int64)&v9, (__int64)v8);
}
}