//
// SetupRandAdvTriggerPopup::removeGroupIDFromObject from 0x9ae8dc to 0x9ae97c (160 bytes)
//
// 3 xrefs:
// > SetupRandAdvTriggerPopup::removeGroupID @ 0x9b0720
// > SetupRandAdvTriggerPopup::removeGroupID @ 0x9b0754
// > ??> @ 0x6e328
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void SetupRandAdvTriggerPopup::removeGroupIDFromObject(SetupRandAdvTriggerPopup *a1, RandTriggerGameObject *a2, int a3)
{
ChanceObject *m_start; // x0
ChanceObject *m_finish; // x7
__int64 v6; // x6
ChanceObject *v7; // x0
__int64 v8; // x6
__int64 v9; // x3
bool v10; // zf
ChanceObject *v11; // x4
ChanceObject *v12; // x2
__int64 v13; // x0
ChanceObject *v14; // x4
__int64 v15; // x0
__int64 v16; // x1
m_start = a2->m_chanceObjects.m_start;
m_finish = a2->m_chanceObjects.m_finish;
v6 = m_finish - m_start;
if ( v6 )
{
if ( m_start->m_groupID == a3 )
{
v11 = a2->m_chanceObjects.m_start;
LABEL_9:
v12 = v11 + 1;
if ( &v11[1] != m_finish )
{
v13 = m_finish - v12;
if ( v13 > 0 )
{
v14 = &v11[v13 + 1];
do
{
v15 = *(_QWORD *)&v12->m_groupID;
v16 = *(_QWORD *)&v12->m_chance;
++v12;
*(_QWORD *)&v12[-2].m_groupID = v15;
*(_QWORD *)&v12[-2].m_chance = v16;
}
while ( v12 != v14 );
}
}
a2->m_chanceObjects.m_finish = m_finish - 1;
}
else
{
v7 = m_start + 1;
v8 = v6 - 1;
v9 = 0;
while ( 1 )
{
v10 = v9 == v8;
v11 = v7;
++v9;
++v7;
if ( v10 )
break;
if ( v11->m_groupID == a3 )
goto LABEL_9;
}
}
}
}