//
// cocos2d::CCParticleBatchNode::insertChild from 0xd72cc4 to 0xd72e48 (388 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleBatchNode::addChild @ 0xd72f24
// > ??> @ 0xa7608
//
// This function is hookable on this platform (idp: arm, 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 13:08:01 +0000
//
__int64 __fastcall cocos2d::CCParticleBatchNode::insertChild(
cocos2d::CCParticleBatchNode *this,
cocos2d::CCParticleSystem *a2,
unsigned int a3)
{
int v6; // w21
unsigned int v7; // w21
int v8; // w21
int v9; // w21
cocos2d::CCTextureAtlas *v10; // x21
int v11; // w0
__int64 v12; // x1
cocos2d::CCParticleSystem *v13; // x0
cocos2d::CCTextureAtlas *v14; // x19
unsigned int v15; // w0
int v17; // w21
int v18; // w0
cocos2d::CCTextureAtlas *v19; // x23
int v20; // w21
unsigned int v21; // w0
unsigned int v22; // [xsp+48h] [xbp+48h]
*((_DWORD *)a2 + 110) = a3;
v6 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 80LL))(*((_QWORD *)this + 41));
v7 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2) + v6;
if ( v7 > (*(unsigned int (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 88LL))(*((_QWORD *)this + 41)) )
{
v17 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 80LL))(*((_QWORD *)this + 41));
v18 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2);
cocos2d::CCParticleBatchNode::increaseAtlasCapacityTo((cocos2d::CCTextureAtlas **)this, v18 + v17);
v19 = *((cocos2d::CCTextureAtlas **)this + 41);
v20 = (*(__int64 (__fastcall **)(cocos2d::CCTextureAtlas *))(*(_QWORD *)v19 + 88LL))(v19);
v22 = v20 - (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2);
v21 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2);
cocos2d::CCTextureAtlas::fillWithEmptyQuadsFromIndex(v19, v22, v21);
}
v8 = *((_DWORD *)a2 + 110);
v9 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2) + v8;
if ( v9 != (*(unsigned int (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 80LL))(*((_QWORD *)this + 41)) )
{
v10 = *((cocos2d::CCTextureAtlas **)this + 41);
v11 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1496LL))(a2);
cocos2d::CCTextureAtlas::moveQuadsFromIndex(v10, a3, v11 + a3);
}
v12 = *(_QWORD *)a2;
v13 = a2;
v14 = *((cocos2d::CCTextureAtlas **)this + 41);
v15 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(v12 + 1496))(v13);
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(v14, v15);
return cocos2d::CCParticleBatchNode::updateAllAtlasIndexes(this);
}