//
// gen_random from 0x3bed00 to 0x3bed92 (146 bytes)
//
// 12 xrefs:
// > GameLevelManager::uploadLevel @ 0x3cf956
// > GameLevelManager::downloadLevel @ 0x3d00d2
// > GameLevelManager::rateStars @ 0x3d04aa
// > GameLevelManager::getLevelLeaderboard @ 0x3d0fa2
// > GameLevelManager::getLevelLeaderboard @ 0x3d1006
// > GameLevelManager::likeItem @ 0x3d3832
// > GameLevelManager::getGJSecretReward @ 0x3d3c60
// > GameLevelManager::getGJRewards @ 0x3d3ebc
// > GameLevelManager::getGJChallenges @ 0x3d4082
// > GameLevelManager::getGJDailyLevelState @ 0x3d426c
// > GameLevelManager::uploadLevelList @ 0x3d4fa2
// > GameLevelManager::updateUserScore @ 0x3d63bc
//
// 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 gen_random(int a1, int a2)
{
const std::string *v4; // r1
cocos2d::CCString *v5; // r6
int v6; // r7
const char *CString; // r6
unsigned int v8; // r1
char *v9; // r0
char v11; // [sp+8h] [bp-Ch] BYREF
sub_776584((int)&v11, (char *)&unk_939830);
v5 = (cocos2d::CCString *)cocos2d::CCString::create((cocos2d::CCString *)&v11, v4);
sub_774008(&v11);
v6 = 0;
while ( v6 < a2 )
{
++v6;
CString = cocos2d::CCString::getCString(v5);
v8 = rand() % 0x3Eu;
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s%c",
CString,
(unsigned __int8)a0123456789abcd_1[v8]);
}
v9 = (char *)cocos2d::CCString::getCString(v5);
sub_776584(a1, v9);
return a1;
}