//
// GJBaseGameLayer::removeFromGroupParents from 0x5a5b88 to 0x5a5f8c (1028 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::removeSpecial @ 0x464376
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:53:20 +0000
//
int __fastcall GJBaseGameLayer::removeFromGroupParents(int this, GameObject *a2)
{
int v2; // r5
cocos2d::CCArray *v4; // r9
unsigned int v5; // r7
int v6; // r1
cocos2d::CCDictionary *v7; // r0
cocos2d::CCArray *v8; // r0
cocos2d::CCArray *v9; // r10
unsigned int v10; // r4
unsigned int v11; // r11
unsigned int v12; // r2
unsigned int v13; // r6
_DWORD *v14; // r3
float v15; // s15
bool v16; // r6
unsigned int v17; // r6
unsigned int v18; // r1
_DWORD *v19; // r3
unsigned int v20; // r4
unsigned int v21; // r11
unsigned int v22; // r6
float v23; // s13
float v24; // s15
bool v25; // r6
unsigned int v26; // r6
unsigned int v27; // r1
_DWORD *v28; // r3
void **v29; // r0
unsigned int v30; // r0
int v31; // r1
unsigned int v32; // r0
int v33; // r1
unsigned int v34; // r2
_DWORD *v35; // r3
unsigned int v36; // r0
int v37; // r1
unsigned int v38; // r0
int v39; // r1
int v40; // [sp+0h] [bp-54h]
int v41; // [sp+1Ch] [bp-38h] BYREF
int v42[3]; // [sp+20h] [bp-34h] BYREF
void *v43[3]; // [sp+2Ch] [bp-28h] BYREF
_DWORD *v44; // [sp+38h] [bp-1Ch] BYREF
unsigned int v45; // [sp+3Ch] [bp-18h]
int v46; // [sp+40h] [bp-14h] BYREF
int v47; // [sp+44h] [bp-10h]
float v48; // [sp+48h] [bp-Ch]
v2 = this;
if ( !*((_BYTE *)a2 + 1022) )
return this;
this = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(this + 2324), *((_DWORD *)a2 + 195));
v4 = (cocos2d::CCArray *)this;
if ( !this )
return this;
v5 = 0;
v44 = nullptr;
v48 = 1.0;
v45 = 0;
v46 = 0;
v47 = 0;
while ( v5 < cocos2d::CCArray::count(v4) )
{
v6 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v4, v5) + 52);
v7 = *(cocos2d::CCDictionary **)(v2 + 2320);
v41 = v6;
v8 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v7, v6);
v9 = v8;
if ( !v8 )
goto LABEL_37;
if ( cocos2d::CCArray::count(v8) )
{
if ( a2 == (GameObject *)cocos2d::CCArray::objectAtIndex(v9, 0) )
{
v40 = v2 + 2372;
if ( !std::__hash_table,std::equal_to,std::allocator>::find(
(_DWORD *)(v2 + 2372),
(unsigned int *)&v41) )
{
v10 = v45;
v11 = v41;
if ( v45 )
{
v12 = v45 - 1;
if ( ((v45 - 1) & v45) != 0 )
{
v12 = v45 - 1;
v13 = v41 % v45;
}
else
{
v13 = v12 & v41;
}
v14 = (_DWORD *)v44[v13];
if ( v14 )
{
while ( 1 )
{
v14 = (_DWORD *)*v14;
if ( !v14 )
break;
v30 = v14[1];
v31 = ((v45 - 1) & v45) != 0 ? v30 % v45 : v12 & v30;
if ( v31 != v13 )
break;
if ( v14[2] == v41 )
goto LABEL_23;
}
}
}
else
{
v13 = 0;
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)v42,
(int)&v44,
v41,
&v41);
v15 = (float)(unsigned int)(v47 + 1);
if ( v15 <= (float)((float)v10 * v48) )
{
if ( !v10 )
{
v16 = 0;
goto LABEL_16;
}
}
else
{
v16 = v10 > 2 && ((v10 - 1) & v10) == 0;
LABEL_16:
v17 = 2 * v10 + !v16;
v18 = (unsigned int)ceilf(v15 / v48);
if ( v18 < v17 )
v18 = v17;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v44, v18);
v10 = v45;
if ( ((v45 - 1) & v45) != 0 )
v13 = v11 % v45;
else
v13 = (v45 - 1) & v11;
}
v19 = (_DWORD *)v44[v13];
if ( v19 )
{
*(_DWORD *)v42[0] = *v19;
*v19 = v42[0];
}
else
{
*(_DWORD *)v42[0] = v46;
v46 = v42[0];
v44[v13] = &v46;
if ( *(_DWORD *)v42[0] )
{
v32 = *(_DWORD *)(*(_DWORD *)v42[0] + 4);
if ( ((v10 - 1) & v10) != 0 )
v33 = v32 % v10;
else
v33 = (v10 - 1) & v32;
v44[v33] = v42[0];
}
}
++v47;
LABEL_23:
v20 = *(_DWORD *)(v2 + 2376);
v21 = v41;
if ( v20 )
{
v34 = v20 - 1;
if ( ((v20 - 1) & v20) != 0 )
{
v34 = v20 - 1;
v22 = v41 % v20;
}
else
{
v22 = v34 & v41;
}
v35 = *(_DWORD **)(*(_DWORD *)(v2 + 2372) + 4 * v22);
if ( v35 )
{
while ( 1 )
{
v35 = (_DWORD *)*v35;
if ( !v35 )
break;
v36 = v35[1];
v37 = ((v20 - 1) & v20) != 0 ? v36 % v20 : v34 & v36;
if ( v37 != v22 )
break;
if ( v35[2] == v41 )
goto LABEL_35;
}
}
}
else
{
v22 = 0;
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)v43,
v40,
v41,
&v41);
v23 = *(float *)(v2 + 2388);
v24 = (float)(unsigned int)(*(_DWORD *)(v2 + 2384) + 1);
if ( v24 <= (float)((float)v20 * v23) )
{
if ( !v20 )
{
v25 = 0;
goto LABEL_28;
}
}
else
{
v25 = v20 > 2 && ((v20 - 1) & v20) == 0;
LABEL_28:
v26 = 2 * v20 + !v25;
v27 = (unsigned int)ceilf(v24 / v23);
if ( v27 < v26 )
v27 = v26;
std::__hash_table,std::equal_to,std::allocator>::rehash(v40, v27);
v20 = *(_DWORD *)(v2 + 2376);
if ( ((v20 - 1) & v20) != 0 )
v22 = v21 % v20;
else
v22 = (v20 - 1) & v21;
}
v28 = *(_DWORD **)(*(_DWORD *)(v2 + 2372) + 4 * v22);
if ( v28 )
{
*(_DWORD *)v43[0] = *v28;
*v28 = v43[0];
}
else
{
*(_DWORD *)v43[0] = *(_DWORD *)(v2 + 2380);
*(void **)(v2 + 2380) = v43[0];
*(_DWORD *)(*(_DWORD *)(v2 + 2372) + 4 * v22) = v2 + 2380;
if ( *(_DWORD *)v43[0] )
{
v38 = *(_DWORD *)(*(_DWORD *)v43[0] + 4);
if ( ((v20 - 1) & v20) != 0 )
v39 = v38 % v20;
else
v39 = (v20 - 1) & v38;
*(void **)(*(_DWORD *)(v2 + 2372) + 4 * v39) = v43[0];
}
}
++*(_DWORD *)(v2 + 2384);
}
}
}
LABEL_35:
cocos2d::CCArray::removeObject(v9, a2, 1);
if ( !cocos2d::CCArray::count(v9) )
cocos2d::CCDictionary::removeObjectForKey(*(cocos2d::CCDictionary **)(v2 + 2320), v41);
LABEL_37:
++v5;
}
if ( v47 )
{
v43[0] = *((void **)a2 + 195);
v29 = (void **)std::unordered_map>::operator[](v2 + 2352, (unsigned int *)v43);
std::__hash_table,std::equal_to,std::allocator>::__move_assign(v29, (void **)&v44);
}
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v2 + 2328), v4, *((_DWORD *)a2 + 195));
cocos2d::CCDictionary::removeObjectForKey(*(cocos2d::CCDictionary **)(v2 + 2324), *((_DWORD *)a2 + 195));
return std::__hash_table,std::equal_to,std::allocator>::~__hash_table((int)&v44);
}