//
// cocos2d::CCNode::sortAllChildrenNoIndex from 0x180005190 to 0x18000528d (253 bytes)
//
// 6 xrefs:
// > cocos2d::CCNode::sortAllChildren @ 0x18000517d
// > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x18008f0bc
// > ??> @ 0x180130db8
// > ??> @ 0x180130dc8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ad660
//
// 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::CCNode::sortAllChildrenNoIndex(cocos2d::CCNode *this)
{
cocos2d::ccArray *data; // rcx
__int64 num; // r13
cocos2d::CCObject **arr; // r14
int v4; // r12d
__int64 i; // r15
cocos2d::CCObject *v6; // rbx
int v7; // esi
__int64 j; // rbp
int v9; // edi
int v10; // edi
unsigned int v11; // edi
data = this->m_pChildren->data;
num = (int)data->num;
arr = data->arr;
if ( num > 1 )
{
v4 = 0;
for ( i = 1; i < num; ++i )
{
v6 = arr[i];
v7 = v4;
for ( j = i - 1; v7 >= 0; --v7 )
{
v9 = ((__int64 (__fastcall *)(cocos2d::CCObject *))arr[j]->__vftable[1].acceptVisitor)(arr[j]);
if ( ((int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[1].acceptVisitor)(v6) >= v9 )
{
v10 = ((__int64 (__fastcall *)(cocos2d::CCObject *))arr[j]->__vftable[1].acceptVisitor)(arr[j]);
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[1].acceptVisitor)(v6) != v10 )
break;
v11 = ((__int64 (__fastcall *)(cocos2d::CCObject *))arr[j]->__vftable[5].update)(arr[j]);
if ( ((unsigned int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[5].update)(v6) >= v11 )
break;
}
arr[j + 1] = arr[j];
--j;
}
++v4;
arr[j + 1] = v6;
}
}
}