//
// GJBaseGameLayer::claimParticle from 0x59cb48 to 0x59cc7e (310 bytes)
//
// 2 xrefs:
// > GameObject::claimParticle @ 0x452d48
// > GameObject::claimParticle @ 0x452d86
//
// 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 11:53:13 +0000
//
cocos2d::CCObject *__fastcall GJBaseGameLayer::claimParticle(int a1, int a2)
{
int v4; // r7
const char *v5; // r4
size_t v6; // r0
cocos2d::CCArray *v7; // r7
cocos2d::CCObject *Object; // r0
int v10; // r11
cocos2d::CCObject *v11; // r4
cocos2d::CCArray *v12; // r9
int v13; // r5
int v14; // r3
void (__fastcall *v15)(int, cocos2d::CCObject *, int); // r7
int v16; // r0
int v17[3]; // [sp+4h] [bp-20h] BYREF
int v18[3]; // [sp+10h] [bp-14h] BYREF
memset(v18, 0, sizeof(v18));
v4 = *(_DWORD *)(a1 + 10644);
if ( (*(_BYTE *)a2 & 1) != 0 )
v5 = *(const char **)(a2 + 8);
else
v5 = (const char *)(a2 + 1);
v6 = strlen(v5);
std::string::__init(v18, v5, v6);
v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v4, v18);
std::string::~string((int)v18);
if ( !v7 || !cocos2d::CCArray::count(v7) )
return nullptr;
Object = (cocos2d::CCObject *)cocos2d::CCArray::lastObject(v7);
v10 = *(_DWORD *)(a1 + 10644);
v11 = Object;
std::string::basic_string(v17, a2);
GJBaseGameLayer::getParticleKey2(v18, a1, (int)v17);
v12 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v10, v18);
std::string::~string((int)v18);
std::string::~string((int)v17);
cocos2d::CCArray::addObject(v12, v11);
cocos2d::CCArray::removeLastObject(v7, 1);
if ( !(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v11 + 256))(v11) )
{
v13 = *(_DWORD *)(a1 + 2436);
v14 = *(_DWORD *)(a1 + 10712);
if ( v14 && *(_BYTE *)(v14 + 950) && (unsigned int)(*(_DWORD *)(v14 + 940) - 2) <= 5 )
v13 = *(_DWORD *)(a1 + 2440);
v15 = *(void (__fastcall **)(int, cocos2d::CCObject *, int))(*(_DWORD *)v13 + 232);
v16 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)v11 + 32))(v11);
v15(v13, v11, v16);
}
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 10680), v11);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v11 + 172))(v11, 1);
return v11;
}