//
// GameStatsManager::awardSecretKey from 0x1402f65e0 to 0x1402f669a (186 bytes)
//
// 3 xrefs:
// > PlayLayer::levelComplete @ 0x140506d66
// > PlayLayer::destroyPlayer @ 0x140513292
// > ??> @ 0x14091e164
//
// 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:30:04 +0000
//
char __fastcall GameStatsManager::awardSecretKey(_DWORD *a1)
{
int Stat; // eax
int v3; // ebx
int v5; // ebx
float v6; // xmm0_4
Stat = GameStatsManager::getStat((__int64)a1, "22");
v3 = a1[218] - a1[219];
if ( floorf((float)Stat / 500.0) <= (float)v3 )
return 0;
v5 = v3 + 1;
a1[220] = v5;
v6 = (float)((float)rand() / 32767.0) * 1000.0;
a1[219] = (int)v6;
a1[218] = v5 + (int)v6;
GameStatsManager::incrementStat((__int64)a1, (const char *)&word_140737620, 1u);
return 1;
}