//
// GJBaseGameLayer::removeFromGroupParents from 0x9c3d00 to 0x9c4278 (1400 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::removeSpecial @ 0x79071c
// > ??> @ 0xf1900
//
// This function is hookable on this platform (idp: arm, 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 12:58:31 +0000
//
__int64 __fastcall GJBaseGameLayer::removeFromGroupParents(cocos2d::CCDictionary **this, GameObject *a2)
{
cocos2d::CCArray *v5; // x24
unsigned int v6; // w21
int v7; // w1
cocos2d::CCDictionary *v8; // x0
cocos2d::CCArray *v9; // x0
cocos2d::CCArray *v10; // x22
int v11; // w3
unsigned __int64 v12; // x28
unsigned __int64 v13; // x19
unsigned __int64 v14; // x23
__int64 *v15; // x0
unsigned __int64 v16; // x1
unsigned __int64 v17; // x1
float v18; // s0
_BOOL8 v19; // x2
__int64 v20; // x0
unsigned __int64 v21; // x2
unsigned __int64 v22; // x1
_QWORD *v23; // x0
unsigned __int64 v24; // x19
__int64 v25; // x28
__int64 *v26; // x0
unsigned __int64 v27; // x1
unsigned __int64 v28; // x1
float v29; // s2
float v30; // s0
_BOOL8 v31; // x2
__int64 v32; // x0
unsigned __int64 v33; // x2
unsigned __int64 v34; // x1
_QWORD *v35; // x0
_QWORD *v36; // x0
_QWORD *v37; // x19
void *v38; // x0
__int64 v39; // x0
unsigned __int64 v40; // x2
unsigned __int64 v41; // x0
__int64 v42; // x1
unsigned __int64 v43; // x2
unsigned __int64 v44; // x0
char *v45; // [xsp+78h] [xbp+78h]
int v46[7]; // [xsp+8Ch] [xbp+8Ch] BYREF
int v47[6]; // [xsp+A8h] [xbp+A8h] BYREF
void *v48; // [xsp+C0h] [xbp+C0h] BYREF
unsigned __int64 v49; // [xsp+C8h] [xbp+C8h]
void *v50; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v51; // [xsp+D8h] [xbp+D8h]
float v52; // [xsp+E0h] [xbp+E0h]
if ( !*((_BYTE *)a2 + 1170) )
return _stack_chk_guard;
v5 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(this + 462), *((unsigned int *)a2 + 229));
if ( !v5 )
return _stack_chk_guard;
v48 = nullptr;
v6 = 0;
v49 = 0;
v50 = nullptr;
v51 = 0;
v52 = 1.0;
while ( v6 < (unsigned int)cocos2d::CCArray::count(v5) )
{
v7 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v5, v6) + 56);
v8 = *(this + 461);
v46[0] = v7;
v9 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v8, v7);
v10 = v9;
if ( !v9 )
goto LABEL_9;
if ( (unsigned int)cocos2d::CCArray::count(v9) )
{
if ( a2 == (GameObject *)cocos2d::CCArray::objectAtIndex(v10, 0) )
{
v45 = (char *)(this + 474);
if ( !std::__hash_table,std::equal_to,std::allocator>::find(this + 474, v46) )
{
v11 = v46[0];
v12 = 0;
v13 = v49;
v14 = v46[0];
if ( v49 )
{
v12 = (v49 - 1) & v46[0];
if ( ((v49 - 1) & v49) != 0 )
v12 = v46[0] % v49;
v15 = *((__int64 **)v48 + v12);
if ( v15 )
{
while ( 1 )
{
v15 = (__int64 *)*v15;
if ( !v15 )
break;
v16 = v15[1];
v17 = ((v49 - 1) & v49) != 0 ? v16 % v49 : (v49 - 1) & v16;
if ( v12 != v17 )
break;
if ( v46[0] == *((_DWORD *)v15 + 4) )
goto LABEL_31;
}
}
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(__int64)&v48,
v46[0],
v46,
(__int64)&v46[1]);
v18 = (float)(unsigned __int64)(v51 + 1);
if ( v18 > (float)((float)v13 * v52) )
{
v19 = 1;
v20 = 2 * v13;
if ( v13 > 2 )
v19 = ((v13 - 1) & v13) != 0;
LABEL_24:
v21 = v19 + v20;
v22 = vcvtps_u32_f32(v18 / v52);
if ( v22 < v21 )
v22 = v21;
std::__hash_table,std::equal_to,std::allocator>::rehash(
(unsigned __int64)&v48,
v22);
v13 = v49;
if ( ((v13 - 1) & v13) == 0 )
{
v12 = (v49 - 1) & v14;
goto LABEL_28;
}
v12 = v14 % v49;
v23 = *((_QWORD **)v48 + v14 % v49);
if ( !v23 )
goto LABEL_66;
LABEL_29:
**(_QWORD **)&v46[1] = *v23;
*v23 = *(_QWORD *)&v46[1];
}
else
{
if ( !v13 )
{
v19 = 1;
v20 = 0;
goto LABEL_24;
}
LABEL_28:
v23 = *((_QWORD **)v48 + v12);
if ( v23 )
goto LABEL_29;
LABEL_66:
**(_QWORD **)&v46[1] = v50;
v50 = *(void **)&v46[1];
*((_QWORD *)v48 + v12) = &v50;
if ( **(_QWORD **)&v46[1] )
{
v40 = *(_QWORD *)(**(_QWORD **)&v46[1] + 8LL);
if ( ((v13 - 1) & v13) != 0 )
v41 = v40 % v13;
else
v41 = (v13 - 1) & v40;
*((_QWORD *)v48 + v41) = *(_QWORD *)&v46[1];
}
}
v11 = v46[0];
v14 = v46[0];
++v51;
LABEL_31:
v24 = (unsigned __int64)*(this + 475);
v25 = 0;
if ( v24 )
{
v25 = v14 & (v24 - 1);
if ( ((v24 - 1) & v24) != 0 )
v25 = v14 % v24;
v26 = *((__int64 **)*(this + 474) + v25);
if ( v26 )
{
while ( 1 )
{
v26 = (__int64 *)*v26;
if ( !v26 )
break;
v27 = v26[1];
v28 = ((v24 - 1) & v24) != 0 ? v27 % v24 : (v24 - 1) & v27;
if ( v25 != v28 )
break;
if ( *((_DWORD *)v26 + 4) == v11 )
goto LABEL_8;
}
}
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(__int64)v45,
v14,
v46,
(__int64)v47);
v29 = *((float *)this + 956);
v30 = (float)((unsigned __int64)*(this + 477) + 1);
if ( v30 > (float)((float)v24 * v29) )
{
v31 = 1;
v32 = 2 * v24;
if ( v24 > 2 )
v31 = ((v24 - 1) & v24) != 0;
LABEL_42:
v33 = v31 + v32;
v34 = vcvtps_u32_f32(v30 / v29);
if ( v34 < v33 )
v34 = v33;
std::__hash_table,std::equal_to,std::allocator>::rehash(
(unsigned __int64)v45,
v34);
v24 = (unsigned __int64)*(this + 475);
if ( ((v24 - 1) & v24) == 0 )
{
v25 = v14 & (v24 - 1);
goto LABEL_46;
}
v25 = v14 % v24;
v35 = *((_QWORD **)*(this + 474) + v14 % v24);
if ( !v35 )
goto LABEL_71;
LABEL_47:
**(_QWORD **)v47 = *v35;
*v35 = *(_QWORD *)v47;
}
else
{
if ( !v24 )
{
v31 = 1;
v32 = 0;
goto LABEL_42;
}
LABEL_46:
v35 = *((_QWORD **)*(this + 474) + v25);
if ( v35 )
goto LABEL_47;
LABEL_71:
**(_QWORD **)v47 = *(this + 476);
v42 = (__int64)*(this + 474);
*(this + 476) = *(cocos2d::CCDictionary **)v47;
*(_QWORD *)(v42 + 8 * v25) = this + 476;
if ( **(_QWORD **)v47 )
{
v43 = *(_QWORD *)(**(_QWORD **)v47 + 8LL);
if ( ((v24 - 1) & v24) != 0 )
v44 = v43 % v24;
else
v44 = (v24 - 1) & v43;
*((_QWORD *)*(this + 474) + v44) = *(_QWORD *)v47;
}
}
*(this + 477) = (cocos2d::CCDictionary *)((char *)*(this + 477) + 1);
}
}
}
LABEL_8:
cocos2d::CCArray::removeObject(v10, a2, 1);
if ( (unsigned int)cocos2d::CCArray::count(v10) )
{
LABEL_9:
++v6;
}
else
{
cocos2d::CCDictionary::removeObjectForKey(*(this + 461), v46[0]);
++v6;
}
}
if ( v51 )
{
v47[0] = *((_DWORD *)a2 + 229);
v39 = std::unordered_map>::operator[]((__int64)(this + 469), v47);
std::__hash_table,std::equal_to,std::allocator>::__move_assign(v39, (__int64 *)&v48);
}
cocos2d::CCDictionary::setObject(*(this + 463), v5, *((unsigned int *)a2 + 229));
cocos2d::CCDictionary::removeObjectForKey(*(this + 462), *((unsigned int *)a2 + 229));
v36 = v50;
if ( v50 )
{
do
{
v37 = (_QWORD *)*v36;
operator delete(v36);
v36 = v37;
}
while ( v37 );
}
v38 = v48;
v48 = nullptr;
if ( v38 )
operator delete(v38);
return _stack_chk_guard;
}