//
// sub_18009D770 from 0x18009d770 to 0x18009d7de (110 bytes)
//
// 2 xrefs:
// > cocos2d::CCArray::addObjectNew @ 0x180006894
// > ??> @ 0x1801b7404
//
// 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 sub_18009D770(unsigned int *a1, cocos2d::CCObject *a2)
{
unsigned int i; // ecx
unsigned int v5; // eax
void *v6; // rcx
__int64 result; // rax
for ( i = a1[1]; i < *a1 + 1; i = a1[1] )
{
v5 = 2 * i;
v6 = *((void **)a1 + 2);
a1[1] = v5;
*((_QWORD *)a1 + 2) = realloc(v6, 8LL * v5);
}
cocos2d::CCObject::retain(a2);
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8LL * *a1) = a2;
result = *a1;
a2->m_uIndexInArray = result;
++*a1;
return result;
}