//
// GameLevelManager::getHighestLevelOrder from 0x3bf788 to 0x3bf7be (54 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::downloadLevel @ 0x3b195c
// > LevelInfoLayer::FLAlert_Clicked @ 0x3b2ac8
//
// 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
//
int GameLevelManager::getHighestLevelOrder(GameLevelManager *a1)
{
int result; // r0
int v2; // r3
int v3; // r2
int v4; // r3
int v5; // r1
result = (int)a1->m_onlineLevels;
if ( result )
{
v2 = *(_DWORD *)(result + 52);
if ( v2 )
v3 = *(_DWORD *)(v2 + 272);
else
v3 = 0;
result = 0;
while ( v2 )
{
v4 = *(_DWORD *)(*(_DWORD *)(v2 + 260) + 380);
if ( result < v4 )
result = v4;
if ( v3 )
v5 = *(_DWORD *)(v3 + 272);
else
v5 = 0;
v2 = v3;
v3 = v5;
}
}
return result;
}