//
// cocos2d::CCNode::qsortAllChildrenWithIndex from 0x1002d8dfc to 0x1002d8e90 (148 bytes)
//
// 3 xrefs:
// > PlayLayer::resetLevel @ 0x10014bf78
// > cocos2d::CCNode::sortAllChildren @ 0x1002d8ccc
// > j_cocos2d::CCNode::qsortAllChildrenWithIndex @ 0x1002d8ce8
//
// 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 11:02:43 +0000
//
__int64 __fastcall cocos2d::CCNode::qsortAllChildrenWithIndex(__int64 result)
{
__int64 (*v1)(void); // x29
__int64 (*v2)(void); // x30
__int64 v3; // x19
unsigned int *v4; // x8
__int64 v5; // x0
unsigned __int64 v6; // x8
unsigned __int64 v7; // x9
__int64 v8; // x3
__int64 (*v9[5])(void); // [xsp+8h] [xbp-28h] BYREF
if ( *(_BYTE *)(result + 288) == 1 )
{
v9[3] = v1;
v9[4] = v2;
v3 = result;
if ( *(_BYTE *)(result + 312) == 1 )
sub_1003F2FB4(*(_QWORD *)(*(_QWORD *)(result + 208) + 56LL));
v4 = *(unsigned int **)(*(_QWORD *)(v3 + 208) + 56LL);
v5 = *((_QWORD *)v4 + 2);
v6 = *v4;
v9[0] = sub_1002D8E90;
v7 = 126 - 2 * __clz(v6);
if ( (_DWORD)v6 )
v8 = v7;
else
v8 = 0;
sub_1000335D0(v5, (int8x16_t *)(v5 + 8 * v6), v9, v8, 1);
return sub_1003F32F4(*(_QWORD *)(*(_QWORD *)(v3 + 208) + 56LL));
}
return result;
}