//
// cocos2d::CCSpriteBatchNode::sortAllChildren from 0x5e7cf0 to 0x5e7db2 (194 bytes)
//
// 0 xrefs:
//
// 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::CCSpriteBatchNode::sortAllChildren(cocos2d::CCSpriteBatchNode *a1)
{
cocos2d::CCArray *m_pChildren; // r3
cocos2d::CCArray *v3; // r3
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r7
cocos2d::CCObject **v6; // r5
int v7; // r0
int v8; // t1
cocos2d::ccArray *v9; // r2
cocos2d::CCObject **v10; // r7
cocos2d::CCObject **v11; // r5
cocos2d::CCSprite *v12; // r1
cocos2d::CCSprite *v13; // t1
cocos2d::CCSpriteBatchNode *v14; // [sp+0h] [bp-8h] BYREF
v14 = a1;
if ( a1->m_bReorderChildDirty && (!a1->m_bManualSortChildren || a1->m_bManualSortAllChildrenDirty) )
{
if ( a1->m_bUseChildIndex )
cocos2d::CCNode::sortAllChildrenWithIndex(a1);
else
cocos2d::CCNode::sortAllChildrenNoIndex(a1);
if ( cocos2d::CCArray::count(a1->m_pChildren) )
{
m_pChildren = a1->m_pChildren;
if ( m_pChildren )
{
data = m_pChildren->data;
if ( data->num )
{
arr = data->arr;
v6 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v6 )
{
v8 = (int)*arr++;
v7 = v8;
if ( !v8 )
break;
(*(void (__fastcall **)(int))(*(_DWORD *)v7 + 292))(v7);
}
}
}
v14 = nullptr;
v3 = a1->m_pChildren;
if ( v3 )
{
v9 = v3->data;
if ( v9->num )
{
v10 = v9->arr;
v11 = &v10[v9->num] + 0x3FFFFFFF;
while ( v10 <= v11 )
{
v13 = (cocos2d::CCSprite *)*v10++;
v12 = v13;
if ( !v13 )
break;
cocos2d::CCSpriteBatchNode::updateAtlasIndex(a1, v12, (int *)&v14);
}
}
}
}
a1->m_bReorderChildDirty = 0;
a1->m_bManualSortAllChildrenDirty = 0;
}
}