//
// GameManager::getNextUniqueObjectKey from 0x100384440 to 0x1003844d1 (145 bytes)
//
// 0 xrefs:
//
// 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::getNextUniqueObjectKey(GameManager *a1)
{
cocos2d::CCArray *v1; // rbx
cocos2d::ccArray *data; // rax
cocos2d::CCString **arr; // r14
unsigned __int64 v4; // r15
int v5; // ebx
int v6; // eax
v1 = cocos2d::CCDictionary::allKeys(a1->m_customObjectDict);
if ( (unsigned int)sub_100720070(v1) )
{
qsort(v1->data->arr, v1->data->num, 8u, (int (__cdecl *)(const void *, const void *))sub_1003768B0);
}
else if ( !v1 )
{
return -1;
}
data = v1->data;
if ( !data->num )
return -1;
arr = (cocos2d::CCString **)data->arr;
v4 = (unsigned __int64)&arr[data->num - 1];
v5 = 0;
do
{
if ( !*arr )
break;
v6 = cocos2d::CCString::intValue(*arr);
if ( v6 < v5 )
v5 = v6;
++arr;
}
while ( (unsigned __int64)arr <= v4 );
return v5 - 1;
}