//
// SetupRandAdvTriggerPopup::callRemoveFromGroup from 0x1405d43e0 to 0x1405d4544 (356 bytes)
//
// 5 xrefs:
// > SetupRandAdvTriggerPopup::callRemoveFromGroup @ 0x1405d43ef
// > SetupRandAdvTriggerPopup::onRemoveFromGroup @ 0x1405d45fa
// > ??> @ 0x1408e12a0
// > ??> @ 0x1408e12b0
// > ??> @ 0x14092e8e0
//
// 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 11:34:56 +0000
//
void __fastcall SetupRandAdvTriggerPopup::callRemoveFromGroup(__int64 a1)
{
__int64 v2; // rdi
int v3; // ebx
__int64 v4; // r9
int v5; // edx
unsigned __int64 v6; // r8
_DWORD *v7; // rcx
struct cocos2d::CCObject *v8; // rax
int v9; // edx
struct cocos2d::CCObject *v10; // rbp
__int64 v11; // r9
unsigned __int64 v12; // r8
_DWORD *v13; // rcx
cocos2d::CCNode::unschedule(a1, SetupRandAdvTriggerPopup::callRemoveFromGroup);
v2 = *(_QWORD *)(a1 + 680);
v3 = *(_DWORD *)(a1 + 1032);
*(_BYTE *)(a1 + 1036) = 0;
*(_BYTE *)(a1 + 1000) = 1;
if ( v2 )
{
v4 = *(_QWORD *)(v2 + 1856);
v5 = 0;
v6 = (*(_QWORD *)(v2 + 1864) - v4) >> 4;
if ( v6 )
{
v7 = *(_DWORD **)(v2 + 1856);
while ( *v7 != v3 )
{
++v5;
v7 += 4;
if ( v5 >= v6 )
goto LABEL_16;
}
memmove(
(void *)(v4 + 16LL * v5),
(const void *)(v4 + 16LL * v5 + 16),
*(_QWORD *)(v2 + 1864) - (v4 + 16LL * v5 + 16));
*(_QWORD *)(v2 + 1864) -= 16LL;
}
}
else if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 688)) )
{
do
{
v8 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 688), v2);
v9 = 0;
v10 = v8;
v11 = *((_QWORD *)v8 + 232);
v12 = (*((_QWORD *)v8 + 233) - v11) >> 4;
if ( v12 )
{
v13 = *((_DWORD **)v8 + 232);
while ( *v13 != v3 )
{
++v9;
v13 += 4;
if ( v9 >= v12 )
goto LABEL_15;
}
memmove(
(void *)(v11 + 16LL * v9),
(const void *)(v11 + 16LL * v9 + 16),
*((_QWORD *)v8 + 233) - (v11 + 16LL * v9 + 16));
*((_QWORD *)v10 + 233) -= 16LL;
}
LABEL_15:
LODWORD(v2) = v2 + 1;
}
while ( (unsigned int)v2 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 688)) );
}
LABEL_16:
SetupRandAdvTriggerPopup::updateGroupIDButtons(a1);
*(_DWORD *)(a1 + 1032) = 0;
}