//
// LevelEditorLayer::validGroup from 0x4603bc to 0x460448 (140 bytes)
//
// 10 xrefs:
// > LevelEditorLayer::typeExistsAtPosition @ 0x4605d4
// > LevelEditorLayer::objectAtPosition @ 0x4608a0
// > LevelEditorLayer::objectsAtPosition @ 0x460aae
// > LevelEditorLayer::addObjectsAtPosition @ 0x460b68
// > LevelEditorLayer::objectsInRect @ 0x460ed0
// > LevelEditorLayer::addObjectsInRect @ 0x4610a4
// > LevelEditorLayer::updateVisibility @ 0x462e76
// > LevelEditorLayer::updateDebugDraw @ 0x47ff9c
// > EditorUI::selectAll @ 0x6f4a04
// > EditorUI::selectAllWithDirection @ 0x6f4ac0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:52 +0000
//
bool __fastcall LevelEditorLayer::validGroup(LevelEditorLayer *this, GameObject *a2, int a3)
{
int v4; // r3
int v5; // r5
int v6; // r0
_BOOL4 result; // r0
int v8; // r2
int v9; // r1
v4 = *((__int16 *)a2 + 520);
v5 = *((__int16 *)a2 + 519);
v6 = *((__int16 *)this + 5913);
if ( !*((_WORD *)a2 + 520) )
v4 = -1;
result = v6 == -1 || v6 == v5 || v6 == v4;
if ( a3 )
{
if ( v4 < 0 )
{
v4 = -1;
}
else if ( v4 >= 9999 )
{
v4 = 9999;
}
if ( result )
{
v8 = 9999;
result = 1;
if ( v5 <= 9999 )
v8 = *((__int16 *)a2 + 519);
v9 = *((_DWORD *)this + 3000);
if ( ((1 << (v8 & ~(v8 >> 31) & 0x1F)) & *(_DWORD *)(v9 + 4 * ((v8 & (unsigned int)~(v8 >> 31)) >> 5))) != 0 )
{
return 0;
}
else if ( v4 != -1 )
{
return ((1 << (v4 & 0x1F)) & *(_DWORD *)(v9 + 4 * ((unsigned int)v4 >> 5))) == 0;
}
}
}
return result;
}