//
// cocos2d::CCParticleSystemQuad::allocMemory from 0x7e6846 to 0x7e68cc (134 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::initWithTotalParticles @ 0x7e690e
// > cocos2d::CCParticleSystemQuad::setBatchNode @ 0x7e6a52
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:54 +0000
//
int __fastcall cocos2d::CCParticleSystemQuad::allocMemory(cocos2d::CCParticleSystemQuad *this)
{
void *v2; // r0
void *v3; // r0
int v4; // r7
size_t v5; // r8
size_t v6; // r7
void *v7; // r0
void *v8; // r6
void *v9; // r0
void *v10; // r4
v2 = *((void **)this + 175);
if ( v2 )
{
free(v2);
*((_DWORD *)this + 175) = 0;
}
v3 = *((void **)this + 176);
if ( v3 )
free(v3);
v4 = *((_DWORD *)this + 145);
v5 = 96 * v4;
v6 = 12 * v4;
v7 = malloc(v5);
*((_DWORD *)this + 175) = v7;
v8 = v7;
v9 = malloc(v6);
v10 = v9;
*((_DWORD *)this + 176) = v9;
if ( v8 )
{
if ( v9 )
{
memset(v8, 0, v5);
memset(v10, 0, v6);
return 1;
}
free(v8);
*((_DWORD *)this + 175) = 0;
}
else if ( v9 )
{
free(v9);
*((_DWORD *)this + 176) = 0;
return 0;
}
return (int)v10;
}