//
// GJBaseGameLayer::toggleGroup from 0x100119f40 to 0x10011a067 (295 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::toggleGroupTriggered @ 0x100119ef0
// > sub_10011A070 @ 0x10011a09a
// > EffectGameObject::triggerObject @ 0x10019a17f
//
// 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 12:24:35 +0000
//
__int64 __fastcall GJBaseGameLayer::toggleGroup(_QWORD *a1, __int64 a2, unsigned __int8 a3)
{
__int64 v5; // rdi
__int64 result; // rax
int v7; // eax
__int64 v8; // r13
__int64 v9; // r12
unsigned int *v10; // rax
_QWORD *v11; // r12
unsigned __int64 v12; // r13
unsigned int *v13; // rax
_QWORD *v14; // r12
unsigned __int64 v15; // r13
v5 = a1[269];
result = GJEffectManager::isGroupEnabled(v5, a2);
if ( (_BYTE)result != a3 )
{
v7 = 9999;
if ( (int)a2 < 9999 )
v7 = a2;
v8 = 0;
if ( v7 > 0 )
v8 = (unsigned int)v7;
v9 = *(_QWORD *)(a1[452] + 8 * v8);
if ( v9 )
{
if ( a3 )
{
LABEL_8:
if ( v9 )
{
v10 = *(unsigned int **)(v9 + 56);
if ( *v10 )
{
v11 = *((_QWORD **)v10 + 2);
v12 = (unsigned __int64)&v11[*v10 - 1];
do
{
if ( !*v11 )
break;
GameObject::groupWasEnabled(*v11++);
}
while ( (unsigned __int64)v11 <= v12 );
}
}
return GJEffectManager::toggleGroup(a1[269], (unsigned int)a2, a3);
}
}
else
{
v9 = sub_1007FE900(v5);
cocos2d::CCDictionary::setObject_1(a1[449], v9, v8);
*(_QWORD *)(a1[452] + 8 * v8) = v9;
if ( a3 )
goto LABEL_8;
}
if ( v9 )
{
v13 = *(unsigned int **)(v9 + 56);
if ( *v13 )
{
v14 = *((_QWORD **)v13 + 2);
v15 = (unsigned __int64)&v14[*v13 - 1];
do
{
if ( !*v14 )
break;
GameObject::groupWasDisabled(*v14++);
}
while ( (unsigned __int64)v14 <= v15 );
}
}
return GJEffectManager::toggleGroup(a1[269], (unsigned int)a2, a3);
}
return result;
}