//
// sub_10004BBE8 from 0x10004bbe8 to 0x10004bcf8 (272 bytes)
//
// 2 xrefs:
// > sub_1000A65B0 @ 0x1000a6608
// > GJMultiplayerManager::uploadComment @ 0x1002676fc
//
// This function is hookable on this platform (idp: arm, 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 10:57:41 +0000
//
void __usercall sub_10004BBE8(int a1@, std::string *a2@)
{
unsigned __int8 v4; // w8
int v5; // w0
std::random_device::result_type v6; // w0
__int64 i; // x8
__int64 v8; // [xsp+0h] [xbp-30h] BYREF
std::random_device v9; // [xsp+Ch] [xbp-24h] BYREF
v4 = atomic_load((unsigned __int8 *)&byte_1009F32E8);
if ( (v4 & 1) == 0 && __cxa_guard_acquire((__guard *)&byte_1009F32E8) )
{
sub_10004BD3C(&v9);
v6 = std::random_device::operator()(&v9);
dword_1009F2920[0] = v6;
for ( i = 1; i != 624; ++i )
{
v6 = i + 1812433253 * (v6 ^ (v6 >> 30));
dword_1009F2920[i] = v6;
}
qword_1009F32E0 = 0;
std::random_device::~random_device(&v9);
__cxa_guard_release((__guard *)&byte_1009F32E8);
}
v8 = 0x3D00000000LL;
a2->__r_.__value_.__l.__size_ = 0;
a2->__r_.__value_.__r.__words[2] = 0;
a2->__r_.__value_.__r.__words[0] = 0;
std::string::reserve(a2, a1);
if ( a1 >= 1 )
{
do
{
v5 = sub_1000503A8(&v8, dword_1009F2920, &v8);
std::string::push_back(a2, a0123456789abcd[v5]);
--a1;
}
while ( a1 );
}
}