//
// cocos2d::CCParticleSystemQuad::setTotalParticles from 0xd73c20 to 0xd73db0 (400 bytes)
//
// 13 xrefs:
// > ??> @ 0xb66c8
// > ??> @ 0x1528100
// > ??> @ 0x15287c0
// > ??> @ 0x1528e80
// > ??> @ 0x1529540
// > ??> @ 0x1529c00
// > ??> @ 0x152a2c0
// > ??> @ 0x152a980
// > ??> @ 0x152b040
// > ??> @ 0x152b700
// > ??> @ 0x152bdc0
// > ??> @ 0x152c480
// > ??> @ 0x152d670
//
// 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::CCParticleSystemQuad::setTotalParticles(
cocos2d::CCParticleSystemQuad *this,
unsigned int a2)
{
size_t v4; // x26
size_t v5; // x23
size_t v6; // x21
void *v7; // x24
void *v8; // x25
void *v9; // x3
__int64 v10; // x0
unsigned int v11; // w0
__int64 result; // x0
if ( *((_DWORD *)this + 112) >= a2 )
{
*((_DWORD *)this + 165) = a2;
return cocos2d::CCParticleSystem::resetSystem(this);
}
v4 = 148LL * a2;
v5 = 96LL * a2;
v6 = 12LL * a2;
v7 = realloc(*((void **)this + 52), v4);
v8 = realloc(*((void **)this + 98), v5);
v9 = realloc(*((void **)this + 99), v6);
result = v8 != nullptr;
if ( v8 )
{
if ( !v7 )
goto LABEL_13;
if ( v9 )
{
*((_QWORD *)this + 99) = v9;
*((_QWORD *)this + 52) = v7;
*((_QWORD *)this + 98) = v8;
memset(v7, 0, v4);
memset(*((void **)this + 98), 0, v5);
memset(*((void **)this + 99), 0, v6);
*((_DWORD *)this + 112) = a2;
v10 = *((_QWORD *)this + 54);
*((_DWORD *)this + 165) = a2;
if ( v10 )
{
v11 = 0;
if ( a2 )
{
do
{
*(_DWORD *)(*((_QWORD *)this + 52) + 148LL * v11 + 72) = v11;
++v11;
}
while ( *((_DWORD *)this + 165) > v11 );
}
}
cocos2d::CCParticleSystemQuad::initIndices((__int64)this);
cocos2d::CCParticleSystemQuad::setupVBO(this);
cocos2d::CCParticleSystemQuad::updateTexCoords(this);
return cocos2d::CCParticleSystem::resetSystem(this);
}
LABEL_12:
*((_QWORD *)this + 52) = v7;
LABEL_13:
if ( v8 )
*((_QWORD *)this + 98) = v8;
goto LABEL_15;
}
if ( v7 )
goto LABEL_12;
LABEL_15:
if ( v9 )
*((_QWORD *)this + 99) = v9;
return result;
}