//
// cocos2d::CCParticleBatchNode::insertChild from 0x1003c8e80 to 0x1003c9003 (387 bytes)
//
// 1 xrefs:
// > cocos2d::CCParticleBatchNode::addChild @ 0x1003c8d1b
//
// 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
//
void __fastcall cocos2d::CCParticleBatchNode::insertChild(
cocos2d::CCParticleBatchNode *a1,
cocos2d::CCParticleSystem *a2,
unsigned int a3)
{
int v4; // r12d
unsigned int v5; // r13d
int v6; // r12d
int v7; // eax
cocos2d::CCTextureAtlas *m_pTextureAtlas; // r12
int v9; // r13d
unsigned int v10; // r13d
unsigned int v11; // eax
unsigned int m_uAtlasIndex; // r13d
int v13; // r12d
cocos2d::CCTextureAtlas *v14; // r12
int v15; // eax
cocos2d::CCTextureAtlas *v16; // r15
unsigned int v17; // eax
cocos2d::CCArray *m_pChildren; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // rbx
unsigned __int64 v21; // r14
int v22; // r15d
cocos2d::CCObject *v23; // rdi
a2->m_uAtlasIndex = a3;
v4 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))a1->m_pTextureAtlas->getTotalQuads)(a1->m_pTextureAtlas);
v5 = v4 + ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
if ( v5 > ((unsigned int (__fastcall *)(cocos2d::CCTextureAtlas *))a1->m_pTextureAtlas->getCapacity)(a1->m_pTextureAtlas) )
{
v6 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))a1->m_pTextureAtlas->getTotalQuads)(a1->m_pTextureAtlas);
v7 = ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
cocos2d::CCTextureAtlas::resizeCapacity(a1->m_pTextureAtlas, v7 + v6);
m_pTextureAtlas = a1->m_pTextureAtlas;
v9 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))m_pTextureAtlas->getCapacity)(m_pTextureAtlas);
v10 = v9 - ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
v11 = ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
cocos2d::CCTextureAtlas::fillWithEmptyQuadsFromIndex(m_pTextureAtlas, v10, v11);
}
m_uAtlasIndex = a2->m_uAtlasIndex;
v13 = m_uAtlasIndex + ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
if ( v13 != ((unsigned int (__fastcall *)(cocos2d::CCTextureAtlas *))a1->m_pTextureAtlas->getTotalQuads)(a1->m_pTextureAtlas) )
{
v14 = a1->m_pTextureAtlas;
v15 = ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
cocos2d::CCTextureAtlas::moveQuadsFromIndex_1(v14, a3, v15 + a3);
}
v16 = a1->m_pTextureAtlas;
v17 = ((__int64 (__fastcall *)(cocos2d::CCParticleSystem *))a2->getTotalParticles)(a2);
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(v16, v17);
m_pChildren = a1->m_pChildren;
if ( m_pChildren )
{
data = m_pChildren->data;
if ( data->num )
{
arr = data->arr;
v21 = (unsigned __int64)&arr[data->num - 1];
v22 = 0;
do
{
v23 = *arr;
if ( !*arr )
break;
v23[7].m_uOrderOfArrival = v22;
v22 += ((__int64 (__fastcall *)(cocos2d::CCObject *))v23->__vftable[18].update)(v23);
++arr;
}
while ( (unsigned __int64)arr <= v21 );
}
}
}