//
// sub_1006676C0 from 0x1006676c0 to 0x10066771c (92 bytes)
//
// 11 xrefs:
// > cocos2d::CCNode::addChild @ 0x100272fdc
// > cocos2d::CCNode::insertChild @ 0x100273097
// > cocos2d::CCParallaxNode::addChild_1 @ 0x1004aea05
// > sub_10071FA80 @ 0x10071faf5
// > sub_10071FB40 @ 0x10071fb78
// > sub_10071FB90 @ 0x10071fc34
// > sub_10071FB90 @ 0x10071fc88
// > sub_10071FCD0 @ 0x10071fcd9
// > sub_10071FED0 @ 0x10071ff77
// > sub_10071FED0 @ 0x10071ffc7
// > sub_1007204B0 @ 0x100720557
//
// 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_1006676C0(unsigned int *a1, cocos2d::CCObject *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;
result = (unsigned int)(v6 + 1);
*a1 = result;
return result;
}