//
// cocos2d::CCComponentContainer::remove from 0x7fdea4 to 0x7fdfde (314 bytes)
//
// 0 xrefs:
//
// 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 12:01:17 +0000
//
int __fastcall cocos2d::CCComponentContainer::remove(cocos2d::CCComponentContainer *this, cocos2d::CCComponent *a2)
{
int result; // r0
int v5; // r4
int v6; // r3
int v7; // r2
int v8; // r6
int v9; // r3
int v10; // r2
int v11; // r3
int v12; // r1
int v13; // r3
int v14; // r2
int v15; // r2
_DWORD *v16; // r1
int v17; // r3
int v18; // r2
int v19; // r3
int v20; // r3
int v21; // r2
result = *((_DWORD *)this + 1);
if ( result )
{
v5 = *(_DWORD *)(result + 52);
if ( v5 )
v6 = *(_DWORD *)(v5 + 272);
else
v6 = 0;
while ( v5 )
{
if ( *(cocos2d::CCComponent **)(v5 + 260) == a2 )
{
(*(void (__fastcall **)(cocos2d::CCComponent *))(*(_DWORD *)a2 + 48))(a2);
cocos2d::CCComponent::setOwner((int)a2, nullptr);
v8 = *(_DWORD *)(v5 + 268);
v9 = *((_DWORD *)this + 1);
if ( v8 || *(_DWORD *)(v5 + 272) )
{
v10 = *(_DWORD *)(*(_DWORD *)(v9 + 52) + 264);
v11 = *(_DWORD *)(v10 + 20);
if ( v5 == *(_DWORD *)(v10 + 16) - v11 )
*(_DWORD *)(v10 + 16) = v11 + v8;
v12 = *(_DWORD *)(v5 + 268);
v13 = *((_DWORD *)this + 1);
v14 = *(_DWORD *)(v5 + 272);
if ( v12 )
*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(v13 + 52) + 264) + 20) + v12 + 8) = v14;
else
*(_DWORD *)(v13 + 52) = v14;
v15 = *(_DWORD *)(v5 + 272);
if ( v15 )
*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(*(_DWORD *)(*((_DWORD *)this + 1) + 52) + 264) + 20) + v15 + 4) = *(_DWORD *)(v5 + 268);
v16 = *(_DWORD **)(*(_DWORD *)(*((_DWORD *)this + 1) + 52) + 264);
v17 = 12 * (*(_DWORD *)(v5 + 292) & (v16[1] - 1));
--*(_DWORD *)(*v16 + v17 + 4);
v18 = **(_DWORD **)(*(_DWORD *)(*((_DWORD *)this + 1) + 52) + 264);
if ( *(_DWORD *)(v18 + v17) == v5 + 264 )
*(_DWORD *)(v18 + v17) = *(_DWORD *)(v5 + 280);
v19 = *(_DWORD *)(v5 + 276);
if ( v19 )
*(_DWORD *)(v19 + 16) = *(_DWORD *)(v5 + 280);
v20 = *(_DWORD *)(v5 + 280);
if ( v20 )
*(_DWORD *)(v20 + 12) = *(_DWORD *)(v5 + 276);
v21 = *(_DWORD *)(*(_DWORD *)(*((_DWORD *)this + 1) + 52) + 264);
--*(_DWORD *)(v21 + 12);
}
else
{
free(**(void ***)(*(_DWORD *)(v9 + 52) + 264));
free(*(void **)(*(_DWORD *)(*((_DWORD *)this + 1) + 52) + 264));
*(_DWORD *)(*((_DWORD *)this + 1) + 52) = 0;
}
cocos2d::CCObject::release(*(_DWORD **)(v5 + 260));
cocos2d::CCDictElement::~CCDictElement((cocos2d::CCDictElement *)v5);
operator delete((void *)v5);
return 1;
}
if ( v6 )
v7 = *(_DWORD *)(v6 + 272);
else
v7 = 0;
v5 = v6;
v6 = v7;
}
return 1;
}
return result;
}