//
// GJBaseGameLayer::createCustomParticle from 0x1002a19bc to 0x1002a1bc4 (520 bytes)
//
// 3 xrefs:
// > ??> @ 0x1008df9e8
// > ??> @ 0x100919070
// > ??> @ 0x10094c598
//
// 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 11:02:13 +0000
//
_DWORD *__fastcall GJBaseGameLayer::createCustomParticle(__int64 a1, char *a2, unsigned int *a3, int a4, char a5)
{
char *v8; // x23
__int64 v10; // x20
__int64 v11; // x0
__int64 v12; // x20
std::string *v13; // x0
__int64 v14; // x25
char *v15; // x1
__int64 v16; // x0
__int64 v17; // x24
__int64 v18; // x25
char *v19; // x1
_DWORD *v20; // x21
float v21; // s0
__n128 v22; // q0
int v24; // [xsp+Ch] [xbp-64h] BYREF
void *__p[2]; // [xsp+10h] [xbp-60h] BYREF
char v26; // [xsp+27h] [xbp-49h]
v8 = a2;
v10 = *(_QWORD *)(a1 + 12288);
if ( a2[23] < 0 )
a2 = *(char **)a2;
sub_100009900(__p, a2);
v11 = cocos2d::CCDictionary::objectForKey(v10, __p);
v12 = v11;
if ( v26 < 0 )
{
operator delete(__p[0]);
if ( v12 )
goto LABEL_18;
}
else if ( v11 )
{
goto LABEL_18;
}
if ( (a5 & 1) == 0 )
{
v12 = sub_1002E736C(v11);
++*(_DWORD *)(a1 + 12268);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 72LL))(v12);
v24 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 64LL))(v12);
__p[0] = &v24;
v13 = (std::string *)sub_1000D9108(a1 + 12304, &v24, (__int64)&unk_100763014, (_DWORD **)__p);
std::string::operator=(v13 + 1, (const std::string *)v8);
v14 = *(_QWORD *)(a1 + 12288);
if ( v8[23] >= 0 )
v15 = v8;
else
v15 = *(char **)v8;
sub_100009900(__p, v15);
v16 = cocos2d::CCDictionary::setObject(v14, v12, __p);
if ( v26 < 0 )
operator delete(__p[0]);
v17 = *(_QWORD *)(a1 + 12344);
v18 = sub_1002E736C(v16);
if ( v8[23] >= 0 )
v19 = v8;
else
v19 = *(char **)v8;
sub_100009900(__p, v19);
cocos2d::CCDictionary::setObject(v17, v18, __p);
if ( v26 < 0 )
operator delete(__p[0]);
}
LABEL_18:
if ( a4 >= 1 && (unsigned int)sub_1002E757C(v12) >= a4 )
return nullptr;
v20 = (_DWORD *)GameToolbox::particleFromStruct(a3, 0, 1);
(*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v20 + 72LL))(v20, 0);
v21 = cocos2d::CCParticleSystem::stopSystem((__int64)v20);
(*(void (__fastcall **)(_DWORD *, _QWORD, float))(*(_QWORD *)v20 + 344LL))(v20, 0, v21);
if ( (a5 & 1) == 0 )
{
v22 = sub_1002E74E0(v12, v20);
v20[195] = (*(__int64 (__fastcall **)(__int64, __n128))(*(_QWORD *)v12 + 64LL))(v12, v22);
}
return v20;
}