//
// ShareCommentLayer::onShare from 0x540fcc to 0x5411f2 (550 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:19 +0000
//
GameLevelManager *__fastcall ShareCommentLayer::onShare(GameLevelManager *this, cocos2d::CCObject *a2)
{
GameLevelManager *v2; // r4
int v3; // r0
int v4; // r2
int v5; // r3
int v6; // r3
GameLevelManager *v7; // r0
int v8; // r0
const char *v9; // r7
GameLevelManager *v10; // r8
int v11; // r7
int v12; // r7
void (__fastcall ***v13)(_DWORD, int *, GameLevelManager *); // r7
void (__fastcall *v14)(_DWORD, int *, GameLevelManager *); // r8
_BOOL4 v15; // r8
GameLevelManager *v16; // r0
int v17; // r3
int v18; // r0
const char *v19; // r8
GameLevelManager *v20; // r9
const char *v21; // r3
GameLevelManager *v22; // r8
int v23; // r0
const char *v24; // r8
GameLevelManager *v25; // r9
int v26; // r0
const char *v27; // r8
GameLevelManager *v28; // r9
const char *v29; // r3
GameLevelManager *v30; // r8
int v31; // [sp+8h] [bp-14h] BYREF
int v32; // [sp+Ch] [bp-10h]
int v33; // [sp+10h] [bp-Ch]
v2 = this;
if ( !*((_BYTE *)this + 544)
|| (v3 = EmoteSprite::maxEmotesComment(this),
this = (GameLevelManager *)EmoteSprite::effectiveLength((unsigned __int8 *)v2 + 560, v3, v4, v5),
(int)this <= *((_DWORD *)v2 + 133)) )
{
v6 = *((_DWORD *)v2 + 135);
if ( v6 == 2 )
{
v7 = (GameLevelManager *)GameLevelManager::sharedState(this);
*((_DWORD *)v7 + 222) = (char *)v2 + 520;
v8 = GameLevelManager::sharedState(v7);
v9 = *((const char **)v2 + 134);
v10 = (GameLevelManager *)v8;
std::string::basic_string(&v31, (int)v2 + 560);
v11 = GameLevelManager::uploadFriendRequest(v10, v9, (int)&v31);
std::string::~string((int)&v31);
if ( v11 )
{
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, "Sending...", 0xAu);
*((_DWORD *)v2 + 148) = UploadActionPopup::create((char *)v2 + 524, &v31);
std::string::~string((int)&v31);
return (GameLevelManager *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 148) + 656))(*((_DWORD *)v2 + 148));
}
return (GameLevelManager *)ShareCommentLayer::onClose(v2, nullptr);
}
if ( v6 == 3 )
{
v12 = GJMultiplayerManager::sharedState(this);
std::string::basic_string(&v31, (int)v2 + 560);
GJMultiplayerManager::uploadComment(v12, &v31, *((_DWORD *)v2 + 134));
LABEL_28:
std::string::~string((int)&v31);
return (GameLevelManager *)ShareCommentLayer::onClose(v2, nullptr);
}
if ( (unsigned int)(v6 - 4) <= 1 || v6 == 9 )
{
v13 = *((void (__fastcall ****)(_DWORD, int *, GameLevelManager *))v2 + 151);
if ( v13 )
{
v14 = **v13;
std::string::basic_string(&v31, (int)v2 + 560);
v14(v13, &v31, v2);
goto LABEL_28;
}
}
else
{
v31 = 0;
v32 = 0;
v33 = 0;
std::string::__init(&v31, &unk_B6B226, 0);
v15 = sub_540BB4((unsigned __int8 *)v2 + 560, (unsigned __int8 *)&v31);
v16 = (GameLevelManager *)std::string::~string((int)&v31);
if ( !v15 )
{
v17 = *((_DWORD *)v2 + 135);
switch ( v17 )
{
case 0:
v18 = GameLevelManager::sharedState(v16);
v19 = *((const char **)v2 + 134);
v20 = (GameLevelManager *)v18;
std::string::basic_string(&v31, (int)v2 + 560);
v21 = (const char *)*((unsigned __int8 *)v2 + 597);
if ( *((_BYTE *)v2 + 597) )
v21 = *((const char **)v2 + 150);
GameLevelManager::uploadLevelComment(v20, v19, (int)&v31, v21);
goto LABEL_28;
case 1:
v22 = (GameLevelManager *)GameLevelManager::sharedState(v16);
std::string::basic_string(&v31, (int)v2 + 560);
GameLevelManager::uploadAccountComment(v22, (int)&v31);
goto LABEL_28;
case 6:
v23 = GameLevelManager::sharedState(v16);
v24 = *((const char **)v2 + 134);
v25 = (GameLevelManager *)v23;
std::string::basic_string(&v31, (int)v2 + 560);
GameLevelManager::uploadEditorSoundComment(v25, v24, (int)&v31);
goto LABEL_28;
case 7:
v26 = GameLevelManager::sharedState(v16);
v27 = *((const char **)v2 + 134);
v28 = (GameLevelManager *)v26;
std::string::basic_string(&v31, (int)v2 + 560);
if ( *((_BYTE *)v2 + 597) )
v29 = *((const char **)v2 + 150);
else
v29 = nullptr;
GameLevelManager::uploadModRoomComment(v28, v27, (int)&v31, v29);
goto LABEL_28;
case 8:
v30 = (GameLevelManager *)GameLevelManager::sharedState(v16);
std::string::basic_string(&v31, (int)v2 + 560);
GameLevelManager::uploadComment(v30, (int)&v31, byte_8, *((const char **)v2 + 134), nullptr);
goto LABEL_28;
}
}
}
return (GameLevelManager *)ShareCommentLayer::onClose(v2, nullptr);
}
return this;
}