//
// GameLevelManager::getLeaderboardKey from 0x1005628a0 to 0x100562954 (180 bytes)
//
// 14 xrefs:
// > LeaderboardsLayer::init @ 0x1005133ec
// > LeaderboardsLayer::init @ 0x100513436
// > LeaderboardsLayer::init @ 0x100513480
// > LeaderboardsLayer::init @ 0x1005134ca
// > LeaderboardsLayer::init @ 0x100513511
// > LeaderboardsLayer::init @ 0x10051355b
// > LeaderboardsLayer::init @ 0x1005135a5
// > LeaderboardsLayer::init @ 0x1005135ef
// > LeaderboardsLayer::init @ 0x100513636
// > LeaderboardsLayer::init @ 0x100513680
// > LeaderboardsLayer::init @ 0x1005136ca
// > LeaderboardsLayer::init @ 0x100513714
// > LeaderboardsLayer::selectLeaderboard @ 0x1005145cd
// > LeaderboardsLayer::isCorrect @ 0x100514ec0
//
// 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 12:32:09 +0000
//
_QWORD *__fastcall GameLevelManager::getLeaderboardKey(_QWORD *a1)
{
char v1; // al
__int64 v2; // rax
const char *CString; // r15
size_t v4; // rax
size_t v5; // r14
void *v6; // r12
size_t v7; // r13
v2 = sub_10088E820("lb_%i_%i", v1);
CString = (const char *)cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = operator new(v7);
a1[2] = v6;
*a1 = v7 + 1;
a1[1] = v5;
}
else
{
*(_BYTE *)a1 = 2 * v4;
v6 = (char *)a1 + 1;
if ( !v4 )
goto LABEL_9;
}
memmove(v6, CString, v5);
LABEL_9:
*((_BYTE *)v6 + v5) = 0;
return a1;
}