//
// cocos2d::extension::CCArrayForObjectSorting::insertSortedObject from 0x1800140e0 to 0x1800141da (250 bytes)
//
// 5 xrefs:
// > cocos2d::extension::CCArrayForObjectSorting::setObjectID_ofSortedObject @ 0x1800144a5
// > cocos2d::extension::CCTableView::_addCellIfNecessary @ 0x18001542c
// > ??> @ 0x180032408
// > ??> @ 0x18004c560
// > ??> @ 0x18004c56c
//
// This function is hookable on this platform (idp: pc, 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 12:15:41 +0000
//
void __fastcall cocos2d::extension::CCArrayForObjectSorting::insertSortedObject(
cocos2d::extension::CCArrayForObjectSorting *this,
struct cocos2d::extension::CCSortableObject *a2)
{
struct cocos2d::CCObject *v4; // r12
unsigned int v5; // edi
unsigned int v6; // ebp
unsigned int v7; // esi
unsigned int *v8; // rbx
__int64 v9; // rax
_QWORD *v10; // rbx
_QWORD *i; // r14
__int64 v12; // rax
unsigned int v13; // eax
v4 = (struct cocos2d::CCObject *)_RTDynamicCast(
a2,
0,
&cocos2d::extension::CCSortableObject `RTTI Type Descriptor',
&cocos2d::CCObject `RTTI Type Descriptor',
0);
v5 = 0;
if ( a2 )
{
v6 = 0;
v7 = (*(__int64 (__fastcall **)(struct cocos2d::extension::CCSortableObject *))(*(_QWORD *)a2 + 16LL))(a2);
if ( this )
{
v8 = *((unsigned int **)this + 7);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((_QWORD **)v8 + 2);
for ( i = &v10[v9 - 1]; v10 <= i; v6 = v13 )
{
if ( !*v10 )
break;
v12 = _RTDynamicCast(
*v10,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::extension::CCSortableObject `RTTI Type Descriptor',
0);
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 16LL))(v12);
if ( v7 == v13 || v7 >= v6 && v7 < v13 )
break;
++v5;
++v10;
}
}
}
}
else
{
v5 = -1;
}
cocos2d::CCArray::insertObject(this, v4, v5);
}