//
// GJBaseGameLayer::moveObjectToStaticGroup from 0x10014a660 to 0x10014a7a6 (326 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::optimizeMoveGroups @ 0x100118048
//
// 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 __fastcall GJBaseGameLayer::moveObjectToStaticGroup(GJBaseGameLayer *a1, GameObject *a2)
{
GJBaseGameLayer *v3; // r14
unsigned int i; // r15d
cocos2d::CCDictionary *m_staticGroupDict; // rdi
cocos2d::CCObject *v6; // rsi
int GroupID; // eax
intptr_t v8; // r13
cocos2d::CCObject *v9; // r12
cocos2d::CCArray *v10; // r14
if ( a2->m_isDecoration2 )
{
a2->m_isDecoration2 = 0;
if ( a2->m_groupCount > 0 )
{
v3 = a1;
for ( i = 0; (int)i < a2->m_groupCount; ++i )
{
m_staticGroupDict = (cocos2d::CCDictionary *)a2;
v6 = (cocos2d::CCObject *)i;
GroupID = GameObject::getGroupID(a2, i);
v8 = (unsigned int)GroupID;
if ( GroupID >= 9999 )
v8 = 9999;
if ( (int)v8 <= 0 )
v8 = 0;
v9 = v3->m_staticGroups.__begin_[v8];
if ( v9 )
{
v10 = v3->m_optimizedGroups.__begin_[v8];
if ( !v10 )
goto LABEL_14;
}
else
{
v9 = (cocos2d::CCObject *)sub_10071F9E0(a2, i);
m_staticGroupDict = v3->m_staticGroupDict;
v6 = v9;
cocos2d::CCDictionary::setObject(m_staticGroupDict, v9, v8);
v3->m_staticGroups.__begin_[v8] = (cocos2d::CCArray *)v9;
v10 = v3->m_optimizedGroups.__begin_[v8];
if ( !v10 )
{
LABEL_14:
v10 = (cocos2d::CCArray *)sub_10071F9E0(m_staticGroupDict, v6);
cocos2d::CCDictionary::setObject(a1->m_optimizedGroupDict, v10, v8);
a1->m_optimizedGroups.__begin_[v8] = v10;
}
}
if ( !(unsigned __int8)sub_100720160(v9, a2) )
sub_10071FCD0(v9, a2);
sub_100720220(v10, a2, 1);
v3 = a1;
}
}
}
}