//
// GJMultiplayerManager::createAndAddComment from 0xac5a10 to 0xac5b80 (368 bytes)
//
// 2 xrefs:
// > GJMultiplayerManager::uploadComment @ 0xac7284
// > ??> @ 0xa9c78
//
// 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 13:01:07 +0000
//
__int64 __fastcall GJMultiplayerManager::createAndAddComment(__int64 a1, unsigned __int8 *a2, int a3)
{
GJAccountManager *v5; // x0
const char *v6; // x20
__int64 v7; // x0
cocos2d::CCString *v8; // x0
const char *CString; // x0
size_t v10; // x0
__int64 v11; // x0
char *v13; // [xsp+48h] [xbp+48h]
__int64 v14; // [xsp+58h] [xbp+58h] BYREF
size_t v15; // [xsp+60h] [xbp+60h]
void *v16; // [xsp+68h] [xbp+68h]
__int64 v17; // [xsp+70h] [xbp+70h] BYREF
size_t v18; // [xsp+78h] [xbp+78h]
void *v19; // [xsp+80h] [xbp+80h]
v6 = (const char *)(a2 + 1);
v5 = (GJAccountManager *)*a2;
if ( ((unsigned __int8)v5 & 1) != 0 )
v6 = *((const char **)a2 + 2);
v7 = GJAccountManager::sharedState(v5);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)&unk_117CDF0,
v6,
(unsigned int)(*(_DWORD *)(v7 + 352) - *(_DWORD *)(v7 + 356)));
CString = (const char *)cocos2d::CCString::getCString(v8);
v14 = 0;
v13 = (char *)CString;
v15 = 0;
v16 = nullptr;
v10 = strlen(CString);
std::string::__init(&v14, v13, v10);
v17 = 0;
v18 = 0;
v19 = nullptr;
if ( (v14 & 1) != 0 )
{
std::string::__init(&v17, v16, v15);
}
else
{
v19 = v16;
v17 = v14;
v18 = v15;
}
GJMultiplayerManager::addComment(a1, (char *)&v17, a3);
if ( (v17 & 1) != 0 )
operator delete(v19);
v11 = *(_QWORD *)(a1 + 352);
if ( v11 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v11 + 24LL))(v11);
if ( (v14 & 1) != 0 )
operator delete(v16);
return _stack_chk_guard;
}