//
// cocos2d::CCSet::CCSet from 0x5c1858 to 0x5c18d4 (124 bytes)
//
// 1 xrefs:
// > cocos2d::CCSet::copy @ 0x5c18e6
//
// 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
//
// Alternative name is '_ZN7cocos2d5CCSetC1ERKS0_'
cocos2d::CCSet *__fastcall cocos2d::CCSet::CCSet(cocos2d::CCSet *this, const cocos2d::CCSet *a2)
{
std::set *v4; // r0
std::set *m_pSet; // r7
int p_M_header; // r6
std::set *v7; // r4
int *M_parent; // r1
std::_Rb_tree_node_base *v9; // r0
std::_Rb_tree_node_base *v10; // r3
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type M_node_count; // r3
std::set *i; // r4
cocos2d::CCObject *M_right; // r0
cocos2d::CCObject::CCObject(this);
this->__vftable = (cocos2d::CCSet_vtbl *)&off_AA18D0;
v4 = (std::set *)operator new(0x18u);
m_pSet = a2->m_pSet;
p_M_header = (int)&v4->_M_t._M_impl._M_header;
v7 = v4;
memset(&v4->_M_t._M_impl._M_header, 0, sizeof(v4->_M_t._M_impl._M_header));
v7->_M_t._M_impl._M_header._M_left = (std::_Rb_tree_node_base::_Base_ptr)p_M_header;
v7->_M_t._M_impl._M_header._M_right = (std::_Rb_tree_node_base::_Base_ptr)p_M_header;
M_parent = (int *)m_pSet->_M_t._M_impl._M_header._M_parent;
v7->_M_t._M_impl._M_node_count = 0;
if ( M_parent )
{
v9 = (std::_Rb_tree_node_base *)std::_Rb_tree,std::less,std::allocator>::_M_copy(
(int)v7,
M_parent,
p_M_header);
v10 = v9;
v7->_M_t._M_impl._M_header._M_parent = v9;
while ( v10->_M_left )
v10 = v10->_M_left;
v7->_M_t._M_impl._M_header._M_left = v10;
while ( v9->_M_right )
v9 = v9->_M_right;
M_node_count = m_pSet->_M_t._M_impl._M_node_count;
v7->_M_t._M_impl._M_header._M_right = v9;
v7->_M_t._M_impl._M_node_count = M_node_count;
}
this->m_pSet = v7;
for ( i = (std::set *)v7->_M_t._M_impl._M_header._M_left;
i != (std::set *)&this->m_pSet->_M_t._M_impl._M_header;
i = (std::set *)sub_761FE0(i) )
{
M_right = (cocos2d::CCObject *)i->_M_t._M_impl._M_header._M_right;
if ( !M_right )
break;
cocos2d::CCObject::retain(M_right);
}
return this;
}