//
// sub_1006675A0 from 0x1006675a0 to 0x10066762b (139 bytes)
//
// 0 xrefs:
//
// 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
//
__int64 __fastcall sub_1006675A0(unsigned int *a1, cocos2d::CCObject *a2)
{
__int64 v4; // rax
__int64 v5; // rcx
__int64 v6; // rdx
int v7; // esi
__int64 v8; // rdi
__int64 v9; // rcx
__int64 result; // rax
v4 = a1[2];
if ( v4 != 0xFFFFFFFFLL )
{
if ( (int)v4 > 0 )
{
v5 = *((_QWORD *)a1 + 2);
v6 = 0;
v7 = 0;
do
{
v8 = *(_QWORD *)(v5 + 8 * v6);
if ( v8 )
{
if ( v7 > 0 )
{
*(_QWORD *)(v5 - 8LL * v7 + 8 * v6) = v8;
*(_DWORD *)(v8 + 36) = v6 - v7;
}
}
else
{
++v7;
}
++v6;
}
while ( v4 != v6 );
}
a1[2] = -1;
}
cocos2d::CCObject::retain(a2);
v9 = *a1;
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v9) = a2;
a2->m_uUnknown = v9;
result = (unsigned int)(v9 + 1);
*a1 = result;
return result;
}