//
// GameManager::getNextUsedKey from 0x1003192c4 to 0x100319398 (212 bytes)
//
// 1 xrefs:
// > GameManager::reorderKey @ 0x100319504
//
// 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 __fastcall GameManager::getNextUsedKey(GameManager *a1, int a2, bool a3)
{
int v3; // w23
cocos2d::CCArray *OrderedCustomObjectKeys; // x21
unsigned int v7; // w22
__int64 v8; // x25
cocos2d::CCString *v9; // x0
unsigned int v10; // w0
unsigned int v11; // w24
__int64 v12; // x26
cocos2d::CCString *v13; // x0
OrderedCustomObjectKeys = GameManager::getOrderedCustomObjectKeys(a1);
if ( !(unsigned int)sub_10024A36C((__int64)OrderedCustomObjectKeys) )
return 0;
v7 = 0;
v8 = 0;
while ( 1 )
{
v9 = cocos2d::CCArray::stringAtIndex(OrderedCustomObjectKeys, v7);
v10 = cocos2d::CCString::intValue(v9);
v11 = v10;
if ( v10 == a2 )
v12 = (unsigned int)v8;
else
v12 = v10;
if ( v10 == a2 )
{
v3 = v8;
if ( !a3 )
{
if ( v7 + 1 >= (unsigned int)sub_10024A36C((__int64)OrderedCustomObjectKeys) )
{
v3 = 0;
}
else
{
v13 = cocos2d::CCArray::stringAtIndex(OrderedCustomObjectKeys, v7 + 1);
v3 = cocos2d::CCString::intValue(v13);
}
v12 = v8;
}
}
if ( v11 == a2 )
break;
++v7;
v8 = v12;
if ( v7 >= (unsigned int)sub_10024A36C((__int64)OrderedCustomObjectKeys) )
return 0;
}
return v3;
}