//
// GJUserMessage::create from 0x10054d980 to 0x10054e12f (1967 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetUserMessagesCompleted @ 0x100525201
// > GameLevelManager::onDownloadUserMessageCompleted @ 0x100525795
//
// 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
//
GJUserMessage *__fastcall GJUserMessage::create(cocos2d::CCDictionary *a1)
{
double v1; // xmm0_8
cocos2d::CCString *v2; // rax
int v3; // ebx
cocos2d::CCString *v4; // rax
cocos2d::CCString *v5; // rax
cocos2d::CCString *v6; // rax
const char *CString; // rbx
size_t v8; // rax
std::string::size_type v9; // r14
char *data; // r15
size_t v11; // r13
cocos2d::CCString *v12; // rax
const char *v13; // rbx
size_t v14; // rax
size_t v15; // r14
char *v16; // r15
size_t v17; // r13
cocos2d::CCString *v18; // rax
cocos2d::CCString *v19; // rax
cocos2d::CCString *v20; // rax
const char *v21; // r14
size_t v22; // rax
std::string::size_type v23; // r15
char *v24; // r13
cocos2d::CCString *v25; // rax
const char *v26; // r14
size_t v27; // rax
size_t v28; // r15
char *v29; // r12
char *v30; // rax
int v31; // ebx
char *v32; // r12
double v33; // xmm0_8
size_t v34; // rbx
size_t v35; // rbx
__int16 v37; // [rsp+0h] [rbp-170h] BYREF
char v38; // [rsp+2h] [rbp-16Eh]
void *v39; // [rsp+10h] [rbp-160h]
__int128 v40; // [rsp+18h] [rbp-158h] BYREF
void *v41; // [rsp+28h] [rbp-148h]
std::string __str; // [rsp+30h] [rbp-140h] BYREF
std::string v43; // [rsp+50h] [rbp-120h] BYREF
std::string v44; // [rsp+70h] [rbp-100h] BYREF
std::string v45; // [rsp+90h] [rbp-E0h] BYREF
std::string __dst; // [rsp+B0h] [rbp-C0h] BYREF
int v47; // [rsp+CCh] [rbp-A4h]
int v48; // [rsp+D0h] [rbp-A0h]
int v49; // [rsp+D4h] [rbp-9Ch]
__int128 v50; // [rsp+D8h] [rbp-98h] BYREF
void *v51; // [rsp+E8h] [rbp-88h]
__int128 v52; // [rsp+F0h] [rbp-80h] BYREF
void *v53; // [rsp+100h] [rbp-70h]
std::string v54; // [rsp+110h] [rbp-60h] BYREF
std::string v55; // [rsp+128h] [rbp-48h] BYREF
bool v56; // [rsp+146h] [rbp-2Ah]
bool v57; // [rsp+147h] [rbp-29h]
*(_WORD *)&v54.__r_.__value_.__l.0 = 12546;
v54.__r_.__value_.__s.__data_[1] = 0;
v2 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v54);
v3 = cocos2d::CCString::intValue(v2);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
*(_WORD *)&v54.__r_.__value_.__l.0 = 12802;
v54.__r_.__value_.__s.__data_[1] = 0;
v4 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v54);
v48 = cocos2d::CCString::intValue(v4);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
*(_WORD *)&v54.__r_.__value_.__l.0 = 13058;
v54.__r_.__value_.__s.__data_[1] = 0;
v5 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v54);
v49 = cocos2d::CCString::intValue(v5);
v47 = v3;
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v54.__r_.__value_.__l.__data_);
LOWORD(v52) = 13314;
BYTE2(v52) = 0;
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v52);
CString = cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v9 = v8;
if ( v8 >= 0x17 )
{
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
data = (char *)operator new(v11);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v11 | 1;
__dst.__r_.__value_.__l.__size_ = v9;
goto LABEL_14;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);
data = __dst.__r_.__value_.__s.__data_;
if ( v8 )
LABEL_14:
memmove(data, CString, v9);
data[v9] = 0;
LevelTools::base64DecodeString(&v54, &__dst, v1);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (v52 & 1) != 0 )
operator delete(v53);
*(_WORD *)&v55.__r_.__value_.__l.0 = 13570;
v55.__r_.__value_.__s.__data_[1] = 0;
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v55);
v13 = cocos2d::CCString::getCString(v12);
v14 = strlen(v13);
if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v15 = v14;
if ( v14 >= 0x17 )
{
v17 = 26;
if ( (v14 | 7) != 0x17 )
v17 = (v14 | 7) + 1;
v16 = (char *)operator new(v17);
v53 = v16;
*(_QWORD *)&v52 = v17 | 1;
*((_QWORD *)&v52 + 1) = v15;
}
else
{
LOBYTE(v52) = 2 * v14;
v16 = (char *)&v52 + 1;
if ( !v14 )
{
BYTE1(v52) = 0;
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_24;
goto LABEL_23;
}
}
memmove(v16, v13, v15);
v16[v15] = 0;
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
LABEL_23:
operator delete(v55.__r_.__value_.__l.__data_);
LABEL_24:
if ( (v52 & 1) != 0 )
{
if ( !*((_QWORD *)&v52 + 1) )
goto LABEL_37;
}
else if ( !((unsigned __int8)v52 >> 1) )
{
goto LABEL_37;
}
strcpy((char *)&v40, "\n14251");
cocos2d::ZipUtils::base64DecodeEnc(&v55, (unsigned __int8 *)&v52, &v40, v1);
if ( (v52 & 1) != 0 )
operator delete(v53);
v53 = v55.__r_.__value_.__l.__data_;
v1 = *(double *)v55.__r_.__value_.__r.__words;
v52 = *(_OWORD *)&v55.__r_.__value_.__l.0;
*(_WORD *)&v55.__r_.__value_.__l.0 = 0;
if ( (v40 & 1) != 0 )
operator delete(v41);
LABEL_37:
*(_WORD *)&v55.__r_.__value_.__l.0 = 14338;
v55.__r_.__value_.__s.__data_[1] = 0;
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v55);
v56 = cocos2d::CCString::boolValue(v18);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
*(_WORD *)&v55.__r_.__value_.__l.0 = 14594;
v55.__r_.__value_.__s.__data_[1] = 0;
v19 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v55);
v57 = cocos2d::CCString::boolValue(v19);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
LOWORD(v50) = 14082;
BYTE2(v50) = 0;
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v50);
v21 = cocos2d::CCString::getCString(v20);
v22 = strlen(v21);
if ( v22 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v23 = v22;
if ( v22 >= 0x17 )
{
v34 = 26;
if ( (v22 | 7) != 0x17 )
v34 = (v22 | 7) + 1;
v24 = (char *)operator new(v34);
v55.__r_.__value_.__r.__words[2] = (std::string::size_type)v24;
v55.__r_.__value_.__r.__words[0] = v34 | 1;
v55.__r_.__value_.__l.__size_ = v23;
}
else
{
v55.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v22);
v24 = v55.__r_.__value_.__s.__data_;
if ( !v22 )
{
v55.__r_.__value_.__s.__data_[0] = 0;
if ( (v50 & 1) == 0 )
goto LABEL_46;
goto LABEL_45;
}
}
memmove(v24, v21, v23);
v24[v23] = 0;
if ( (v50 & 1) != 0 )
LABEL_45:
operator delete(v51);
LABEL_46:
v37 = 13826;
v38 = 0;
v25 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v37);
v26 = cocos2d::CCString::getCString(v25);
v27 = strlen(v26);
if ( v27 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v28 = v27;
if ( v27 >= 0x17 )
{
v35 = 26;
if ( (v27 | 7) != 0x17 )
v35 = (v27 | 7) + 1;
v29 = (char *)operator new(v35);
v51 = v29;
*(_QWORD *)&v50 = v35 | 1;
*((_QWORD *)&v50 + 1) = v28;
}
else
{
LOBYTE(v50) = 2 * v27;
v29 = (char *)&v50 + 1;
if ( !v27 )
{
BYTE1(v50) = 0;
if ( (v37 & 1) == 0 )
goto LABEL_51;
goto LABEL_50;
}
}
memmove(v29, v26, v28);
v29[v28] = 0;
if ( (v37 & 1) != 0 )
LABEL_50:
operator delete(v39);
LABEL_51:
v30 = (char *)operator new(0x1B0u);
v31 = v47;
v32 = v30;
cocos2d::CCNode::CCNode((__int64)v30);
*(_QWORD *)v32 = off_100961A10;
v33 = 0.0;
*(_OWORD *)(v32 + 316) = 0;
*(_OWORD *)(v32 + 332) = 0;
*(_OWORD *)(v32 + 348) = 0;
*(_OWORD *)(v32 + 364) = 0;
*(_OWORD *)(v32 + 380) = 0;
*(_OWORD *)(v32 + 396) = 0;
*(_OWORD *)(v32 + 411) = 0;
if ( cocos2d::CCNode::init((cocos2d::CCNode *)v32) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v32);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v32 + 16LL))(v32);
v32 = nullptr;
}
*((_DWORD *)v32 + 79) = v31;
*((_DWORD *)v32 + 80) = v48;
*((_DWORD *)v32 + 81) = v49;
if ( (v50 & 1) != 0 )
{
sub_100006B70(&__str, v51, *((unsigned __int64 *)&v50 + 1), 0.0);
}
else
{
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)v51;
v33 = *(double *)&v50;
*(_OWORD *)&__str.__r_.__value_.__l.0 = v50;
}
std::string::operator=((std::string *)(v32 + 376), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v43, v54.__r_.__value_.__l.__data_, v54.__r_.__value_.__l.__size_, v33);
}
else
{
v43 = v54;
v33 = *(double *)v54.__r_.__value_.__r.__words;
}
std::string::operator=((std::string *)(v32 + 328), &v43);
if ( (*(_BYTE *)&v43.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v43.__r_.__value_.__l.__data_);
if ( (v52 & 1) != 0 )
{
sub_100006B70(&v44, v53, *((unsigned __int64 *)&v52 + 1), v33);
}
else
{
v44.__r_.__value_.__r.__words[2] = (std::string::size_type)v53;
v33 = *(double *)&v52;
*(_OWORD *)&v44.__r_.__value_.__l.0 = v52;
}
std::string::operator=((std::string *)(v32 + 352), &v44);
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v44.__r_.__value_.__l.__data_);
v32[424] = v56;
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
sub_100006B70(&v45, v55.__r_.__value_.__l.__data_, v55.__r_.__value_.__l.__size_, v33);
else
v45 = v55;
std::string::operator=((std::string *)(v32 + 400), &v45);
if ( (*(_BYTE *)&v45.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v45.__r_.__value_.__l.__data_);
v32[425] = v57;
if ( (v50 & 1) == 0 )
{
LABEL_84:
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_85;
goto LABEL_91;
}
}
else
{
v32[425] = v57;
if ( (v50 & 1) == 0 )
goto LABEL_84;
}
operator delete(v51);
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_85:
if ( (v52 & 1) == 0 )
goto LABEL_86;
LABEL_92:
operator delete(v53);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) == 0 )
return (GJUserMessage *)v32;
goto LABEL_87;
}
LABEL_91:
operator delete(v55.__r_.__value_.__l.__data_);
if ( (v52 & 1) != 0 )
goto LABEL_92;
LABEL_86:
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
LABEL_87:
operator delete(v54.__r_.__value_.__l.__data_);
return (GJUserMessage *)v32;
}