//
// GameManager::getNextUniqueObjectKey from 0x10036da90 to 0x10036db21 (145 bytes)
//
// 0 xrefs:
//
// 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 12:29:01 +0000
//
__int64 __fastcall GameManager::getNextUniqueObjectKey(__int64 a1)
{
__int64 v1; // rbx
unsigned int *v2; // rax
_QWORD *v3; // r14
unsigned __int64 v4; // r15
int v5; // ebx
int v6; // eax
v1 = cocos2d::CCDictionary::allKeys(*(_QWORD *)(a1 + 456));
if ( (unsigned int)sub_1007FEF90(v1) )
{
qsort(
*(void **)(*(_QWORD *)(v1 + 56) + 16LL),
**(unsigned int **)(v1 + 56),
8u,
(int (__cdecl *)(const void *, const void *))sub_10035FC40);
}
else if ( !v1 )
{
return (unsigned int)-1;
}
v2 = *(unsigned int **)(v1 + 56);
if ( !*v2 )
return (unsigned int)-1;
v3 = *((_QWORD **)v2 + 2);
v4 = (unsigned __int64)&v3[*v2 - 1];
v5 = 0;
do
{
if ( !*v3 )
break;
v6 = cocos2d::CCString::intValue(*v3);
if ( v6 < v5 )
v5 = v6;
++v3;
}
while ( (unsigned __int64)v3 <= v4 );
return (unsigned int)(v5 - 1);
}