//
// GameLevelManager::storeUserName from 0x847bf4 to 0x847e0c (536 bytes)
//
// 15 xrefs:
// > GameLevelManager::storeUserNames @ 0x848030
// > GameLevelManager::createAndGetScores @ 0x8494e8
// > GameLevelManager::updateUsernames @ 0x84a098
// > GameLevelManager::storeUserInfo @ 0x84a1a8
// > GameLevelManager::onGetUserMessagesCompleted @ 0x84a76c
// > GameLevelManager::createAndGetCommentsFull @ 0x84ad84
// > GameLevelManager::onAdminGetReportQueueCompleted @ 0x84bfc8
// > GameLevelManager::onAdminGetAccountReviewCompleted @ 0x84c868
// > GameLevelManager::storeThreadManifest @ 0x84ce44
// > GameLevelManager::storeThreadManifest @ 0x84d084
// > GameLevelManager::onGetUserSearchCompleted @ 0x84e7e0
// > GameLevelManager::onGetFriendRequestsCompleted @ 0x84ecc4
// > GameLevelManager::onGetUserListCompleted @ 0x84f25c
// > ProfilePage::init @ 0xa5c5bc
// > ??> @ 0xfc430
//
// This function is hookable on this platform (idp: arm, 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:55:21 +0000
//
__int64 __fastcall GameLevelManager::storeUserName(_QWORD *a1, int a2, int a3, char *a4)
{
unsigned __int64 v6; // x1
__int64 *v7; // x0
const void *v8; // x1
size_t v9; // x2
__int64 v10; // x24
const char *v11; // x1
size_t v12; // x0
cocos2d::CCObject *v13; // x25
cocos2d::CCString *v14; // x0
size_t v15; // x0
cocos2d::CCDictionary *v16; // x23
cocos2d::CCObject *v17; // x0
cocos2d::CCDictionary *v18; // x22
cocos2d::CCObject *v19; // x0
char *v21; // [xsp+50h] [xbp+50h]
char *v22; // [xsp+50h] [xbp+50h]
char *CString; // [xsp+50h] [xbp+50h]
char *v24; // [xsp+5Ch] [xbp+5Ch] BYREF
__int64 v25[2]; // [xsp+68h] [xbp+68h] BYREF
void *v26; // [xsp+78h] [xbp+78h]
__int64 v27[2]; // [xsp+80h] [xbp+80h] BYREF
void *v28; // [xsp+90h] [xbp+90h]
LODWORD(v24) = a3;
if ( a3 > 0 )
{
v6 = (unsigned __int8)*a4 >> 1;
if ( (*a4 & 1) != 0 )
v6 = *((_QWORD *)a4 + 1);
if ( v6 > 1 )
{
v21 = a4;
v7 = (__int64 *)std::unordered_map::operator[]((__int64)(a1 + 125), (int *)&v24);
a4 = v21;
if ( v21 != (char *)v7 )
{
if ( (*v21 & 1) != 0 )
{
v8 = *((const void **)v21 + 2);
v9 = *((_QWORD *)v21 + 1);
}
else
{
v8 = v21 + 1;
v9 = (unsigned __int8)*v21 >> 1;
}
std::string::assign(v7, v8, v9);
a4 = v21;
}
}
}
if ( a2 > 0 )
{
v10 = a1[122];
v11 = a4 + 1;
if ( (*a4 & 1) != 0 )
v11 = *((const char **)a4 + 2);
v22 = (char *)v11;
v25[0] = 0;
v25[1] = 0;
v26 = nullptr;
v12 = strlen(v11);
std::string::__init(v25, v22, v12);
v13 = (cocos2d::CCObject *)cocos2d::CCString::create(v25);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a2);
CString = (char *)cocos2d::CCString::getCString(v14);
v27[0] = 0;
v27[1] = 0;
v28 = nullptr;
v15 = strlen(CString);
std::string::__init(v27, CString, v15);
cocos2d::CCDictionary::setObject(v10, v13);
if ( (v27[0] & 1) != 0 )
operator delete(v28);
if ( (v25[0] & 1) != 0 )
operator delete(v26);
if ( (int)v24 > 0 )
{
v16 = (cocos2d::CCDictionary *)a1[124];
v17 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)v24);
cocos2d::CCDictionary::setObject(v16, v17, a2);
v18 = (cocos2d::CCDictionary *)a1[123];
v19 = (cocos2d::CCObject *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(unsigned int)a2);
cocos2d::CCDictionary::setObject(v18, v19, (int)v24);
}
}
return _stack_chk_guard;
}