//
// GameStatsManager::usernameForAccountID from 0xa811e0 to 0xa812a0 (192 bytes)
//
// 3 xrefs:
// > GameLevelManager::tryGetUsername @ 0x6f7014
// > ItemInfoPopup::init @ 0x795554
// > ??> @ 0x306d8
//
// 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 GameStatsManager::usernameForAccountID@(
__int64 *__return_ptr a1@,
GameStatsManager *this@,
int a3@)
{
std::_rb_tree_base *p_m_header; // x4
std::_rb_tree_base *m_parent; // x0
std::_rb_tree_base *v5; // x3
p_m_header = &this->m_usernameForAccountID.m_header;
m_parent = this->m_usernameForAccountID.m_header.m_parent;
if ( !m_parent )
goto LABEL_11;
v5 = p_m_header;
do
{
while ( *(_DWORD *)&m_parent[1].m_isblack >= a3 )
{
v5 = m_parent;
m_parent = m_parent->m_left;
if ( !m_parent )
goto LABEL_5;
}
m_parent = m_parent->m_right;
}
while ( m_parent );
LABEL_5:
if ( p_m_header == v5 || *(_DWORD *)&v5[1].m_isblack > a3 )
{
LABEL_11:
sub_D153B8((int)a1, &byte_F288A0);
return a1;
}
else
{
sub_D18D28(a1);
return a1;
}
}