//
// GJMultiplayerManager::createAndAddComment from 0x10065bd70 to 0x10065bed3 (355 bytes)
//
// 1 xrefs:
// > GJMultiplayerManager::uploadComment @ 0x10065ba9a
//
// 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
//
void __fastcall GJMultiplayerManager::createAndAddComment(__int64 a1, __m128 a2, __int64 a3, int a4)
{
cocos2d::CCString *v5; // rax
const char *CString; // r12
size_t v7; // rax
size_t v8; // r15
__int8 *v9; // r13
__int8 v10; // r14
__int64 v11; // r15
size_t v12; // r14
__int64 v13; // rdi
__m128 v14; // [rsp+0h] [rbp-60h] BYREF
void *__p; // [rsp+10h] [rbp-50h]
__int64 v16; // [rsp+18h] [rbp-48h]
__m128 __dst; // [rsp+20h] [rbp-40h] BYREF
void *v18; // [rsp+30h] [rbp-30h]
GJAccountManager::sharedState();
v5 = (cocos2d::CCString *)sub_1007AB580("2~%s~8~%i~9~7 minutes~6~-1", v14.i8[0]);
CString = cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)a2.i64);
v8 = v7;
v16 = a1;
if ( v7 >= 0x17 )
{
v12 = 26;
if ( (v7 | 7) != 0x17 )
v12 = (v7 | 7) + 1;
v9 = (__int8 *)operator new(v12);
v18 = v9;
__dst.i64[0] = v12 + 1;
__dst.i64[1] = v8;
LABEL_9:
memmove(v9, CString, v8);
v9[v8] = 0;
v10 = __dst.i8[0];
if ( (__dst.i8[0] & 1) == 0 )
goto LABEL_5;
goto LABEL_10;
}
__dst.i8[0] = 2 * v7;
v9 = &__dst.i8[1];
if ( v7 )
goto LABEL_9;
__dst.i8[1] = 0;
v10 = __dst.i8[0];
if ( (__dst.i8[0] & 1) == 0 )
{
LABEL_5:
__p = v18;
a2 = __dst;
v14 = __dst;
v11 = v16;
goto LABEL_11;
}
LABEL_10:
sub_100006B70(&v14, v18, __dst.u64[1], *(double *)a2.i64);
v11 = v16;
LABEL_11:
GJMultiplayerManager::addComment(v11, (__int64)&v14, a4, a2);
if ( (v14.i8[0] & 1) != 0 )
operator delete(__p);
v13 = *(_QWORD *)(v11 + 352);
if ( v13 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 24LL))(v13);
if ( (v10 & 1) != 0 )
operator delete(v18);
}