//
// GameStatsManager::getPathRewardKey from 0x8dfaac to 0x8dfc38 (396 bytes)
//
// 15 xrefs:
// > GameStatsManager::tryFixPathBug @ 0x8e006c
// > GameStatsManager::isPathChestUnlocked @ 0x8e01d0
// > GameStatsManager::createSpecialChestItems @ 0x8e5a94
// > GameStatsManager::createSpecialChestItems @ 0x8e5b40
// > GameStatsManager::createSpecialChestItems @ 0x8e5bf0
// > GameStatsManager::createSpecialChestItems @ 0x8e5c80
// > GameStatsManager::createSpecialChestItems @ 0x8e5d30
// > GameStatsManager::createSpecialChestItems @ 0x8e5ddc
// > GameStatsManager::createSpecialChestItems @ 0x8e5e8c
// > GameStatsManager::createSpecialChestItems @ 0x8e5f38
// > GameStatsManager::createSpecialChestItems @ 0x8e5fe8
// > GameStatsManager::createSpecialChestItems @ 0x8e6094
// > GameStatsManager::createSpecialChestItems @ 0x8e6134
// > GameStatsManager::unlockPathChest @ 0x8eb018
// > ??> @ 0x5a490
//
// 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 12:56:49 +0000
//
unsigned __int64 *__usercall GameStatsManager::getPathRewardKey@(unsigned int a1@, unsigned __int64 *a2@)
{
size_t v4; // x21
const char *v5; // x24
size_t v6; // x0
size_t v7; // x21
unsigned __int64 v8; // x23
void *v9; // x3
size_t v11; // [xsp+48h] [xbp+48h] BYREF
unsigned __int64 v12; // [xsp+50h] [xbp+50h]
char *v13; // [xsp+58h] [xbp+58h]
_BYTE v14[504]; // [xsp+60h] [xbp+60h] BYREF
v13 = v14;
v12 = 500;
qmemcpy(v14, "pr_", 3);
v11 = 3;
fmt::BasicWriter::FormatInt,char>>(&v11, a1);
v4 = v11;
if ( v11 + 1 > v12 )
fmt::internal::Array::grow(&v11, v11 + 1);
v13[v4] = 0;
*a2 = 0;
v5 = v13;
a2[1] = 0;
a2[2] = 0;
v6 = strlen(v5);
v7 = v6;
if ( v6 > 0xFFFFFFFFFFFFFFEFLL )
sub_62CC1C();
if ( v6 <= 0x16 )
{
*(_BYTE *)a2 = 2 * v6;
v9 = (char *)a2 + 1;
if ( !v6 )
goto LABEL_7;
}
else
{
v8 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v9 = (void *)operator new(v8);
a2[2] = (unsigned __int64)v9;
a2[1] = v7;
*a2 = v8 | 1;
}
v9 = memcpy(v9, v5, v7);
LABEL_7:
*((_BYTE *)v9 + v7) = 0;
if ( v13 != v14 && v13 )
operator delete[](v13);
return a2;
}