//
// GameLevelManager::userNameForUserID from 0x807c1c to 0x807dac (400 bytes)
//
// 6 xrefs:
// > CommentCell::loadFromComment @ 0x74c218
// > LevelBrowserLayer::getSearchTitle @ 0x7f80ec
// > LevelBrowserLayer::getSearchTitle @ 0x7f81d0
// > GameLevelManager::tryGetUsername @ 0x842fec
// > GJGameLevel::create @ 0x843b80
// > ??> @ 0x77e18
//
// 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:54:46 +0000
//
__int64 *__usercall GameLevelManager::userNameForUserID@(
__int64 *__return_ptr a1@,
GameLevelManager *this@,
const char *a3@)
{
__int64 v4; // x24
cocos2d::CCString *v5; // x0
const char *CString; // x25
size_t v7; // x0
size_t v8; // x20
char *v9; // x3
cocos2d::CCString *v10; // x20
const char *v11; // x0
size_t v12; // x0
unsigned __int64 v14; // x0
char *v15; // [xsp+58h] [xbp+58h]
__int64 v16; // [xsp+60h] [xbp+60h] BYREF
size_t v17; // [xsp+68h] [xbp+68h]
void *v18; // [xsp+70h] [xbp+70h]
if ( (int)a3 <= 0 )
goto LABEL_12;
v4 = *((_QWORD *)this + 122);
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a3);
v16 = 0;
CString = (const char *)cocos2d::CCString::getCString(v5);
v17 = 0;
v18 = nullptr;
v7 = strlen(CString);
v8 = v7;
if ( v7 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v7 > 0x16 )
{
v14 = (v7 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v16 = v14 | 1;
v9 = (char *)operator new(v14);
v18 = v9;
v17 = v8;
}
else
{
LOBYTE(v16) = 2 * v7;
v9 = (char *)&v16 + 1;
if ( !v7 )
goto LABEL_5;
}
v9 = (char *)memcpy(v9, CString, v8);
LABEL_5:
v9[v8] = 0;
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v4, &v16);
if ( (v16 & 1) != 0 )
{
operator delete(v18);
if ( v10 )
goto LABEL_7;
LABEL_12:
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
std::string::__init(a1, &byte_1191DE0, 1u);
return a1;
}
if ( !v10 )
goto LABEL_12;
LABEL_7:
v11 = (const char *)cocos2d::CCString::getCString(v10);
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
v15 = (char *)v11;
v12 = strlen(v11);
std::string::__init(a1, v15, v12);
return a1;
}