//
// GameStatsManager::usernameForAccountID from 0x1000654fc to 0x100065570 (116 bytes)
//
// 2 xrefs:
// > GameLevelManager::tryGetUsername @ 0x100093814
// > ItemInfoPopup::init @ 0x100308ed0
//
// 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 *__usercall GameStatsManager::usernameForAccountID@(_QWORD *result@, int a2@, _QWORD *a3@)
{
__int64 v3; // x10
_QWORD *v4; // x9
__int128 v5; // q0
v3 = result[108];
if ( !v3 )
return sub_100009900(a3, "");
v4 = result + 108;
do
{
if ( *(_DWORD *)(v3 + 32) >= a2 )
v4 = (_QWORD *)v3;
v3 = *(_QWORD *)(v3 + 8LL * (*(_DWORD *)(v3 + 32) < a2));
}
while ( v3 );
if ( v4 == result + 108 || *((_DWORD *)v4 + 8) > a2 )
return sub_100009900(a3, "");
if ( *((char *)v4 + 63) < 0 )
return sub_1000097D0(a3, (void *)v4[5], v4[6]);
v5 = *(_OWORD *)(v4 + 5);
a3[2] = v4[7];
*(_OWORD *)a3 = v5;
return result;
}