//
// SetupRandAdvTriggerPopup::removeGroupID from 0x10037a110 to 0x10037a28c (380 bytes)
//
// 1 xrefs:
// > SetupRandAdvTriggerPopup::callRemoveFromGroup @ 0x10037a407
//
// 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:29:05 +0000
//
void __fastcall SetupRandAdvTriggerPopup::removeGroupID(__int64 a1, unsigned __int64 a2)
{
int v2; // r14d
__int64 v3; // rbx
__int64 v4; // r13
_DWORD *v5; // r15
__int64 v6; // r12
__int64 v7; // rcx
size_t v8; // r12
unsigned int v9; // r15d
__int64 v10; // rax
_DWORD *v11; // r12
__int64 v12; // r13
__int64 v13; // rdx
size_t v14; // r13
__int64 v15; // rbx
v2 = a2;
v3 = a1;
*(_BYTE *)(a1 + 1012) = 1;
v4 = *(_QWORD *)(a1 + 680);
if ( v4 )
{
v5 = *(_DWORD **)(v4 + 1840);
v6 = *(_QWORD *)(v4 + 1848) - (_QWORD)v5;
if ( v6 )
{
v7 = (v6 >> 4 == 0) + (v6 >> 4);
v8 = v6 - 16;
while ( *v5 != (_DWORD)a2 )
{
v5 += 4;
v8 -= 16LL;
if ( !--v7 )
goto LABEL_21;
}
a2 = (unsigned __int64)(v5 + 4);
if ( v5 + 4 != *(_DWORD **)(v4 + 1848) )
memmove(v5, (const void *)a2, v8);
*(_QWORD *)(v4 + 1848) = (char *)v5 + v8;
}
}
else if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 688)) )
{
v9 = 0;
do
{
a2 = v9;
v10 = sub_1007FEFE0(*(_QWORD *)(v3 + 688), v9);
v11 = *(_DWORD **)(v10 + 1840);
v12 = *(_QWORD *)(v10 + 1848) - (_QWORD)v11;
if ( v12 )
{
v13 = (v12 >> 4 == 0) + (v12 >> 4);
v14 = v12 - 16;
while ( *v11 != v2 )
{
v11 += 4;
v14 -= 16LL;
if ( !--v13 )
goto LABEL_10;
}
a2 = (unsigned __int64)(v11 + 4);
if ( v11 + 4 != *(_DWORD **)(v10 + 1848) )
{
v15 = v10;
memmove(v11, (const void *)a2, v14);
v10 = v15;
v3 = a1;
}
*(_QWORD *)(v10 + 1848) = (char *)v11 + v14;
}
LABEL_10:
++v9;
}
while ( v9 < (unsigned int)sub_1007FEF90(*(_QWORD *)(v3 + 688)) );
}
LABEL_21:
SetupRandAdvTriggerPopup::updateGroupIDButtons(v3, a2);
}