//
// sub_18009D540 from 0x18009d540 to 0x18009d5de (158 bytes)
//
// 3 xrefs:
// > cocos2d::CCArray::addObjectsFromArray @ 0x1800068a8
// > cocos2d::CCArray::initWithArray @ 0x180006f6d
// > ??> @ 0x1801b73c8
//
// 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_18009D540(unsigned int *a1, int *a2)
{
int v2; // edi
unsigned int i; // edx
void *v6; // rcx
__int64 j; // rsi
cocos2d::CCObject *v8; // rdi
v2 = *a2;
for ( i = a1[1]; i < v2 + *a1; i = a1[1] )
{
v6 = *((void **)a1 + 2);
a1[1] = 2 * i;
*((_QWORD *)a1 + 2) = realloc(v6, 16LL * i);
}
for ( j = 0; (unsigned int)j < *a2; ++*a1 )
{
v8 = *(cocos2d::CCObject **)(*((_QWORD *)a2 + 2) + 8 * j);
cocos2d::CCObject::retain(v8);
j = (unsigned int)(j + 1);
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8LL * *a1) = v8;
}
}