//
// sub_100747970 from 0x100747970 to 0x1007479af (63 bytes)
//
// 7 xrefs:
// > cocos2d::CCKeyboardDispatcher::removeDelegate @ 0x1001e5be6
// > cocos2d::CCKeyboardDispatcher::addDelegate @ 0x1001e5d18
// > cocos2d::CCTouchDispatcher::removeDelegate @ 0x1004c7c56
// > cocos2d::CCMouseDispatcher::removeDelegate @ 0x10059de76
// > cocos2d::CCMouseDispatcher::addDelegate @ 0x10059dfa8
// > cocos2d::CCKeypadDispatcher::removeDelegate @ 0x1006d03c6
// > cocos2d::CCKeypadDispatcher::addDelegate @ 0x1006d04f8
//
// 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 12:36:31 +0000
//
unsigned __int64 __fastcall sub_100747970(unsigned int *a1, __int64 a2)
{
__int64 v2; // rcx
unsigned __int64 result; // rax
unsigned int v4; // esi
__int64 v5; // rsi
v2 = *a1;
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v2) = a2;
result = (unsigned int)(v2 + 1);
*a1 = result;
v4 = a1[1];
if ( (unsigned int)result >= v4 )
{
v5 = 2 * v4;
a1[1] = v5;
result = (unsigned __int64)realloc(*((void **)a1 + 2), 8 * v5);
*((_QWORD *)a1 + 2) = result;
}
return result;
}