//
// GJAccountManager::linkToAccount from 0x1003a12ac to 0x1003a13a4 (248 bytes)
//
// 1 xrefs:
// > AccountLoginLayer::loginAccountFinished @ 0x100083f3c
//
// 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
//
void __fastcall GJAccountManager::linkToAccount(__int64 a1, const std::string *a2, std::string *__str, int a4, int a5)
{
GameManager *v9; // x21
GameManager *v10; // x21
float v11; // s0
void (__fastcall ***v12)(_QWORD); // x0
GameManager *v13; // x0
std::string __p; // [xsp+0h] [xbp-50h] BYREF
std::string::operator=((std::string *)(a1 + 368), __str);
std::string::operator=((std::string *)(a1 + 328), a2);
*(_DWORD *)(a1 + 352) = a4;
v9 = GameManager::sharedState();
if ( *(char *)(a1 + 351) < 0 )
sub_1000097D0(&__p, *(void **)(a1 + 328), *(_QWORD *)(a1 + 336));
else
__p = *(std::string *)(a1 + 328);
std::string::operator=((std::string *)&v9->m_playerName, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v10 = GameManager::sharedState();
v10->m_playerUserID.value = a5;
v11 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v10->m_playerUserID.seed = (int)v11;
v10->m_playerUserID.random = (int)v11 + a5;
v12 = *(void (__fastcall ****)(_QWORD))(a1 + 408);
if ( v12 )
(**v12)(v12);
v13 = GameManager::sharedState();
GameManager::accountStatusChanged(v13);
}