//
// cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject from 0xaa8fe8 to 0xaa90d0 (232 bytes)
//
// 7 xrefs:
// > cocos2d::extension::CCTableView::insertCellAtIndex @ 0xaa84c8
// > cocos2d::extension::CCTableView::removeCellAtIndex @ 0xaa8b28
// > cocos2d::extension::CCArrayForObjectSorting::insertSortedObject @ 0xaa9114
// > cocos2d::extension::CCArrayForObjectSorting::removeSortedObject @ 0xaa9174
// > cocos2d::extension::CCArrayForObjectSorting::setObjectID_ofSortedObject @ 0xaa9234
// > cocos2d::extension::CCArrayForObjectSorting::objectWithObjectID @ 0xaa93b0
// > ??> @ 0xc5c58
//
// 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 cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject(
cocos2d::extension::CCArrayForObjectSorting *a1,
cocos2d::extension::CCSortableObject *a2)
{
unsigned int v2; // w20
unsigned int v4; // w22
cocos2d::ccArray *data; // x1
const void **arr; // x19
const void **v7; // x21
const void *v8; // x0
unsigned int v9; // w23
void *v10; // x0
unsigned int v11; // w0
v2 = -1;
if ( a2 )
{
v4 = a2->getObjectID(a2);
if ( a1 )
{
data = a1->data;
v2 = 0;
if ( data->num )
{
arr = (const void **)data->arr;
v7 = &arr[data->num - 1];
if ( arr <= v7 )
{
v8 = *arr;
if ( *arr )
{
v9 = 0;
do
{
++arr;
v10 = _dynamic_cast(
v8,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::extension::CCSortableObject,
-2);
v11 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v10 + 24LL))(v10);
if ( v4 == v11 || v4 < v11 && v4 >= v9 )
break;
++v2;
v9 = v11;
if ( v7 < arr )
break;
v8 = *arr;
}
while ( *arr );
}
}
}
}
else
{
return 0;
}
}
return v2;
}