//
// sub_1004EF000 from 0x1004ef000 to 0x1004ef138 (312 bytes)
//
// 8 xrefs:
// > GameLevelManager::createNewLevel @ 0x10053e31b
// > sub_10053E630 @ 0x10053e690
// > GameLevelManager::writePlatformerSaveJournal @ 0x10054c734
// > sub_10054CB00 @ 0x10054cc81
// > GameLevelManager::replayPlatformerSaveJournal @ 0x10054d43f
// > GJGameLevel::dataLoaded @ 0x10058a68e
// > GJGameLevel::encodeWithCoder @ 0x10058bd4a
// > GJMultiplayerManager::uploadComment @ 0x10073ab77
//
// 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:31:23 +0000
//
std::string *__fastcall sub_1004EF000(std::string *this, int a2)
{
int v2; // r14d
int v4; // eax
std::random_device::result_type v6; // eax
int v7; // ecx
__int64 i; // rdx
unsigned int v9; // edi
int v10; // r8d
__int64 v11; // [rsp+Ch] [rbp-34h] BYREF
std::random_device v12; // [rsp+14h] [rbp-2Ch] BYREF
v2 = a2;
if ( !(_BYTE)byte_100BE50E8 && __cxa_guard_acquire(&byte_100BE50E8) )
{
sub_1004EF190(&v12);
v6 = std::random_device::operator()(&v12);
dword_100BE4720[0] = v6;
v7 = 1;
for ( i = 2; ; i += 2 )
{
v9 = v7 + 1812433253 * (v6 ^ (v6 >> 30));
dword_100BE4720[i - 1] = v9;
if ( i == 624 )
break;
v10 = v9 ^ (v9 >> 30);
v6 = 1812433253 * v10 + v7 + 1;
dword_100BE4720[i] = i + 1812433253 * v10;
v7 += 2;
}
qword_100BE50E0 = 0;
std::random_device::~random_device(&v12);
__cxa_guard_release(&byte_100BE50E8);
}
v11 = 0x3D00000000LL;
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
std::string::reserve(this, a2);
if ( a2 > 0 )
{
do
{
v4 = sub_1004F6DD0(&v11, dword_100BE4720, &v11);
std::string::push_back(this, a0123456789abcd_1[v4]);
--v2;
}
while ( v2 );
}
return this;
}