//
// ShareCommentLayer::onShare from 0x90e404 to 0x90e8ec (1256 bytes)
//
// 3 xrefs:
// > ??> @ 0x95dd0
// > ShareCommentLayer::init @ 0x90eea8
// > ??> @ 0x15440f0
//
// 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:57:15 +0000
//
__int64 __fastcall ShareCommentLayer::onShare(ShareCommentLayer *this, cocos2d::CCObject *a2)
{
EmoteSprite *v3; // x0
GJMultiplayerManager *v4; // x0
void (__fastcall ***v5)(_QWORD, __int64 *, ShareCommentLayer *); // x22
char v6; // w0
void (__fastcall *v7)(_QWORD, __int64 *, ShareCommentLayer *); // x23
__int64 v8; // x0
__int64 v9; // x1
int v11; // w0
GameLevelManager *v12; // x0
GameLevelManager *v13; // x23
char v14; // w0
unsigned int v15; // w22
__int64 v16; // x0
__int64 v17; // x1
int v18; // w22
__int64 v19; // x0
char v20; // w1
__int64 *v21; // x22
_BOOL4 v22; // w23
GameLevelManager *v23; // x0
GameLevelManager *v24; // x23
char v25; // w0
__int64 v26; // x0
__int64 v27; // x1
__int64 v28; // x22
char v29; // w0
__int64 v30; // x0
__int64 v31; // x1
GameLevelManager *v32; // x24
char v33; // w0
unsigned int v34; // w23
__int64 v35; // x0
__int64 v36; // x1
int v37; // w3
GameLevelManager *v38; // x23
char v39; // w0
__int64 v40; // x0
__int64 v41; // x1
GameLevelManager *v42; // x24
char v43; // w0
unsigned int v44; // w23
__int64 v45; // x0
__int64 v46; // x1
GameLevelManager *v47; // x24
char v48; // w0
unsigned int v49; // w23
__int64 v50; // x0
__int64 v51; // x1
int v52; // w3
__int64 v53; // [xsp+40h] [xbp+40h] BYREF
__int64 v54; // [xsp+48h] [xbp+48h]
void *v55; // [xsp+50h] [xbp+50h]
v3 = (EmoteSprite *)*((unsigned __int8 *)this + 700);
if ( (_DWORD)v3 )
{
v11 = EmoteSprite::maxEmotesComment(v3);
if ( (int)EmoteSprite::effectiveLength((char *)this + 728, v11) > *((_DWORD *)this + 172) )
return _stack_chk_guard;
v4 = (GJMultiplayerManager *)*((unsigned int *)this + 174);
if ( (_DWORD)v4 != 2 )
{
LABEL_3:
if ( (_DWORD)v4 == 3 )
{
v28 = GJMultiplayerManager::sharedState(v4);
v29 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v29 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v30 = *((_QWORD *)this + 91);
v31 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v30;
v54 = v31;
}
GJMultiplayerManager::uploadComment(v28, &v53, *((unsigned int *)this + 173));
goto LABEL_10;
}
if ( (unsigned int)((_DWORD)v4 - 4) <= 1 || (_DWORD)v4 == 9 )
{
v5 = *((void (__fastcall ****)(_QWORD, __int64 *, ShareCommentLayer *))this + 101);
if ( v5 )
{
v6 = *((_BYTE *)this + 728);
v7 = **v5;
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v6 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v8 = *((_QWORD *)this + 91);
v9 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v8;
v54 = v9;
}
v7(v5, &v53, this);
LABEL_10:
if ( (v53 & 1) != 0 )
operator delete(v55);
}
}
else
{
v53 = 0;
v54 = 0;
v21 = (__int64 *)((char *)this + 728);
v55 = nullptr;
std::string::__init(&v53, &byte_11B8890, 0);
v22 = sub_90DE84((__int64)this + 728, (__int64)&v53);
if ( (v53 & 1) != 0 )
operator delete(v55);
if ( v22 )
goto LABEL_12;
v23 = (GameLevelManager *)*((unsigned int *)this + 174);
switch ( (_DWORD)v23 )
{
case 0:
v32 = (GameLevelManager *)GameLevelManager::sharedState(v23);
v33 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
v34 = *((_DWORD *)this + 173);
if ( (v33 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v35 = *v21;
v36 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v35;
v54 = v36;
}
v37 = 0;
if ( *((_BYTE *)this + 801) )
v37 = *((_DWORD *)this + 201);
GameLevelManager::uploadLevelComment(v32, v34, (char *)&v53, v37);
goto LABEL_10;
case 1:
v38 = (GameLevelManager *)GameLevelManager::sharedState(v23);
v39 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v39 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v40 = *v21;
v41 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v40;
v54 = v41;
}
GameLevelManager::uploadAccountComment(v38, (char *)&v53);
goto LABEL_10;
case 6:
v42 = (GameLevelManager *)GameLevelManager::sharedState(v23);
v43 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
v44 = *((_DWORD *)this + 173);
if ( (v43 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v45 = *v21;
v46 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v45;
v54 = v46;
}
GameLevelManager::uploadEditorSoundComment(v42, v44, (char *)&v53);
goto LABEL_10;
case 7:
v47 = (GameLevelManager *)GameLevelManager::sharedState(v23);
v48 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
v49 = *((_DWORD *)this + 173);
if ( (v48 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v50 = *v21;
v51 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v50;
v54 = v51;
}
v52 = 0;
if ( *((_BYTE *)this + 801) )
v52 = *((_DWORD *)this + 201);
GameLevelManager::uploadModRoomComment(v47, v49, (char *)&v53, v52);
goto LABEL_10;
case 8:
v24 = (GameLevelManager *)GameLevelManager::sharedState(v23);
v25 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
if ( (v25 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v26 = *v21;
v27 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v26;
v54 = v27;
}
GameLevelManager::uploadComment(v24, (char *)&v53, 8u, *((_DWORD *)this + 173), 0);
goto LABEL_10;
}
}
LABEL_12:
ShareCommentLayer::onClose(this, nullptr);
return _stack_chk_guard;
}
}
else
{
v4 = (GJMultiplayerManager *)*((unsigned int *)this + 174);
if ( (_DWORD)v4 != 2 )
goto LABEL_3;
}
v12 = (GameLevelManager *)GameLevelManager::sharedState(v4);
*((_QWORD *)v12 + 170) = (char *)this + 664;
v13 = (GameLevelManager *)GameLevelManager::sharedState(v12);
v14 = *((_BYTE *)this + 728);
v53 = 0;
v54 = 0;
v55 = nullptr;
v15 = *((_DWORD *)this + 173);
if ( (v14 & 1) != 0 )
{
std::string::__init(&v53, *((void **)this + 93), *((_QWORD *)this + 92));
}
else
{
v16 = *((_QWORD *)this + 91);
v17 = *((_QWORD *)this + 92);
v55 = *((void **)this + 93);
v53 = v16;
v54 = v17;
}
v18 = (unsigned __int8)GameLevelManager::uploadFriendRequest(v13, v15, (char *)&v53);
if ( (v53 & 1) != 0 )
{
operator delete(v55);
if ( !v18 )
goto LABEL_12;
}
else if ( !v18 )
{
goto LABEL_12;
}
v53 = 0;
v54 = 0;
v55 = nullptr;
std::string::__init(&v53, "Sending...", 0xAu);
v19 = UploadActionPopup::create((char *)this + 672, &v53);
v20 = v53;
*((_QWORD *)this + 99) = v19;
if ( (v20 & 1) != 0 )
{
operator delete(v55);
v19 = *((_QWORD *)this + 99);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 1312LL))(v19);
return _stack_chk_guard;
}