//
// GJBaseGameLayer::createParticle from 0x9efbec to 0x9eff8c (928 bytes)
//
// 2 xrefs:
// > GameObject::createAndAddParticle @ 0x778ee4
// > ??> @ 0xed028
//
// 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 12:59:06 +0000
//
cocos2d::CCParticleSystem *__fastcall GJBaseGameLayer::createParticle(
__int64 a1,
unsigned int a2,
char *a3,
unsigned int a4,
unsigned int a5)
{
char *v9; // x22
__int64 v10; // x27
size_t v11; // x0
__int64 v12; // x22
cocos2d::CCArray *v13; // x0
const char *v14; // x1
__int64 v15; // x22
size_t v16; // x0
cocos2d::CCArray *v17; // x22
bool v18; // w2
cocos2d::CCParticleSystem *v19; // x19
cocos2d::CCArray *v21; // x27
cocos2d::CCObject *v22; // x26
const char *v23; // x1
__int64 v24; // x28
size_t v25; // x0
__int64 v26; // x28
char *v28; // [xsp+68h] [xbp+68h]
char *v29; // [xsp+68h] [xbp+68h]
__int64 v30; // [xsp+78h] [xbp+78h] BYREF
size_t v31; // [xsp+80h] [xbp+80h]
void *v32; // [xsp+88h] [xbp+88h]
cocos2d::CCArray *v33[2]; // [xsp+90h] [xbp+90h] BYREF
void *v34; // [xsp+A0h] [xbp+A0h]
__int64 v35[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v36; // [xsp+B8h] [xbp+B8h]
char v37[8]; // [xsp+C0h] [xbp+C0h] BYREF
size_t v38; // [xsp+C8h] [xbp+C8h]
void *v39; // [xsp+D0h] [xbp+D0h]
__int64 v40[3]; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v41[2]; // [xsp+F0h] [xbp+F0h] BYREF
void *v42; // [xsp+100h] [xbp+100h]
if ( *(_BYTE *)(GameManager::sharedState(_stack_chk_guard) + 925) )
return nullptr;
v9 = (char *)&v30 + 1;
GJBaseGameLayer::getParticleKey(a2, a3, a4, a5, &v30);
v10 = *(_QWORD *)(a1 + 12280);
if ( (v30 & 1) != 0 )
v9 = (char *)v32;
v33[0] = nullptr;
v33[1] = nullptr;
v34 = nullptr;
v11 = strlen(v9);
std::string::__init((__int64 *)v33, v9, v11);
v12 = cocos2d::CCDictionary::objectForKey(v10, v33);
v13 = (cocos2d::CCArray *)LOBYTE(v33[0]);
if ( ((__int64)v33[0] & 1) != 0 )
operator delete(v34);
if ( !v12 )
{
v21 = (cocos2d::CCArray *)cocos2d::CCArray::create(v13);
v22 = (cocos2d::CCObject *)cocos2d::CCArray::create(v21);
v23 = (char *)&v30 + 1;
v24 = *(_QWORD *)(a1 + 12280);
if ( (v30 & 1) != 0 )
v23 = (const char *)v32;
v29 = (char *)v23;
v35[0] = 0;
v35[1] = 0;
v36 = nullptr;
v25 = strlen(v23);
std::string::__init(v35, v29, v25);
cocos2d::CCDictionary::setObject(v24, v21);
if ( (v35[0] & 1) != 0 )
operator delete(v36);
*(_QWORD *)v37 = 0;
v38 = 0;
v39 = nullptr;
v26 = *(_QWORD *)(a1 + 12280);
if ( (v30 & 1) != 0 )
{
std::string::__init((__int64 *)v37, v32, v31);
}
else
{
v39 = v32;
*(_QWORD *)v37 = v30;
v38 = v31;
}
GJBaseGameLayer::getParticleKey2(v37, v40);
cocos2d::CCDictionary::setObject(v26, v22);
if ( (v40[0] & 1) != 0 )
operator delete((void *)v40[2]);
if ( (v37[0] & 1) != 0 )
operator delete(v39);
}
v14 = (char *)&v30 + 1;
v15 = *(_QWORD *)(a1 + 12280);
if ( (v30 & 1) != 0 )
v14 = (const char *)v32;
v28 = (char *)v14;
v41[0] = 0;
v41[1] = 0;
v42 = nullptr;
v16 = strlen(v14);
std::string::__init(v41, v28, v16);
v17 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v15, v41);
if ( (v41[0] & 1) != 0 )
operator delete(v42);
v19 = nullptr;
if ( (unsigned int)cocos2d::CCArray::count(v17) < *(_DWORD *)(a1 + 12272) )
{
v19 = (cocos2d::CCParticleSystem *)cocos2d::CCParticleSystemQuad::create(
(cocos2d::CCParticleSystemQuad *)a3,
(const char *)&dword_0 + 1,
v18);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, _QWORD))(*(_QWORD *)v19 + 72LL))(v19, a4);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, _QWORD))(*(_QWORD *)v19 + 1568LL))(v19, a5);
cocos2d::CCParticleSystem::stopSystem(v19);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, _QWORD))(*(_QWORD *)v19 + 344LL))(v19, 0);
cocos2d::CCArray::addObject(v17, v19);
}
if ( (v30 & 1) != 0 )
operator delete(v32);
return v19;
}