//
// cocos2d::extension::CCArrayForObjectSorting::setObjectID_ofSortedObject from 0xd1b0e0 to 0xd1b220 (320 bytes)
//
// 2 xrefs:
// > cocos2d::extension::CCArrayForObjectSorting::removeSortedObject @ 0xd1b0dc
// > ??> @ 0x788e0
//
// This function is hookable on this platform (idp: arm, 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 13:07:08 +0000
//
__int64 __fastcall cocos2d::extension::CCArrayForObjectSorting::setObjectID_ofSortedObject(
cocos2d::CCArray *a1,
unsigned int a2,
__int64 a3)
{
cocos2d::CCObject *v3; // x22
void *v4; // x24
unsigned int v8; // w19
__int64 result; // x0
const void *v10; // x0
void *v11; // x0
int v12; // w23
v8 = cocos2d::extension::CCArrayForObjectSorting::indexOfSortedObject((__int64)a1, a3);
result = cocos2d::CCArray::count(a1);
if ( v8 < (unsigned int)result && v8 != -1 )
{
v10 = (const void *)cocos2d::CCArray::objectAtIndex(a1, v8);
if ( v10
&& (v3 = (cocos2d::CCObject *)&`typeinfo for'cocos2d::CCObject,
v11 = _dynamic_cast(
v10,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::extension::CCSortableObject,
-2),
(v4 = v11) != nullptr) )
{
v3 = (cocos2d::CCObject *)_dynamic_cast(
v11,
(const struct __class_type_info *)&`typeinfo for'cocos2d::extension::CCSortableObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
-2);
cocos2d::CCObject::retain(v3);
v12 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v4 + 24LL))(v4);
if ( v12 != (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a3 + 24LL))(a3) )
return cocos2d::CCObject::release(v3);
}
else
{
cocos2d::CCObject::retain(nullptr);
__break(0x3E8u);
}
cocos2d::CCArray::removeObjectAtIndex(a1, v8, 1);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v4 + 16LL))(v4, a2);
cocos2d::extension::CCArrayForObjectSorting::insertSortedObject(a1, v4);
return cocos2d::CCObject::release(v3);
}
return result;
}