//
// cocos2d::CCParticleSystemQuad::setBatchNode from 0xd74154 to 0xd7424c (248 bytes)
//
// 13 xrefs:
// > ??> @ 0x86e90
// > ??> @ 0x1527ea8
// > ??> @ 0x1528568
// > ??> @ 0x1528c28
// > ??> @ 0x15292e8
// > ??> @ 0x15299a8
// > ??> @ 0x152a068
// > ??> @ 0x152a728
// > ??> @ 0x152ade8
// > ??> @ 0x152b4a8
// > ??> @ 0x152bb68
// > ??> @ 0x152c228
// > ??> @ 0x152d418
//
// 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:02 +0000
//
__int64 __fastcall cocos2d::CCParticleSystemQuad::setBatchNode(__int64 this, cocos2d::CCParticleBatchNode *a2)
{
cocos2d::CCParticleBatchNode *v2; // x20
__int64 v4; // x21
__int64 v5; // x0
void *v6; // x0
void *v7; // x0
void (__fastcall *v8)(__int64, __int64); // x19
__int64 v9; // x0
v2 = *(cocos2d::CCParticleBatchNode **)(this + 432);
if ( v2 != a2 )
{
v4 = this;
this = cocos2d::CCParticleSystem::setBatchNode(this, (__int64)a2);
if ( a2 )
{
if ( !v2 )
{
v5 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(v4 + 432) + 328LL) + 112LL))(*(_QWORD *)(*(_QWORD *)(v4 + 432) + 328LL));
memcpy(
(void *)(v5 + 96LL * *(unsigned int *)(v4 + 440)),
*(const void **)(v4 + 784),
96LL * *(unsigned int *)(v4 + 660));
v6 = *(void **)(v4 + 784);
if ( v6 )
{
free(v6);
*(_QWORD *)(v4 + 784) = 0;
}
v7 = *(void **)(v4 + 792);
if ( v7 )
{
free(v7);
*(_QWORD *)(v4 + 792) = 0;
}
this = glDeleteBuffers();
*(_QWORD *)(v4 + 800) = 0;
}
}
else
{
cocos2d::CCParticleSystemQuad::allocMemory((cocos2d::CCParticleSystemQuad *)v4);
cocos2d::CCParticleSystemQuad::initIndices(v4);
v8 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 1520LL);
v9 = (*(__int64 (__fastcall **)(cocos2d::CCParticleBatchNode *))(*(_QWORD *)v2 + 896LL))(v2);
v8(v4, v9);
return cocos2d::CCParticleSystemQuad::setupVBO((cocos2d::CCParticleSystemQuad *)v4);
}
}
return this;
}