//
// EditorUI::getRandomStartKey from 0x1401f8f90 to 0x1401f9224 (660 bytes)
//
// 4 xrefs:
// > EditorUI::processSmartObjectsFromType @ 0x1401b7f45
// > ??> @ 0x1408a37f4
// > ??> @ 0x1408a3804
// > ??> @ 0x14091ab28
//
// 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 11:28:10 +0000
//
__int64 __fastcall EditorUI::getRandomStartKey(int a1)
{
int v1; // ecx
int v2; // ecx
int v3; // ecx
int v4; // ecx
__int64 result; // rax
int v6; // ecx
int v7; // ecx
int v8; // ecx
unsigned int v9; // ebx
if ( a1 > 1861 )
{
if ( a1 == 2703 )
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
return (unsigned int)((int)floorf(
(float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)
+ (float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)) != 0)
+ 2703;
}
else
{
v9 = 2838;
if ( a1 == 2838 )
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
if ( (int)floorf(
(float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)
+ (float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)) )
return 2840;
return v9;
}
}
}
else if ( a1 == 1861 )
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
v7 = (int)floorf((float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0) * 4.0);
if ( v7 )
{
v8 = v7 - 1;
if ( v8 )
{
if ( v8 == 1 )
return 1863;
else
return 1864;
}
else
{
return 1862;
}
}
else
{
return 1861;
}
}
else
{
v1 = a1 - 869;
if ( v1 )
{
v2 = v1 - 562;
if ( v2 )
{
if ( v2 == 30 )
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
v3 = (int)floorf((float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0) * 4.0);
if ( v3 )
{
v4 = v3 - 1;
if ( v4 )
{
if ( v4 == 1 )
return 1463;
else
return 1464;
}
else
{
return 1462;
}
}
else
{
return 1461;
}
}
}
else
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
v6 = (int)floorf((float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0) * 3.0);
if ( v6 )
{
if ( v6 == 1 )
return 1432;
else
return 1433;
}
else
{
return 1431;
}
}
}
else
{
qword_14090BFA8 = 214013 * qword_14090BFA8 + 2531011;
return (unsigned int)((int)floorf(
(float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)
+ (float)((float)(((unsigned __int64)qword_14090BFA8 >> 16) & 0x7FFF) / 32767.0)) != 0)
+ 869;
}
}
return result;
}