//
// cocos2d::CCParticleSystem::initWithTotalParticles from 0xd6e5d0 to 0xd6e6bc (236 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0xd73f38
// > ??> @ 0x8fa70
// > ??> @ 0x152cbe8
//
// 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:07:58 +0000
//
__int64 __fastcall cocos2d::CCParticleSystem::initWithTotalParticles(
cocos2d::CCParticleSystem *this,
unsigned int a2,
unsigned __int8 a3)
{
void *v5; // x0
int v6; // w20
unsigned int v7; // w22
_DWORD *v8; // x0
__int64 v9; // x1
int v10; // w1
unsigned int v11; // w21
v5 = *((void **)this + 52);
v6 = a3;
*((_DWORD *)this + 165) = a2;
if ( v5 )
{
free(v5);
v7 = *((_DWORD *)this + 165);
}
else
{
v7 = a2;
}
v8 = calloc(v7, 0x94u);
*((_QWORD *)this + 52) = v8;
if ( v8 )
{
v9 = *((_QWORD *)this + 54);
*((_DWORD *)this + 112) = a2;
if ( v9 && v7 )
{
v10 = 0;
while ( 1 )
{
v8[37 * v10 + 18] = v10;
if ( *((_DWORD *)this + 165) <= (unsigned int)++v10 )
break;
v8 = *((_DWORD **)this + 52);
}
}
*((_DWORD *)this + 168) = 1;
v11 = 1;
*((_BYTE *)this + 452) = 1;
*((_DWORD *)this + 171) = 0;
*((_DWORD *)this + 169) = 771;
*((_DWORD *)this + 173) = 0;
*((_BYTE *)this + 688) = 0;
*((_BYTE *)this + 444) = 0;
if ( !v6 )
{
cocos2d::CCNode::scheduleUpdateWithPriority((cocos2d::CCScheduler **)this, 1);
*((_BYTE *)this + 557) = 1;
}
}
else
{
v11 = 0;
cocos2d::CCObject::release(this);
}
return v11;
}