//
// GJBaseGameLayer::updateParticles from 0x9df548 to 0x9df87c (820 bytes)
//
// 3 xrefs:
// > PlayLayer::updateVisibility @ 0x701698
// > LevelEditorLayer::updateVisibility @ 0x78e710
// > ??> @ 0x93730
//
// 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:58:54 +0000
//
__int64 __fastcall GJBaseGameLayer::updateParticles(GJBaseGameLayer *this, float a2)
{
__int64 v3; // x1
unsigned int v4; // w21
__int64 *v6; // x22
double v7; // d9
float v8; // s11
float v9; // s11
__int64 v10; // x0
cocos2d::CCParticleSystem *v11; // x19
int v12; // w1
unsigned int v13; // w19
int *v14; // x21
__int64 v16; // x0
__int64 v17; // x1
cocos2d::CCArray *v18; // x0
__int64 v19; // x25
double v20; // d0
float v21; // s0
float v22; // s8
__int64 v23; // x0
float v24; // s10
float v25; // s0
float v26; // s10
int v27; // [xsp+7Ch] [xbp+7Ch] BYREF
__int64 v28; // [xsp+80h] [xbp+80h] BYREF
__int64 v29; // [xsp+88h] [xbp+88h]
void *v30; // [xsp+90h] [xbp+90h]
v3 = *((_QWORD *)this + 490);
v4 = 0;
*((_DWORD *)this + 3064) = 0;
v6 = (__int64 *)((char *)this + 12360);
v7 = 0.0;
v8 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v3 + 136LL))(v3);
v9 = fabsf(v8 * (*(float (__fastcall **)(_QWORD))(**((_QWORD **)this + 490) + 152LL))(*((_QWORD *)this + 490)));
while ( v4 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1544)) )
{
while ( 1 )
{
v10 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 1544), v4);
v11 = (cocos2d::CCParticleSystem *)v10;
if ( !*(_BYTE *)(v10 + 556) )
break;
v27 = *(_DWORD *)(v10 + 8);
std::__hash_table,std::equal_to,std::allocator>::__erase_unique(v6, &v27);
cocos2d::CCArray::fastRemoveObjectAtIndex(*((cocos2d::CCArray **)this + 1544), v4);
if ( v4 >= (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1544)) )
goto LABEL_5;
}
*((_DWORD *)this + 3064) += (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 1496LL))(v10);
(*(void (__fastcall **)(cocos2d::CCParticleSystem *, float))(*(_QWORD *)v11 + 40LL))(v11, a2);
v19 = *((_QWORD *)this + 1664);
if ( !*((_BYTE *)v11 + 834)
|| (cocos2d::CCParticleSystem::getParticleDrawCost(v11), v22 = v21, v21 <= 0.0)
|| ((v23 = (*(__int64 (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)v11 + 512LL))(v11)) != 0
&& v19 == (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v23 + 512LL))(v23)
? (v26 = (*(float (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)v11 + 136LL))(v11),
v25 = fabsf(v26 * (*(float (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)v11 + 152LL))(v11)))
: (v24 = (*(float (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)v11 + 136LL))(v11),
v25 = v9 * fabsf(v24 * (*(float (__fastcall **)(cocos2d::CCParticleSystem *))(*(_QWORD *)v11 + 152LL))(v11))),
v20 = v22 * v25,
v20 <= 0.0) )
{
v20 = 0.0;
}
v7 = v7 + v20;
++v4;
}
LABEL_5:
v12 = 0x7FFFFFFF;
*((_BYTE *)this + 12260) = v7 > 20000000.0;
if ( v7 <= 2147483650.0 )
v12 = (int)v7;
*((_DWORD *)this + 3066) = v12;
v13 = 0;
while ( v13 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1537)) )
{
while ( 1 )
{
v14 = (int *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 1537), v13);
if ( !(*(unsigned int (__fastcall **)(int *))(*(_QWORD *)v14 + 912LL))(v14) )
break;
if ( ++v13 >= (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1537)) )
return _stack_chk_guard;
}
v16 = std::unordered_map::operator[]((__int64)this + 12304, v14 + 195);
v28 = 0;
v29 = 0;
v30 = nullptr;
if ( (*(_BYTE *)v16 & 1) != 0 )
{
std::string::__init(&v28, *(void **)(v16 + 16), *(_QWORD *)(v16 + 8));
}
else
{
v17 = *(_QWORD *)(v16 + 8);
v28 = *(_QWORD *)v16;
v29 = v17;
v30 = *(void **)(v16 + 16);
}
v18 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 1536), &v28);
if ( v18 )
cocos2d::CCArray::addObject(v18, (cocos2d::CCObject *)v14);
cocos2d::CCArray::fastRemoveObjectAtIndex(*((cocos2d::CCArray **)this + 1537), v13);
if ( (v28 & 1) != 0 )
operator delete(v30);
}
return _stack_chk_guard;
}