//
// sub_1800A1780 from 0x1800a1780 to 0x1800a183e (190 bytes)
//
// 3 xrefs:
// > cocos2d::CCArray::insertObject @ 0x1800071e4
// > cocos2d::CCArray::replaceObjectAtIndex @ 0x1800073bc
// > ??> @ 0x1801c171c
//
// This function is hookable on this platform (idp: pc, 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 11:22:13 +0000
//
__int64 __fastcall sub_1800A1780(int *a1, cocos2d::CCObject *a2, unsigned int a3)
{
int v3; // r9d
unsigned int v5; // r11d
__int64 v7; // r14
void *v8; // rcx
char *v9; // rax
char *v10; // r10
unsigned int v11; // r9d
__int64 result; // rax
v3 = *a1;
v5 = a1[1];
v7 = a3;
if ( v5 >= *a1 + 1 )
{
v10 = *((char **)a1 + 2);
}
else
{
do
{
v8 = *((void **)a1 + 2);
a1[1] = 2 * v5;
v9 = (char *)realloc(v8, 16LL * v5);
*((_QWORD *)a1 + 2) = v9;
v10 = v9;
v3 = *a1;
v5 = a1[1];
}
while ( v5 < *a1 + 1 );
}
v11 = v3 - v7;
if ( v11 )
memmove(&v10[8 * (unsigned int)(v7 + 1)], &v10[8 * v7], 8LL * v11);
cocos2d::CCObject::retain(a2);
result = *((_QWORD *)a1 + 2);
*(_QWORD *)(result + 8 * v7) = a2;
++*a1;
return result;
}