//
// GJEffectManager::reset from 0x1403653a0 to 0x1403655c1 (545 bytes)
//
// 6 xrefs:
// > GJEffectManager::loadFromState @ 0x14036ebdc
// > LevelEditorLayer::updateGameObjects @ 0x1403faada
// > LevelEditorLayer::onPlaytest @ 0x1403fea1a
// > LevelEditorLayer::onStopPlaytest @ 0x1404004fe
// > PlayLayer::loadDefaultColors @ 0x140510798
// > ??> @ 0x1409215f0
//
// This function is hookable on this platform (idp: pc, 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:30:54 +0000
//
__int64 __fastcall GJEffectManager::reset(__int64 a1)
{
_QWORD *v2; // rdx
_QWORD *v3; // rax
__int64 i; // rcx
__int64 v5; // rcx
char *v6; // rdx
char *v7; // rcx
__int64 j; // rcx
__int64 v9; // rcx
__int64 v10; // rcx
__int64 k; // rdx
__int64 v12; // rcx
__int64 v13; // rsi
__int64 v14; // rbx
__int64 result; // rax
sub_14003EB60((_QWORD *)(a1 + 672));
cocos2d::CCDictionary::removeAllObjects(*(cocos2d::CCDictionary **)(a1 + 632));
cocos2d::CCDictionary::removeAllObjects(*(cocos2d::CCDictionary **)(a1 + 640));
cocos2d::CCDictionary::removeAllObjects(*(cocos2d::CCDictionary **)(a1 + 328));
v2 = (_QWORD *)(a1 + 736);
v3 = *(_QWORD **)(a1 + 736);
if ( (unsigned __int64)v3 > a1 + 736 || v3 + 1101 < v2 )
{
v5 = 137;
do
{
*v3 = 0;
v3[1] = 0;
v3[2] = 0;
v3 += 8;
*(v3 - 5) = 0;
*(v3 - 4) = 0;
*(v3 - 3) = 0;
*(v3 - 2) = 0;
*(v3 - 1) = 0;
--v5;
}
while ( v5 );
*v3 = 0;
v3[1] = 0;
v3[2] = 0;
v3[3] = 0;
v3[4] = 0;
v3[5] = 0;
}
else
{
for ( i = 0; i <= 8808; i += 8 )
*(_QWORD *)(i + *v2) = 0;
}
v6 = (char *)(a1 + 648);
v7 = *(char **)(a1 + 648);
if ( (unsigned __int64)v7 > a1 + 648 || v7 + 79992 < v6 )
{
memset(v7, 0, 0x13880u);
}
else
{
for ( j = 0; j <= 79992; j += 8 )
*(_QWORD *)(j + *(_QWORD *)v6) = 0;
}
v9 = *(_QWORD *)(a1 + 336);
if ( v9 )
{
v10 = *(_QWORD *)(v9 + 56);
if ( v10 )
{
for ( k = *(_QWORD *)(v10 + 288); ; k = *(_QWORD *)(k + 288) )
{
v12 = *(_QWORD *)(v10 + 264);
*(_WORD *)(v12 + 324) = -1;
*(_BYTE *)(v12 + 326) = -1;
*(_WORD *)(v12 + 327) = -1;
*(_BYTE *)(v12 + 329) = -1;
*(_DWORD *)(v12 + 320) = 1132396544;
*(_QWORD *)(v12 + 344) = 0;
v10 = k;
if ( !k )
break;
}
}
}
GJEffectManager::resetEffects(a1);
v13 = *(_QWORD *)(a1 + 1560);
v14 = *(_QWORD *)(a1 + 1552);
if ( v14 != v13 )
{
do
{
sub_140069730(v14 + 488);
sub_1403620A0(v14 + 440);
v14 += 520;
}
while ( v14 != v13 );
*(_QWORD *)(a1 + 1560) = *(_QWORD *)(a1 + 1552);
}
sub_14036FB50(a1 + 1576);
sub_140066610((_QWORD *)(a1 + 1752));
result = *(_QWORD *)(a1 + 1944);
if ( result != *(_QWORD *)(a1 + 1952) )
*(_QWORD *)(a1 + 1952) = result;
return result;
}