//
// cocos2d::ccArrayInsertObjectAtIndexBatch from 0xb21214 to 0xb212bc (168 bytes)
//
// 2 xrefs:
// > cocos2d::CCSpriteBatchNode::insertChild @ 0xb17c1c
// > ??> @ 0xaab20
//
// 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 cocos2d::ccArrayInsertObjectAtIndexBatch(unsigned int *a1, cocos2d::CCObject *a2, unsigned int a3)
{
unsigned int v6; // w0
__int64 result; // x0
unsigned int v8; // w3
unsigned int v9; // w0
__int64 *v10; // x1
__int64 v11; // t1
cocos2d::ccArrayEnsureExtraCapacity(a1, 1);
if ( *a1 != a3 )
{
memmove(
(void *)(*((_QWORD *)a1 + 2) + 8LL * (a3 + 1)),
(const void *)(*((_QWORD *)a1 + 2) + 8LL * a3),
8LL * (*a1 - a3));
v8 = *a1;
v9 = a3;
if ( a3 < *a1 )
{
v10 = (__int64 *)(*((_QWORD *)a1 + 2) + 8LL * (int)a3);
do
{
v11 = *v10++;
*(_DWORD *)(v11 + 40) = v9++;
}
while ( v9 != v8 );
}
}
cocos2d::CCObject::retain(a2);
v6 = *a1;
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8LL * a3) = a2;
result = v6 + 1;
a2->m_unknown2 = a3;
*a1 = result;
return result;
}