//
// GameStatsManager::usernameForAccountID from 0x10032b6a0 to 0x10032b724 (132 bytes)
//
// 2 xrefs:
// > ItemInfoPopup::init @ 0x100372822
// > GameLevelManager::tryGetUsername @ 0x10052e978
//
// 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
//
_QWORD *__fastcall GameStatsManager::usernameForAccountID(_QWORD *a1, __int64 a2, int a3, double a4)
{
__int64 v4; // rcx
__int64 v5; // rsi
__int64 v6; // rax
__int64 v8; // rax
v4 = *(_QWORD *)(a2 + 864);
if ( !v4 )
goto LABEL_8;
v5 = a2 + 864;
v6 = v5;
do
{
if ( *(_DWORD *)(v4 + 32) >= a3 )
v6 = v4;
v4 = *(_QWORD *)(v4 + 8LL * (*(_DWORD *)(v4 + 32) < a3));
}
while ( v4 );
if ( v6 == v5 || *(_DWORD *)(v6 + 32) > a3 )
{
LABEL_8:
*(_WORD *)a1 = 0;
return a1;
}
if ( (*(_BYTE *)(v6 + 40) & 1) == 0 )
{
v8 = v6 + 40;
a1[2] = *(_QWORD *)(v8 + 16);
*(_OWORD *)a1 = *(_OWORD *)v8;
return a1;
}
sub_100006B70(a1, *(const void **)(v6 + 56), *(_QWORD *)(v6 + 48), a4);
return a1;
}