//
// sub_100668030 from 0x100668030 to 0x1006680b3 (131 bytes)
//
// 1 xrefs:
// > sub_100720220 @ 0x100720229
//
// 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_100668030(int *a1, __int64 a2, char a3)
{
int v3; // ecx
__int64 v4; // rax
__int64 v5; // rbx
cocos2d::CCObject *v6; // rax
v3 = *a1;
if ( *a1 )
{
v4 = *((_QWORD *)a1 + 2);
v5 = 0;
while ( *(_QWORD *)(v4 + 8 * v5) != a2 )
{
if ( v3 == (_DWORD)++v5 )
return;
}
if ( (_DWORD)v5 != -1 )
{
if ( a3 )
{
v6 = *(cocos2d::CCObject **)(v4 + 8 * v5);
if ( v6 )
{
cocos2d::CCObject::release(v6);
v3 = *a1;
}
}
*a1 = v3 - 1;
if ( v3 - 1 != (_DWORD)v5 )
memmove(
(void *)(*((_QWORD *)a1 + 2) + 8 * v5),
(const void *)(*((_QWORD *)a1 + 2) + 8 * v5 + 8),
8LL * (unsigned int)(v3 + ~(_DWORD)v5));
}
}
}