//
// sub_100667D20 from 0x100667d20 to 0x100667dd1 (177 bytes)
//
// 1 xrefs:
// > cocos2d::CCArray::recreateNewIndexes @ 0x1007201d9
//
// 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_100667D20(int *a1)
{
__int64 v1; // rsi
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rdx
__int64 v5; // rsi
v1 = *a1;
if ( v1 > 0 )
{
v2 = *((_QWORD *)a1 + 2);
v3 = v1 & 7;
if ( (unsigned int)v1 >= 8 )
{
v5 = v1 & 0x7FFFFFF8;
v4 = 0;
do
{
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4) + 32LL) = v4;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 8) + 32LL) = v4 + 1;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 16) + 32LL) = v4 + 2;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 24) + 32LL) = v4 + 3;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 32) + 32LL) = v4 + 4;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 40) + 32LL) = v4 + 5;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 48) + 32LL) = v4 + 6;
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4 + 56) + 32LL) = v4 + 7;
v4 += 8;
}
while ( v4 != v5 );
}
else
{
v4 = 0;
}
for ( ; v3; --v3 )
{
*(_DWORD *)(*(_QWORD *)(v2 + 8 * v4) + 32LL) = v4;
++v4;
}
}
}