//
// sub_100746D70 from 0x100746d70 to 0x100746dd0 (96 bytes)
//
// 1 xrefs:
// > cocos2d::CCSpriteBatchNode::appendChild @ 0x100155db0
//
// 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
//
__int64 __fastcall sub_100746D70(unsigned int *a1, __int64 a2)
{
unsigned int v3; // esi
void *v4; // rax
__int64 v5; // rsi
__int64 v6; // rcx
__int64 result; // rax
v3 = a1[1];
if ( v3 < *a1 + 1 )
{
v4 = *((void **)a1 + 2);
do
{
v5 = 2 * v3;
a1[1] = v5;
v4 = realloc(v4, 8 * v5);
*((_QWORD *)a1 + 2) = v4;
v3 = a1[1];
}
while ( v3 < *a1 + 1 );
}
cocos2d::CCObject::retain(a2);
v6 = *a1;
*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v6) = a2;
*(_DWORD *)(a2 + 40) = v6;
result = (unsigned int)(v6 + 1);
*a1 = result;
return result;
}