//
// GameManager::colorKey from 0x5f2b78 to 0x5f2cf0 (376 bytes)
//
// 4 xrefs:
// > GameManager::isColorUnlocked @ 0x5f2d5c
// > GameManager::unlockColor @ 0x5f3530
// > GameManager::lockColor @ 0x5f4238
// > ??> @ 0x4c488
//
// 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
//
__int64 __usercall GameManager::colorKey@(unsigned int a1@, int a2@, __int64 a3@)
{
size_t v5; // x24
size_t v6; // x22
size_t v7; // x22
size_t v9; // [xsp+68h] [xbp+68h] BYREF
unsigned __int64 v10; // [xsp+70h] [xbp+70h]
char *v11; // [xsp+78h] [xbp+78h]
_BYTE v12[504]; // [xsp+80h] [xbp+80h] BYREF
v11 = v12;
v9 = 1;
v10 = 500;
v12[0] = 99;
fmt::BasicWriter::FormatInt,char>>(&v9, a2 == 2);
v5 = v9;
v6 = v9 + 1;
if ( v9 + 1 > v10 )
fmt::internal::Array::grow(&v9, v9 + 1);
v9 = v6;
v11[v5] = aOSecret[8];
fmt::BasicWriter::FormatInt,char>>(&v9, a1);
v7 = v9;
if ( v10 < v9 + 1 )
fmt::internal::Array::grow(&v9, v9 + 1);
v11[v7] = 0;
sub_D153B8(a3, v11);
if ( v11 != v12 && v11 )
operator delete[](v11);
return a3;
}