//
// cocos2d::CCComponentContainer::remove from 0xd9fd9c to 0xda00e0 (836 bytes)
//
// 2 xrefs:
// > ??> @ 0xff1c0
// > ??> @ 0x152fa50
//
// 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 13:08:29 +0000
//
__int64 __fastcall cocos2d::CCComponentContainer::remove(cocos2d::CCComponentContainer *this, const char *a2)
{
__int64 v2; // x2
__int64 v3; // x21
int v6; // w5
int v7; // w1
int v8; // w2
unsigned int v9; // w0
__int64 v10; // x21
unsigned int v11; // w19
int v12; // w2
unsigned int v13; // w0
unsigned int v14; // w19
int v15; // w2
__int64 v16; // x0
__int64 v17; // x19
__int64 v18; // x19
const void *v20; // x0
void *v21; // x0
__int64 v22; // x21
unsigned int v23; // w1
__int64 v24; // x1
__int64 v25; // x3
__int64 v26; // x4
__int64 v27; // x5
__int64 v28; // x2
__int64 v29; // x3
__int64 v30; // x1
__int64 v31; // x2
__int64 v32; // x1
__int64 v33; // x1
__int64 v34; // x1
v2 = *((_QWORD *)this + 1);
if ( !v2 )
return 0;
v3 = *(_QWORD *)(v2 + 56);
if ( !v3 )
return 0;
v6 = *((unsigned __int8 *)a2 + 3);
v7 = *((unsigned __int8 *)a2 + 4)
- 1640531527
+ (*((unsigned __int8 *)a2 + 7) << 24)
+ (*((unsigned __int8 *)a2 + 6) << 16)
+ (*((unsigned __int8 *)a2 + 5) << 8);
v8 = (*(unsigned __int8 *)a2
- 1622558014
+ (v6 << 24)
+ (*((unsigned __int8 *)a2 + 2) << 16)
+ (*((unsigned __int8 *)a2 + 1) << 8)
- v7)
^ 0x7F76D;
v9 = (v7 + 17973513 - v8) ^ (v8 << 8);
v10 = *(_QWORD *)(v3 + 272);
v11 = (-17973513 - v8 - v9) ^ (v9 >> 13);
v12 = (v8 - v9 - v11) ^ (v11 >> 12);
v13 = (v9 - v11 - v12) ^ (v12 << 16);
v14 = (v11 - v12 - v13) ^ (v13 >> 5);
v15 = (v12 - v13 - v14) ^ (v14 >> 3);
v16 = *(_QWORD *)(*(_QWORD *)v10
+ 16LL
* (((v14 - v15 - ((v13 - v14 - v15) ^ (v15 << 10)))
^ (((v13 - v14 - v15) ^ (v15 << 10)) >> 15))
& (*(_DWORD *)(v10 + 8) - 1)));
v17 = v16 ? v16 - *(_QWORD *)(v10 + 32) : 0LL;
if ( !v17 )
return 0;
while ( *(_DWORD *)(v17 + 320) != 8 || memcmp(*(const void **)(v17 + 312), a2, 8u) )
{
v18 = *(_QWORD *)(v17 + 304);
if ( v18 )
{
v17 = v18 - *(_QWORD *)(v10 + 32);
if ( v17 )
continue;
}
return 0;
}
v20 = *(const void **)(v17 + 264);
if ( !v20 )
return 0;
v21 = _dynamic_cast(
v20,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCComponent,
0);
v22 = (__int64)v21;
v23 = 0;
if ( v21 )
{
(*(void (__fastcall **)(void *))(*(_QWORD *)v21 + 96LL))(v21);
cocos2d::CCComponent::setOwner(v22, nullptr);
v24 = *(_QWORD *)(v17 + 280);
if ( !v24 && !*(_QWORD *)(v17 + 288) )
{
free(**(void ***)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL));
free(*(void **)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL));
*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) = 0;
LABEL_26:
cocos2d::CCObject::release(*(_DWORD **)(v17 + 264));
cocos2d::CCDictElement::~CCDictElement((cocos2d::CCDictElement *)v17);
operator delete((void *)v17);
return 1;
}
v25 = *((_QWORD *)this + 1);
v26 = *(_QWORD *)(*(_QWORD *)(v25 + 56) + 272LL);
v27 = *(_QWORD *)(v26 + 32);
if ( v17 == *(_QWORD *)(v26 + 24) - v27 )
{
*(_QWORD *)(v26 + 24) = v24 + v27;
v24 = *(_QWORD *)(v17 + 280);
v25 = *((_QWORD *)this + 1);
if ( v24 )
goto LABEL_16;
}
else if ( v24 )
{
LABEL_16:
*(_QWORD *)(v24 + *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v25 + 56) + 272LL) + 32LL) + 16) = *(_QWORD *)(v17 + 288);
LABEL_17:
v28 = *(_QWORD *)(v17 + 288);
if ( v28 )
*(_QWORD *)(v28 + *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL) + 32LL) + 8) = *(_QWORD *)(v17 + 280);
v29 = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL);
v30 = 16LL * ((unsigned int)(*(_DWORD *)(v29 + 8) - 1) & *(_DWORD *)(v17 + 324));
--*(_DWORD *)(*(_QWORD *)v29 + v30 + 8);
v31 = **(_QWORD **)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL);
if ( *(_QWORD *)(v31 + v30) == v17 + 272 )
*(_QWORD *)(v31 + v30) = *(_QWORD *)(v17 + 304);
v32 = *(_QWORD *)(v17 + 296);
if ( v32 )
*(_QWORD *)(v32 + 32) = *(_QWORD *)(v17 + 304);
v33 = *(_QWORD *)(v17 + 304);
if ( v33 )
*(_QWORD *)(v33 + 24) = *(_QWORD *)(v17 + 296);
v34 = *(_QWORD *)(*(_QWORD *)(*((_QWORD *)this + 1) + 56LL) + 272LL);
--*(_DWORD *)(v34 + 16);
goto LABEL_26;
}
*(_QWORD *)(v25 + 56) = *(_QWORD *)(v17 + 288);
goto LABEL_17;
}
return v23;
}