//
// LevelEditorLayer::updateToggledGroups from 0x78c7f8 to 0x78c91c (292 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::updateGameObjects @ 0x79e774
// > ??> @ 0x8e468
//
// 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:53:27 +0000
//
__int64 __fastcall LevelEditorLayer::updateToggledGroups(LevelEditorLayer *this)
{
unsigned __int64 i; // x19
_BYTE *v3; // x1
__int64 result; // x0
__int64 v5; // x25
__int64 v6; // x20
int isGroupEnabled; // w26
__int64 v8; // x1
__int64 v9; // x0
__int64 v10; // x3
__int64 v11; // x20
unsigned int *v12; // x0
__int64 *v13; // x20
__int64 *j; // x25
for ( i = 0; i != 10000; ++i )
{
v3 = (_BYTE *)(*((_QWORD *)this + 1830) + i);
result = (unsigned __int8)*v3;
if ( *v3 )
{
v5 = *(_QWORD *)(*((_QWORD *)this + 452) + 8 * i);
if ( v5 )
{
v6 = 1LL << (i & 0x3F);
isGroupEnabled = (unsigned __int8)GJEffectManager::isGroupEnabled(*((GJEffectManager **)this + 269), i);
v8 = *((_QWORD *)this + 1813);
v9 = *(_QWORD *)(v8 + 8 * (i >> 6));
if ( ((v9 & v6) != 0) == isGroupEnabled )
{
v10 = v9 | v6;
v11 = v9 & ~v6;
if ( !isGroupEnabled )
v11 = v10;
*(_QWORD *)(v8 + 8 * (i >> 6)) = v11;
v12 = *(unsigned int **)(v5 + 56);
if ( *v12 )
{
v13 = *((__int64 **)v12 + 2);
for ( j = &v13[*v12 - 1]; j >= v13; ++v13 )
{
if ( !*v13 )
break;
if ( !*(_BYTE *)(*v13 + 1253) )
{
if ( isGroupEnabled )
GameObject::groupWasEnabled(*v13);
else
GameObject::groupWasDisabled(*v13);
}
}
}
}
v3 = (_BYTE *)(*((_QWORD *)this + 1830) + i);
LODWORD(result) = (unsigned __int8)*v3;
}
result = (unsigned int)(result - 1);
*v3 = result;
}
}
return result;
}