//
// ProfilePage::onCopyName from 0x1008a3df0 to 0x1008a3fdb (491 bytes)
//
// 1 xrefs:
// > ProfilePage::loadPageFromUserInfo @ 0x1008a110a
//
// 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:37:15 +0000
//
void __fastcall ProfilePage::onCopyName(_QWORD *a1)
{
__int64 *v2; // rax
__int64 v3; // r8
__int64 v4; // r9
__int64 v5; // rcx
__int64 v6; // rdx
char v7; // al
const std::string::value_type *size; // rsi
std::string::size_type v9; // rdi
__int64 v10; // rcx
char *v11; // rax
std::string v12; // [rsp+0h] [rbp-80h] BYREF
__int128 v13; // [rsp+18h] [rbp-68h] BYREF
void *v14; // [rsp+28h] [rbp-58h]
__int128 v15; // [rsp+30h] [rbp-50h] BYREF
void *__p; // [rsp+40h] [rbp-40h]
_BYTE v17[24]; // [rsp+48h] [rbp-38h] BYREF
std::string v18; // [rsp+60h] [rbp-20h] BYREF
if ( !a1[91] )
return;
v2 = (__int64 *)GameLevelManager::sharedState();
GameLevelManager::tryGetUsername(&v18, v2, *(_DWORD *)(a1[91] + 376LL));
v5 = (__int64)v18.__r_.__value_.__l.0;
v6 = *(_BYTE *)&v18.__r_.__value_.__l.0 >> 1;
v7 = *(_BYTE *)&v18.__r_.__value_.__s.0 & 1;
size = (const std::string::value_type *)v18.__r_.__value_.__l.__size_;
v9 = v18.__r_.__value_.__l.__size_;
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) == 0 )
v9 = *(_BYTE *)&v18.__r_.__value_.__l.0 >> 1;
if ( v9 )
{
if ( v7 )
v6 = v18.__r_.__value_.__l.__size_;
if ( v6 )
goto LABEL_8;
LABEL_16:
size = "-";
std::string::assign(&v18, "-");
v5 = (__int64)v18.__r_.__value_.__l.0;
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_9;
LABEL_17:
size = v18.__r_.__value_.__l.__data_;
sub_10001AD30(&v15, v18.__r_.__value_.__l.__data_, v18.__r_.__value_.__l.__size_);
goto LABEL_18;
}
v10 = a1[91];
if ( (*(_BYTE *)(v10 + 320) & 1) == 0 )
{
v12 = *(std::string *)(v10 + 320);
if ( !v7 )
goto LABEL_13;
goto LABEL_12;
}
sub_10001AD30(&v12, *(const void **)(v10 + 336), *(_QWORD *)(v10 + 328));
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
LABEL_12:
operator delete(v18.__r_.__value_.__l.__data_);
LABEL_13:
v18 = v12;
v5 = (__int64)v12.__r_.__value_.__l.0;
size = (const std::string::value_type *)v12.__r_.__value_.__l.__size_;
v6 = *(_BYTE *)&v12.__r_.__value_.__l.0 >> 1;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) != 0 )
v6 = v12.__r_.__value_.__l.__size_;
if ( !v6 )
goto LABEL_16;
LABEL_8:
if ( (v5 & 1) != 0 )
goto LABEL_17;
LABEL_9:
__p = v18.__r_.__value_.__l.__data_;
v15 = *(_OWORD *)&v18.__r_.__value_.__l.0;
LABEL_18:
PlatformToolbox::copyToClipboard((__int64)&v15, (__int64)size, v6, v5, v3, v4);
if ( (v15 & 1) != 0 )
operator delete(__p);
strcpy(v17, "&Copied to clipboard");
LOWORD(v13) = 0;
v11 = TextAlertPopup::create((__int128 *)v17, 0x96u, &v13, 0.5, 0.60000002);
(*(void (__fastcall **)(_QWORD *, char *, __int64))(*a1 + 464LL))(a1, v11, 100);
if ( (v13 & 1) != 0 )
{
operator delete(v14);
if ( (v17[0] & 1) == 0 )
{
LABEL_22:
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) == 0 )
return;
goto LABEL_23;
}
}
else if ( (v17[0] & 1) == 0 )
{
goto LABEL_22;
}
operator delete(*(void **)&v17[16]);
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
LABEL_23:
operator delete(v18.__r_.__value_.__l.__data_);
}