//
// sub_1800A1E00 from 0x1800a1e00 to 0x1800a1e3c (60 bytes)
//
// 6 xrefs:
// > cocos2d::CCKeyboardDispatcher::addDelegate @ 0x180045ad5
// > cocos2d::CCMouseDispatcher::removeDelegate @ 0x180047171
// > cocos2d::CCMouseDispatcher::addDelegate @ 0x180062ee5
// > cocos2d::CCTouchDispatcher::removeDelegate @ 0x1800b6de6
// > cocos2d::CCKeypadDispatcher::addDelegate @ 0x1800b8145
// > ??> @ 0x1801c1800
//
// 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
//
void *__fastcall sub_1800A1E00(__int64 a1, __int64 a2)
{
void *result; // rax
unsigned int v4; // eax
*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8LL * (unsigned int)(*(_DWORD *)a1)++) = a2;
result = (void *)*(unsigned int *)(a1 + 4);
if ( *(_DWORD *)a1 >= (unsigned int)result )
{
v4 = 2 * (_DWORD)result;
*(_DWORD *)(a1 + 4) = v4;
result = realloc(*(void **)(a1 + 16), 8LL * v4);
*(_QWORD *)(a1 + 16) = result;
}
return result;
}