//
// SetGroupIDLayer::onAddGroupParent from 0x1403fcc00 to 0x1403fccf7 (247 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::init @ 0x1403f94b3
// > ??> @ 0x1406d84ec
//
// 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
//
// Hidden C++ exception states: #wind=2
void SetGroupIDLayer::onAddGroupParent(SetGroupIDLayer *a1, cocos2d::CCObject *a2)
{
GameObject *m_targetObject; // rcx
int v4; // eax
__int64 v5; // rcx
__int64 v6; // rcx
void *v7; // [rsp+30h] [rbp+8h]
void *v8; // [rsp+30h] [rbp+8h]
m_targetObject = a1->m_targetObject;
if ( m_targetObject )
{
v4 = m_targetObject->addToGroup(m_targetObject, a1->m_groupIDValue);
if ( v4 == 1 )
{
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v7 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
(*(void (__fastcall **)(_QWORD, GameObject *, _QWORD, _QWORD))(**(_QWORD **)(v5 + 528) + 1152LL))(
*(_QWORD *)(v5 + 528),
a1->m_targetObject,
(unsigned int)a1->m_groupIDValue,
0);
}
else if ( !v4 )
{
LABEL_10:
SetGroupIDLayer::updateGroupIDButtons(a1);
return;
}
v6 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v8 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
GJBaseGameLayer::setGroupParent(*(GJBaseGameLayer **)(v6 + 528), a1->m_targetObject, a1->m_groupIDValue);
goto LABEL_10;
}
}