//
// GJBaseGameLayer::sortStartPosObjects from 0x1403192b0 to 0x140319398 (232 bytes)
//
// 5 xrefs:
// > PlayLayer::setupHasCompleted @ 0x14050486f
// > PlayLayer::addLiveStartPosObject @ 0x14051875d
// > ??> @ 0x1408b508c
// > ??> @ 0x1408b509c
// > ??> @ 0x14091eb54
//
// This function is hookable on this platform (idp: pc, 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:30:19 +0000
//
void __fastcall GJBaseGameLayer::sortStartPosObjects(__int64 a1)
{
__int64 v2; // rcx
struct cocos2d::CCArray *v3; // rbx
cocos2d::CCArray *v4; // rdi
__int64 v5; // rcx
cocos2d::CCArray *v6; // rsi
struct cocos2d::CCObject *i; // rbx
signed int j; // edi
cocos2d::CCArray *v9; // rbx
struct cocos2d::CCObject *v10; // rax
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 12920)) > 1 )
{
v3 = *(struct cocos2d::CCArray **)(a1 + 12920);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v2);
cocos2d::CCArray::addObjectsFromArray(v4, v3);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
for ( i = (struct cocos2d::CCObject *)GJBaseGameLayer::findStartPosWinnerInArray((__int64)v4);
i;
i = (struct cocos2d::CCObject *)GJBaseGameLayer::findStartPosWinnerInArray((__int64)v4) )
{
cocos2d::CCArray::addObject(v6, i);
cocos2d::CCArray::removeObject(v4, i, 1);
}
cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(a1 + 12920));
for ( j = cocos2d::CCArray::count(v6) - 1; j >= 0; --j )
{
v9 = *(cocos2d::CCArray **)(a1 + 12920);
v10 = cocos2d::CCArray::objectAtIndex(v6, j);
cocos2d::CCArray::addObject(v9, v10);
}
}
}