//
// cocos2d::CCNode::sortAllChildrenNoIndex from 0x5bdfbe to 0x5be04a (140 bytes)
//
// 2 xrefs:
// > cocos2d::CCNode::sortAllChildren @ 0x5bea76
// > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x5e7d24
//
// 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 cocos2d::CCNode::sortAllChildrenNoIndex(cocos2d::CCNode *a1)
{
int v1; // r7
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r9
signed int num; // r10
cocos2d::CCObject **v5; // r8
cocos2d::CCObject *v6; // r4
cocos2d::CCObject *v7; // t1
int v8; // r5
cocos2d::CCObject **i; // r6
int v10; // r11
int v11; // r11
unsigned int v12; // r11
v1 = 1;
data = a1->m_pChildren->data;
arr = data->arr;
num = data->num;
v5 = arr;
while ( v1 < num )
{
v7 = v5[1];
++v5;
v6 = v7;
v8 = v1 - 1;
for ( i = v5; v8 >= 0; --i )
{
v10 = ((int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[1].isEqual)(v6);
if ( v10 >= ((int (__fastcall *)(_DWORD))(*(i - 1))->__vftable[1].isEqual)(*(i - 1)) )
{
v11 = ((int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[1].isEqual)(v6);
if ( v11 != ((int (__fastcall *)(_DWORD))(*(i - 1))->__vftable[1].isEqual)(*(i - 1)) )
break;
v12 = ((int (__fastcall *)(cocos2d::CCObject *))v6->__vftable[5].copyWithZone)(v6);
if ( v12 >= ((int (__fastcall *)(_DWORD))(*(i - 1))->__vftable[5].copyWithZone)(*(i - 1)) )
break;
}
--v8;
*i = *(i - 1);
}
++v1;
arr[v8 + 1] = v6;
}
}