//
// sub_1008988B0 from 0x1008988b0 to 0x10089896e (190 bytes)
//
// 3 xrefs:
// > sub_1008989B0 @ 0x1008989b5
// > cocos2d::CCSet::copy @ 0x100898bfd
// > cocos2d::CCSet::mutableCopy @ 0x100898c3d
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:37:07 +0000
//
_QWORD *__fastcall sub_1008988B0(_QWORD *a1, __int64 a2)
{
char *v3; // r14
_QWORD *v4; // rdx
_QWORD *v5; // r15
_QWORD *result; // rax
_QWORD *v7; // r14
__int64 v8; // rdi
_QWORD *v9; // rcx
bool v10; // zf
cocos2d::CCObject::CCObject((__int64)a1);
*a1 = off_100BA84B8;
v3 = (char *)operator new(0x18u);
v4 = *(_QWORD **)(a2 + 56);
v5 = v3 + 8;
*(_OWORD *)(v3 + 8) = 0;
*(_QWORD *)v3 = v3 + 8;
result = (_QWORD *)sub_100898EC0(v3, *v4, v4 + 1);
a1[7] = v3;
v7 = *(_QWORD **)v3;
if ( v7 != v5 )
{
do
{
v8 = v7[4];
if ( !v8 )
break;
cocos2d::CCObject::retain(v8);
v9 = (_QWORD *)v7[1];
if ( v9 )
{
do
{
result = v9;
v9 = (_QWORD *)*v9;
}
while ( v9 );
}
else
{
do
{
result = (_QWORD *)v7[2];
v10 = *result == (_QWORD)v7;
v7 = result;
}
while ( !v10 );
}
v7 = result;
}
while ( result != (_QWORD *)(a1[7] + 8LL) );
}
return result;
}