//
// cocos2d::CCSet::CCSet from 0x7c8790 to 0x7c8898 (264 bytes)
//
// 1 xrefs:
// > cocos2d::CCSet::copy @ 0x7c88ae
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:00:27 +0000
//
// Alternative name is '_ZN7cocos2d5CCSetC1ERKS0_'
cocos2d::CCSet *__fastcall cocos2d::CCSet::CCSet(cocos2d::CCSet *this, const cocos2d::CCSet *a2)
{
_DWORD *v4; // r0
_DWORD *v5; // r7
_DWORD *v6; // r8
int v7; // r5
_DWORD *v8; // r7
_DWORD *i; // r11
_DWORD *v10; // t1
int *v11; // r3
_DWORD *j; // r2
_DWORD *v13; // r4
_DWORD *v14; // r0
int *v15; // r3
int v16; // r3
int *k; // r4
int v18; // r0
int *v20; // [sp+8h] [bp-Ch] BYREF
cocos2d::CCObject::CCObject(this);
*(_DWORD *)this = &off_D04FF8;
v4 = (_DWORD *)operator new(0xCu);
v5 = *((_DWORD **)a2 + 13);
v6 = v4 + 1;
v4[1] = 0;
v4[2] = 0;
v7 = (int)v4;
*v4 = v4 + 1;
v10 = (_DWORD *)*v5;
v8 = v5 + 1;
for ( i = v10; i != v8; i = std::__tree_next *>(i) )
{
v11 = *(int **)v7;
if ( v6 == *(_DWORD **)v7 )
goto LABEL_27;
v11 = *(int **)(v7 + 4);
if ( v11 )
{
while ( v11[1] )
v11 = (int *)v11[1];
}
else
{
for ( j = v6; ; j = (_DWORD *)j[2] )
{
v11 = (int *)j[2];
if ( j != (_DWORD *)*v11 )
break;
}
}
if ( (unsigned int)v11[4] < i[4] )
{
LABEL_27:
if ( *(_DWORD *)(v7 + 4) )
{
v20 = v11;
v13 = v11 + 1;
}
else
{
v20 = v6;
v13 = v6;
}
}
else
{
v13 = std::__tree::__find_equal(v7, &v20, i + 4);
}
if ( !*v13 )
{
v14 = (_DWORD *)operator new(0x14u);
v14[4] = i[4];
v15 = v20;
v14[1] = 0;
*v14 = 0;
v14[2] = v15;
*v13 = v14;
v16 = **(_DWORD **)v7;
if ( v16 )
*(_DWORD *)v7 = v16;
std::__tree_balance_after_insert *>(*(_DWORD **)(v7 + 4), (_DWORD *)*v13);
++*(_DWORD *)(v7 + 8);
}
}
*((_DWORD *)this + 13) = v7;
for ( k = *(int **)v7; k != (int *)(*((_DWORD *)this + 13) + 4); k = std::__tree_next *>(k) )
{
v18 = k[4];
if ( !v18 )
break;
cocos2d::CCObject::retain(v18);
}
return this;
}