//
// GameObject::removeFromGroup from 0x44b510 to 0x44b55e (78 bytes)
//
// 2 xrefs:
// > TeleportPortalObject::removeFromGroup2 @ 0x4e6516
// > TeleportPortalObject::removeFromGroup @ 0x4e6b50
//
// 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:34 +0000
//
int __fastcall GameObject::removeFromGroup(int this, int a2)
{
int v2; // r3
int v3; // r5
int v4; // r4
__int16 v5; // r2
int v6; // r2
v2 = 0;
v3 = 0;
v4 = 0;
while ( 1 )
{
v5 = *(_WORD *)(this + 1020);
if ( v3 >= v5 )
break;
v6 = *(_DWORD *)(this + 1016);
if ( v4 )
{
*(_WORD *)(v6 + v2 - 2) = *(_WORD *)(v6 + v2);
if ( v3 == *(__int16 *)(this + 1020) - 1 )
*(_WORD *)(*(_DWORD *)(this + 1016) + v2) = 0;
}
else if ( *(__int16 *)(v6 + v2) == a2 )
{
*(_WORD *)(v6 + v2) = 0;
v4 = 1;
}
++v3;
v2 += 2;
}
if ( v4 )
*(_WORD *)(this + 1020) = v5 - 1;
return this;
}