//
// cocos2d::extension::CCTableView::removeCellAtIndex from 0x180015560 to 0x1800157ca (618 bytes)
//
// 4 xrefs:
// > ??> @ 0x18002ee4c
// > ??> @ 0x18002eec4
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004a7c4
//
// 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::CCTableView::removeCellAtIndex(
cocos2d::extension::CCTableView *this,
unsigned int a2)
{
int v4; // eax
__int64 *v5; // rax
__int64 *v6; // rdx
__int64 *v7; // rcx
struct cocos2d::extension::CCSortableObject *v8; // rax
struct cocos2d::extension::CCTableViewCell *v9; // r14
__int64 v10; // rdi
unsigned int v11; // r12d
unsigned int v12; // r15d
unsigned int v13; // eax
struct cocos2d::extension::CCTableViewCell *v14; // rdx
unsigned int v15; // ebp
unsigned int *v16; // rdi
__int64 v17; // rax
_QWORD *v18; // rdi
_QWORD *v19; // r13
__int64 v20; // rax
unsigned int v21; // eax
__int64 *v22; // r10
__int64 *v23; // r9
__int64 *v24; // rdx
__int64 *v25; // rcx
__int64 *v26; // rax
unsigned int v27; // r8d
unsigned int i; // ebx
struct cocos2d::CCObject *v29; // rax
_QWORD v30[2]; // [rsp+30h] [rbp-38h] BYREF
if ( a2 != -1 )
{
v4 = (*(__int64 (__fastcall **)(_QWORD, cocos2d::extension::CCTableView *))(**((_QWORD **)this + 80) + 32LL))(
*((_QWORD *)this + 80),
this);
if ( v4 )
{
if ( a2 <= v4 - 1 )
{
v5 = **((__int64 ***)this + 74);
v6 = v5;
v7 = (__int64 *)v5[1];
while ( !*((_BYTE *)v7 + 25) )
{
if ( *((_DWORD *)v7 + 7) >= a2 )
{
v6 = v7;
v7 = (__int64 *)*v7;
}
else
{
v7 = (__int64 *)v7[2];
}
}
if ( !*((_BYTE *)v6 + 25) && a2 >= *((_DWORD *)v6 + 7) && v6 != v5 )
{
v8 = cocos2d::extension::CCArrayForObjectSorting::objectWithObjectID(
*((cocos2d::extension::CCArrayForObjectSorting **)this + 78),
a2);
if ( v8 )
{
v9 = (struct cocos2d::extension::CCSortableObject *)((char *)v8 - 320);
if ( v8 != (struct cocos2d::extension::CCSortableObject *)320 )
{
v10 = *((_QWORD *)this + 78);
v11 = 0;
v12 = 0;
v13 = (*(__int64 (__fastcall **)(struct cocos2d::extension::CCSortableObject *))(*(_QWORD *)v8 + 16LL))(v8);
v14 = v9;
v15 = v13;
if ( v10 )
{
v16 = *(unsigned int **)(v10 + 56);
v17 = *v16;
if ( (_DWORD)v17 )
{
v18 = *((_QWORD **)v16 + 2);
v19 = &v18[v17 - 1];
if ( v18 <= v19 )
{
do
{
if ( !*v18 )
break;
v20 = _RTDynamicCast(
*v18,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::extension::CCSortableObject `RTTI Type Descriptor',
0);
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 16LL))(v20);
if ( v15 == v21 || v15 >= v11 && v15 < v21 )
break;
++v12;
++v18;
v11 = v21;
}
while ( v18 <= v19 );
v14 = v9;
}
}
}
cocos2d::extension::CCTableView::_moveCellOutOfSight(this, v14);
v22 = *((__int64 **)this + 74);
v23 = (__int64 *)*v22;
v24 = (__int64 *)*v22;
v25 = *(__int64 **)(*v22 + 8);
v26 = v25;
while ( !*((_BYTE *)v26 + 25) )
{
v27 = *((_DWORD *)v26 + 7);
if ( v27 >= a2 )
{
if ( *((_BYTE *)v24 + 25) && a2 < v27 )
v24 = v26;
v23 = v26;
v26 = (__int64 *)*v26;
}
else
{
v26 = (__int64 *)v26[2];
}
}
if ( !*((_BYTE *)v24 + 25) )
v25 = (__int64 *)*v24;
while ( !*((_BYTE *)v25 + 25) )
{
if ( a2 >= *((_DWORD *)v25 + 7) )
{
v25 = (__int64 *)v25[2];
}
else
{
v24 = v25;
v25 = (__int64 *)*v25;
}
}
v30[1] = v24;
v30[0] = v23;
sub_180016820(v22, v30);
cocos2d::extension::CCTableView::_updateCellPositions(this);
for ( i = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 78)) - 1; i > v12; --i )
{
v29 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 78), i);
cocos2d::extension::CCTableView::_setIndexForCell(this, *((_DWORD *)v29 + 82) - 1, v29);
}
}
}
}
}
}
}
}