//
// cocos2d::CCParticleBatchNode::insertChild from 0x180063be0 to 0x180063d26 (326 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleBatchNode::addChild @ 0x180063602
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bd9b4
//
// 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 11:21:52 +0000
//
void __fastcall cocos2d::CCParticleBatchNode::insertChild(
cocos2d::CCParticleBatchNode *this,
struct cocos2d::CCParticleSystem *a2,
unsigned int a3)
{
__int64 v3; // rax
__int64 v6; // rsi
__int64 (__fastcall *v8)(struct cocos2d::CCParticleSystem *); // rdi
int v9; // ebx
unsigned int v10; // ebx
__int64 (__fastcall *v11)(struct cocos2d::CCParticleSystem *); // rdi
int v12; // ebx
int v13; // eax
__int64 (__fastcall *v14)(struct cocos2d::CCParticleSystem *); // rsi
int v15; // eax
cocos2d::CCTextureAtlas *v16; // rbx
unsigned int v17; // eax
__int64 v18; // rdi
int v19; // ebx
int v20; // ebx
int v21; // eax
cocos2d::CCTextureAtlas *v22; // rbx
unsigned int v23; // eax
v3 = *(_QWORD *)a2;
*((_DWORD *)a2 + 112) = a3;
v6 = *((_QWORD *)this + 41);
v8 = *(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(v3 + 1488);
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 72LL))(v6);
v10 = v8(a2) + v9;
if ( v10 > (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v6 + 80LL))(v6) )
{
v11 = *(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1488LL);
v12 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 72LL))(*((_QWORD *)this + 41));
v13 = v11(a2);
cocos2d::CCTextureAtlas::resizeCapacity(*((cocos2d::CCTextureAtlas **)this + 41), v12 + v13);
v14 = *(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1488LL);
LODWORD(v11) = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 80LL))(*((_QWORD *)this + 41));
v15 = v14(a2);
v16 = *((cocos2d::CCTextureAtlas **)this + 41);
LODWORD(v11) = (_DWORD)v11 - v15;
v17 = v14(a2);
cocos2d::CCTextureAtlas::fillWithEmptyQuadsFromIndex(v16, (unsigned int)v11, v17);
}
v18 = *((_QWORD *)this + 41);
v19 = *((_DWORD *)a2 + 112);
v20 = (*(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1488LL))(a2) + v19;
if ( v20 != (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v18 + 72LL))(v18) )
{
v21 = (*(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1488LL))(a2);
cocos2d::CCTextureAtlas::moveQuadsFromIndex(*((cocos2d::CCTextureAtlas **)this + 41), a3, v21 + a3);
}
v22 = *((cocos2d::CCTextureAtlas **)this + 41);
v23 = (*(__int64 (__fastcall **)(struct cocos2d::CCParticleSystem *))(*(_QWORD *)a2 + 1488LL))(a2);
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(v22, v23);
cocos2d::CCParticleBatchNode::updateAllAtlasIndexes(this);
}