//
// cocos2d::ccArrayInsertObjectAtIndexBatch from 0xd91d70 to 0xd91e20 (176 bytes)
//
// 2 xrefs:
// > cocos2d::CCSpriteBatchNode::insertChild @ 0xd890fc
// > ??> @ 0xdfcc0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:08:19 +0000
//
__int64 __fastcall cocos2d::ccArrayInsertObjectAtIndexBatch(__int64 a1, __int64 a2, unsigned int a3)
{
__int64 result; // x0
unsigned int v7; // w0
__int64 v8; // x1
__int64 v9; // x2
cocos2d::ccArrayEnsureExtraCapacity((_DWORD *)a1, 1);
if ( *(_DWORD *)a1 != a3 )
{
memmove(
(void *)(*(_QWORD *)(a1 + 16) + 8LL * (a3 + 1)),
(const void *)(*(_QWORD *)(a1 + 16) + 8LL * a3),
8LL * (*(_DWORD *)a1 - a3));
v7 = a3;
if ( a3 < *(_DWORD *)a1 )
{
v8 = 8LL * (int)a3;
do
{
v9 = *(_QWORD *)(*(_QWORD *)(a1 + 16) + v8);
v8 += 8;
*(_DWORD *)(v9 + 40) = v7++;
}
while ( v7 < *(_DWORD *)a1 );
}
}
cocos2d::CCObject::retain(a2);
*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8LL * a3) = a2;
*(_DWORD *)(a2 + 40) = a3;
result = (unsigned int)(*(_DWORD *)a1 + 1);
*(_DWORD *)a1 = result;
return result;
}