//
// SetGroupIDLayer::onAddGroupParent from 0x140593310 to 0x140593475 (357 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::init @ 0x14058f4a8
// > ??> @ 0x14092ce70
//
// 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:32 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall SetGroupIDLayer::onAddGroupParent(__int64 a1)
{
__int64 v2; // r10
int v3; // r9d
__int64 v4; // rdx
__int16 *v5; // rcx
int v6; // eax
__int64 v7; // rcx
__int64 v8; // rcx
__int64 v9; // rax
void (__fastcall *v10)(__int64); // rdx
void *v11; // [rsp+30h] [rbp+8h]
void *v12; // [rsp+30h] [rbp+8h]
v2 = *(_QWORD *)(a1 + 672);
if ( v2 )
{
if ( *(__int16 *)(v2 + 1176) <= 0 )
{
LABEL_6:
v6 = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v2 + 1448LL))(v2, *(unsigned int *)(a1 + 764));
if ( v6 == 1 )
{
v7 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v11 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v7 = qword_14090BFD0;
}
(*(void (__fastcall **)(_QWORD, _QWORD, _QWORD, _QWORD))(**(_QWORD **)(v7 + 568) + 1200LL))(
*(_QWORD *)(v7 + 568),
*(_QWORD *)(a1 + 672),
*(unsigned int *)(a1 + 764),
0);
}
else if ( !v6 )
{
LABEL_16:
SetGroupIDLayer::updateGroupIDButtons(a1);
return;
}
v8 = qword_14090BFD0;
if ( qword_14090BFD0 )
{
LABEL_15:
GJBaseGameLayer::promoteGroupParent(
*(_QWORD *)(v8 + 568),
*(cocos2d::CCObject **)(a1 + 672),
*(_DWORD *)(a1 + 764));
goto LABEL_16;
}
}
else
{
v3 = *(_DWORD *)(a1 + 764);
v4 = 0;
v5 = *(__int16 **)(v2 + 1168);
while ( *v5 != v3 )
{
++v4;
++v5;
if ( v4 >= *(__int16 *)(v2 + 1176) )
goto LABEL_6;
}
v8 = qword_14090BFD0;
if ( qword_14090BFD0 )
goto LABEL_15;
}
v12 = operator new(0x6E8u);
v9 = GameManager::GameManager((__int64)v12);
v10 = *(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 72LL);
qword_14090BFD0 = v9;
v10(v9);
v8 = qword_14090BFD0;
goto LABEL_15;
}
}