//
// GameLevelManager::userNameForUserID from 0x14021d7e0 to 0x14021d964 (388 bytes)
//
// 7 xrefs:
// > CommentCell::loadFromComment @ 0x140152028
// > GameLevelManager::tryGetUsername @ 0x14021da4e
// > GJGameLevel::create @ 0x14026309e
// > LevelBrowserLayer::getSearchTitle @ 0x1403e5c99
// > LevelBrowserLayer::getSearchTitle @ 0x1403e5e20
// > ??> @ 0x14091baa0
// > ??> @ 0x14091baac
//
// 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 11:28:23 +0000
//
// Hidden C++ exception states: #wind=1
_QWORD *__fastcall GameLevelManager::userNameForUserID(__int64 a1, _QWORD *a2, int a3)
{
cocos2d::CCString *v5; // rax
const char *CString; // rax
size_t v7; // rdi
size_t v8; // r8
cocos2d::CCString *v9; // rsi
void *v10; // r8
const char *v11; // rax
void *Block[2]; // [rsp+40h] [rbp-48h] BYREF
__m128i si128; // [rsp+50h] [rbp-38h]
if ( a3 > 0 )
{
v5 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)a3);
CString = cocos2d::CCString::getCString(v5);
*(_OWORD *)Block = 0;
si128 = 0;
v7 = -1;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003D230(Block, CString, v8);
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1064), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v10 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( v9 )
{
v11 = cocos2d::CCString::getCString(v9);
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 0;
do
++v7;
while ( v11[v7] );
sub_14003D230(a2, v11, v7);
}
else
{
*(_OWORD *)a2 = 0;
a2[2] = 1;
a2[3] = 15;
*(_WORD *)a2 = 45;
}
}
else
{
*(_OWORD *)a2 = 0;
a2[2] = 1;
a2[3] = 15;
*(_WORD *)a2 = 45;
}
return a2;
}