//
// GameObject::addToGroup from 0x76fc58 to 0x76fd20 (200 bytes)
//
// 50 xrefs:
// > TeleportPortalObject::addToGroup2 @ 0x86fed8
// > TeleportPortalObject::addToGroup @ 0x870304
// > ??> @ 0x504a0
// > ??> @ 0x14338e0
// > ??> @ 0x14346d0
// > ??> @ 0x1434eb0
// > ??> @ 0x14356c0
// > ??> @ 0x1443a20
// > ??> @ 0x1444230
// > ??> @ 0x1444a40
// > ??> @ 0x1445250
// > ??> @ 0x1445a60
// > ??> @ 0x1446270
// > ??> @ 0x1446a80
// > ??> @ 0x1447290
// > ??> @ 0x1447a70
// > ??> @ 0x1448280
// > ??> @ 0x1448a90
// > ??> @ 0x14492a0
// > ??> @ 0x1449ab0
// > ??> @ 0x144a300
// > ??> @ 0x144ab10
// > ??> @ 0x144b320
// > ??> @ 0x144bb30
// > ??> @ 0x144cb60
// > ??> @ 0x144d370
// > ??> @ 0x144db80
// > ??> @ 0x144e390
// > ??> @ 0x144eba0
// > ??> @ 0x144f3b0
// > ??> @ 0x144fbc0
// > ??> @ 0x14503d0
// > ??> @ 0x1450be0
// > ??> @ 0x14513f0
// > ??> @ 0x1451c00
// > ??> @ 0x1452410
// > ??> @ 0x1452c20
// > ??> @ 0x1453430
// > ??> @ 0x1453c40
// > ??> @ 0x1454450
// > ??> @ 0x1454c60
// > ??> @ 0x1455470
// > ??> @ 0x1455c80
// > ??> @ 0x1456490
// > ??> @ 0x1456ca0
// > ??> @ 0x14574b0
// > ??> @ 0x1457cc0
// > ??> @ 0x14584d0
// > ??> @ 0x1458ce0
// > ??> @ 0x1459510
//
// 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:12 +0000
//
__int64 __fastcall GameObject::addToGroup(GameObject *this, int a2)
{
int v5; // w4
__int16 *v6; // x3
__int16 *i; // x0
int v8; // t1
if ( *((__int16 *)this + 584) > 9 || (unsigned int)(a2 - 1) > 0x270E )
return 0;
GameObject::createGroupContainer((__int64)this, 10);
v5 = *((__int16 *)this + 584);
v6 = *((__int16 **)this + 145);
if ( v5 <= 0 )
goto LABEL_9;
if ( a2 != *v6 )
{
for ( i = v6 + 1; i != &v6[v5 - 1 + 1]; ++i )
{
v8 = *i;
if ( a2 == v8 )
return 0xFFFFFFFFLL;
}
LABEL_9:
v6[(__int16)(*((_WORD *)this + 584))++] = a2;
return 1;
}
return 0xFFFFFFFFLL;
}