//
// sub_1006680C0 from 0x1006680c0 to 0x100668190 (208 bytes)
//
// 1 xrefs:
// > sub_100720250 @ 0x10072025d
//
// 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
//
void __fastcall sub_1006680C0(int *a1, unsigned int *a2)
{
int v3; // eax
__int64 v4; // r15
__int64 v5; // rcx
__int64 v6; // r12
cocos2d::CCObject *v7; // rdi
if ( *a2 )
{
v3 = *a1;
if ( *a1 )
{
v4 = 0;
LABEL_4:
v5 = *((_QWORD *)a1 + 2);
v6 = 0;
while ( *(_QWORD *)(v5 + 8 * v6) != *(_QWORD *)(*((_QWORD *)a2 + 2) + 8 * v4) )
{
if ( v3 == (_DWORD)++v6 )
goto LABEL_13;
}
if ( (_DWORD)v6 != -1 )
{
v7 = *(cocos2d::CCObject **)(v5 + 8 * v6);
if ( v7 )
{
cocos2d::CCObject::release(v7);
v3 = *a1;
}
*a1 = v3 - 1;
if ( v3 - 1 != (_DWORD)v6 )
memmove(
(void *)(*((_QWORD *)a1 + 2) + 8 * v6),
(const void *)(*((_QWORD *)a1 + 2) + 8 * v6 + 8),
8LL * (unsigned int)(v3 + ~(_DWORD)v6));
}
LABEL_13:
while ( ++v4 < (unsigned __int64)*a2 )
{
v3 = *a1;
if ( *a1 )
goto LABEL_4;
}
}
}
}