//
// cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject from 0x10042a070 to 0x10042a127 (183 bytes)
//
// 2 xrefs:
// > cocos2d::extension::CCTableView::insertCellAtIndex @ 0x10042d07a
// > cocos2d::extension::CCTableView::removeCellAtIndex @ 0x10042d266
//
// 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
//
unsigned int __fastcall cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject(
cocos2d::extension::CCArrayForObjectSorting *a1,
cocos2d::extension::CCSortableObject *a2)
{
unsigned int v2; // eax
unsigned int v3; // ebx
unsigned int v4; // r14d
cocos2d::ccArray *data; // rax
const void **arr; // r13
const void **v7; // r15
unsigned int v8; // r12d
void *v9; // rax
unsigned int v10; // eax
if ( !a2 )
return -1;
v2 = ((__int64 (__fastcall *)(cocos2d::extension::CCSortableObject *))a2->getObjectID)(a2);
v3 = 0;
if ( a1 )
{
v4 = v2;
data = a1->data;
if ( data->num )
{
arr = (const void **)data->arr;
v7 = &arr[data->num - 1];
v3 = 0;
v8 = 0;
do
{
if ( !*arr )
break;
v9 = __dynamic_cast(
*arr,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::extension::CCSortableObject,
-2);
v10 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v9 + 24LL))(v9);
if ( v4 == v10 )
break;
if ( v4 < v10 && v4 >= v8 )
break;
++v3;
++arr;
v8 = v10;
}
while ( arr <= v7 );
}
}
return v3;
}