//
// cocos2d::CCSpriteBatchNode::sortAllChildren from 0xd88a44 to 0xd88ba0 (348 bytes)
//
// 5 xrefs:
// > ??> @ 0x5dca0
// > ??> @ 0x1415168
// > ??> @ 0x15185d8
// > ??> @ 0x152eb98
// > ??> @ 0x1530bf8
//
// 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:08:14 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::sortAllChildren(cocos2d::CCSpriteBatchNode *this)
{
__int64 v2; // x1
unsigned int *v3; // x2
__int64 *v4; // x21
__int64 *v5; // x22
__int64 v6; // x0
unsigned int *v8; // x1
cocos2d::CCSprite **v9; // x21
__int64 v10; // x0
char *v11; // x22
cocos2d::CCSprite *i; // x1
int v13; // [xsp+44h] [xbp+44h] BYREF
if ( *((_BYTE *)this + 288) )
{
if ( *((_BYTE *)this + 352) )
{
if ( !*((_BYTE *)this + 353) )
return _stack_chk_guard;
if ( *((_BYTE *)this + 312) )
goto LABEL_4;
}
else if ( *((_BYTE *)this + 312) )
{
LABEL_4:
cocos2d::CCNode::sortAllChildrenWithIndex(this);
LABEL_5:
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 26)) )
{
v2 = *((_QWORD *)this + 26);
if ( v2 )
{
v3 = *(unsigned int **)(v2 + 56);
if ( *v3 && (v4 = *((__int64 **)v3 + 2), v5 = &v4[*v3 - 1], v4 <= v5) && (v6 = *v4) != 0 )
{
do
{
++v4;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 600LL))(v6);
if ( v5 < v4 )
break;
v6 = *v4;
}
while ( *v4 );
v2 = *((_QWORD *)this + 26);
v13 = 0;
if ( !v2 )
goto LABEL_13;
}
else
{
v13 = 0;
}
v8 = *(unsigned int **)(v2 + 56);
if ( *v8 )
{
v9 = *((cocos2d::CCSprite ***)v8 + 2);
v10 = 8LL * *v8 - 8;
v11 = (char *)v9 + v10;
if ( v9 <= (cocos2d::CCSprite **)((char *)v9 + v10) )
{
for ( i = *v9; *v9; i = *v9 )
{
++v9;
cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, i, &v13);
if ( v11 < (char *)v9 )
break;
}
}
}
}
}
LABEL_13:
*((_BYTE *)this + 288) = 0;
*((_BYTE *)this + 353) = 0;
return _stack_chk_guard;
}
cocos2d::CCNode::sortAllChildrenNoIndex(this);
goto LABEL_5;
}
return _stack_chk_guard;
}