//
// cocos2d::extension::CCArrayForObjectSorting::removeSortedObject from 0x180014640 to 0x180014789 (329 bytes)
//
// 5 xrefs:
// > cocos2d::extension::CCTableView::_moveCellOutOfSight @ 0x180015d44
// > ??> @ 0x18002ebb4
// > ??> @ 0x18002ebf0
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004a644
//
// 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 cocos2d::extension::CCArrayForObjectSorting::removeSortedObject(
cocos2d::extension::CCArrayForObjectSorting *this,
struct cocos2d::extension::CCSortableObject *a2)
{
unsigned int v4; // edi
unsigned int v5; // ebp
unsigned int v6; // esi
unsigned int *v7; // rbx
__int64 v8; // rax
_QWORD *v9; // rbx
_QWORD *i; // r15
__int64 v11; // rax
unsigned int v12; // eax
struct cocos2d::CCObject *v13; // rax
__int64 v14; // rax
int v15; // ebx
if ( cocos2d::CCArray::count(this) )
{
v4 = 0;
if ( a2 )
{
v5 = 0;
v6 = (*(__int64 (__fastcall **)(struct cocos2d::extension::CCSortableObject *))(*(_QWORD *)a2 + 16LL))(a2);
if ( this )
{
v7 = *((unsigned int **)this + 7);
v8 = *v7;
if ( (_DWORD)v8 )
{
v9 = *((_QWORD **)v7 + 2);
for ( i = &v9[v8 - 1]; v9 <= i; v5 = v12 )
{
if ( !*v9 )
break;
v11 = _RTDynamicCast(
*v9,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::extension::CCSortableObject `RTTI Type Descriptor',
0);
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 16LL))(v11);
if ( v6 == v12 || v6 >= v5 && v6 < v12 )
break;
++v4;
++v9;
}
}
}
}
else
{
v4 = -1;
}
if ( v4 < cocos2d::CCArray::count(this) && v4 != -1 )
{
v13 = cocos2d::CCArray::objectAtIndex(this, v4);
v14 = _RTDynamicCast(
v13,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::extension::CCSortableObject `RTTI Type Descriptor',
0);
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 16LL))(v14);
if ( v15 == (*(unsigned int (__fastcall **)(struct cocos2d::extension::CCSortableObject *))(*(_QWORD *)a2 + 16LL))(a2) )
cocos2d::CCArray::removeObjectAtIndex(this, v4, 1);
}
}
}