//
// GameManager::getNextUsedKey from 0x5ed908 to 0x5ed9bc (180 bytes)
//
// 2 xrefs:
// > GameManager::reorderKey @ 0x5ed9d4
// > ??> @ 0x438c0
//
// 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 GameManager::getNextUsedKey(GameManager *a1, int a2, bool a3)
{
_BOOL4 v4; // w23
unsigned int v5; // w19
int v6; // w21
cocos2d::CCArray *OrderedCustomObjectKeys; // x20
cocos2d::CCString *v8; // x0
int v9; // w0
int result; // w0
unsigned int v11; // w19
cocos2d::CCString *v12; // x0
v4 = a3;
v5 = 0;
v6 = 0;
OrderedCustomObjectKeys = GameManager::getOrderedCustomObjectKeys(a1);
while ( 1 )
{
if ( v5 >= (unsigned int)cocos2d::CCArray::count(OrderedCustomObjectKeys) )
return 0;
v8 = cocos2d::CCArray::stringAtIndex(OrderedCustomObjectKeys, v5);
v9 = cocos2d::CCString::intValue(v8);
if ( v9 == a2 )
break;
++v5;
v6 = v9;
}
result = v6;
if ( !v4 )
{
v11 = v5 + 1;
if ( v11 >= (unsigned int)cocos2d::CCArray::count(OrderedCustomObjectKeys) )
return 0;
v12 = cocos2d::CCArray::stringAtIndex(OrderedCustomObjectKeys, v11);
return cocos2d::CCString::intValue(v12);
}
return result;
}