//
// cocos2d::CCParticleSystem::resetSystem from 0x1001954ac to 0x1001955d4 (296 bytes)
//
// 68 xrefs:
// > GameToolbox::particleFromStruct @ 0x100047e74
// > PlayerObject::playDeathEffect @ 0x100057df8
// > PlayerObject::playDeathEffect @ 0x1000581c8
// > PlayerObject::playDeathEffect @ 0x1000585ec
// > PlayerObject::playDeathEffect @ 0x100058a3c
// > PlayerObject::playDeathEffect @ 0x100058e2c
// > PlayerObject::playDeathEffect @ 0x10005939c
// > PlayerObject::playDeathEffect @ 0x100059744
// > PlayerObject::playDeathEffect @ 0x100059c2c
// > PlayerObject::playDeathEffect @ 0x10005a078
// > PlayerObject::playDeathEffect @ 0x10005a44c
// > PlayerObject::playDeathEffect @ 0x10005a7b8
// > PlayerObject::playDeathEffect @ 0x10005aae4
// > PlayerObject::playDeathEffect @ 0x10005af2c
// > PlayerObject::playDeathEffect @ 0x10005b300
// > PlayerObject::playDeathEffect @ 0x10005b654
// > PlayerObject::playDeathEffect @ 0x10005ba74
// > PlayerObject::playDeathEffect @ 0x10005be88
// > PlayerObject::playDeathEffect @ 0x10005c024
// > PlayerObject::playDeathEffect @ 0x10005c378
// > PlayerObject::playCompleteEffect @ 0x10005d0f0
// > GJShopLayer::init @ 0x10014b2e0
// > GauntletSelectLayer::playUnlockAnimation @ 0x1001c01e4
// > GauntletSelectLayer::unlockAnimationStep2 @ 0x1001c0744
// > GauntletSelectLayer::unlockAnimationStep3 @ 0x1001c09b0
// > GauntletSelectLayer::unlockAnimationStep3 @ 0x1001c0b2c
// > GJChestSprite::switchToState @ 0x1001c72a4
// > GJChestSprite::switchToState @ 0x1001c7684
// > GJBaseGameLayer::playSpeedParticle @ 0x1002043b8
// > GJBaseGameLayer::claimCustomParticle @ 0x100204fb8
// > PlayerObject::removeAllParticles @ 0x100219588
// > PlayerObject::toggleVisibility @ 0x10021dbac
// > PlayerObject::resetAllParticles @ 0x10021dcb0
// > PlayerObject::hitGround @ 0x100223ad0
// > PlayerObject::playSpiderDashEffect @ 0x100225b28
// > PlayerObject::rotateGameplay @ 0x100226d6c
// > PlayerObject::toggleFlyMode @ 0x100229838
// > PlayerObject::toggleFlyMode @ 0x100229840
// > PlayerObject::toggleBirdMode @ 0x100229fdc
// > PlayerObject::toggleSwingMode @ 0x10022a390
// > PlayerObject::toggleSwingMode @ 0x10022a398
// > PlayerObject::toggleSwingMode @ 0x10022a440
// > PlayerObject::toggleSwingMode @ 0x10022a448
// > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x100254000
// > GameObject::setVisible @ 0x10025bd2c
// > CreateParticlePopup::onDurationForever @ 0x1002cf8e0
// > CreateParticlePopup::onMaxEmission @ 0x1002cf928
// > CreateParticlePopup::onCalcEmission @ 0x1002cf9c4
// > CreateParticlePopup::update @ 0x1002d07c0
// > GJDifficultySprite::updateFeatureState @ 0x1002e5b90
// > CurrencyRewardLayer::init @ 0x10031ee28
// > CurrencyRewardLayer::init @ 0x10031f210
// > CurrencyRewardLayer::init @ 0x10031f5fc
// > CurrencyRewardLayer::init @ 0x10031f994
// > CurrencyRewardLayer::createObjectsFull @ 0x100320e98
// > LevelEditorLayer::claimCustomParticle @ 0x1003641ac
// > ParticleGameObject::resetObject @ 0x100381df0
// > ParticleGameObject::updateSyncedAnimation @ 0x100381e50
// > ParticleGameObject::updateSyncedAnimation @ 0x100381f28
// > ParticleGameObject::updateAnimateOnTrigger @ 0x100381f80
// > MenuGameLayer::destroyPlayer @ 0x10039b78c
// > GJPathPage::playUnlockAnimation @ 0x1003ba638
// > GJPathPage::unlockAnimationStep2 @ 0x1003bad7c
// > GJPathPage::unlockAnimationStep3 @ 0x1003bb0fc
// > GJPathPage::unlockAnimationStep3 @ 0x1003bb1e8
// > LevelPage::updateDynamicPage @ 0x10040291c
// > LevelPage::updateDynamicPage @ 0x1004029c4
// > LevelPage::updateDynamicPage @ 0x100402a6c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCParticleSystem::resetSystem(cocos2d::CCParticleSystem *a1)
{
__int64 m_uParticleCount; // x8
cocos2d::tCCParticle *m_pParticles; // x9
__int64 v4; // x10
__n128 v5; // q0
__n128 v6; // q1
uint64x2_t v7; // q2
int64x2_t v8; // q3
int16x4_t v9; // d4
cocos2d::CCParticleBatchNode *m_pBatchNode; // x0
int v11; // w21
a1->m_bIsActive = 1;
a1->m_bWasRemoved = 0;
a1->m_fElapsed = 0.0;
m_uParticleCount = a1->m_uParticleCount;
if ( (_DWORD)m_uParticleCount )
{
m_pParticles = a1->m_pParticles;
v4 = (m_uParticleCount + 3) & 0x1FFFFFFFCLL;
v5 = (__n128)xmmword_100635BC0;
v6 = (__n128)xmmword_100635BD0;
v7 = (uint64x2_t)vdupq_n_s64(m_uParticleCount - 1);
v8 = vdupq_n_s64(4u);
do
{
v9 = (int16x4_t)vmovn_s64((int64x2_t)vcgeq_u64(v7, (uint64x2_t)v6));
if ( (vuzp1_s16(v9, (int16x4_t)v5.n128_u64[0]).u8[0] & 1) != 0 )
m_pParticles->timeToLive = 0.0;
if ( (vuzp1_s16(v9, (int16x4_t)v5.n128_u64[0]).i8[2] & 1) != 0 )
m_pParticles[2].pos.y = 0.0;
if ( (vuzp1_s16((int16x4_t)v5.n128_u64[0], (int16x4_t)vmovn_s64((int64x2_t)vcgeq_u64(v7, (uint64x2_t)v5))).i32[1]
& 1) != 0 )
{
m_pParticles[3].size = 0.0;
m_pParticles[4].modeB.degreesPerSecond = 0.0;
}
v5 = (__n128)vaddq_s64((int64x2_t)v5, v8);
v6 = (__n128)vaddq_s64((int64x2_t)v6, v8);
m_pParticles = (cocos2d::tCCParticle *)((char *)m_pParticles + 592);
v4 -= 4;
}
while ( v4 );
a1->m_uParticleIdx = m_uParticleCount;
do
{
a1->m_uParticleIdx = m_uParticleCount - 1;
m_pBatchNode = a1->m_pBatchNode;
if ( m_pBatchNode )
{
v11 = *((_DWORD *)&a1->m_pParticles->modeA.dir.x + 37 * (unsigned int)(m_uParticleCount - 1));
sub_1002512D4(m_pBatchNode, a1->m_uAtlasIndex + v11, v5, v6);
LODWORD(m_uParticleCount) = a1->m_uParticleCount;
*((_DWORD *)&a1->m_pParticles->modeA.dir.x + 37 * (unsigned int)(m_uParticleCount - 1)) = v11;
}
LODWORD(m_uParticleCount) = m_uParticleCount - 1;
a1->m_uParticleCount = m_uParticleCount;
}
while ( (_DWORD)m_uParticleCount );
}
else
{
a1->m_uParticleIdx = 0;
}
a1->m_bVisible = 0;
}