//
// ShareLevelLayer::init from 0x7f3c44 to 0x7f4990 (3404 bytes)
//
// 2 xrefs:
// > ShareLevelLayer::create @ 0x7f4b3c
// > ??> @ 0xe00b0
//
// 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:54:37 +0000
//
__int64 __fastcall ShareLevelLayer::init(ShareLevelLayer *this, GJGameLevel *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w23
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v10; // x0
__int64 v11; // x22
void (__fastcall *v12)(__int64, __int64 *); // x24
void (__fastcall *v13)(__int64, __int64 *); // x24
__int64 v14; // x0
const char *v15; // x2
__int64 v16; // x1
cocos2d::CCLabelBMFont *v17; // x0
__int64 v18; // x24
void (__fastcall *v19)(__int64, __int64 *); // x22
__int64 v20; // x27
__int64 v21; // x24
void (__fastcall *v22)(__int64, __int64 *); // x2
size_t v23; // x3
int v24; // w4
size_t v25; // x26
_BYTE *v26; // x0
char *v27; // x1
size_t v28; // x2
int v29; // w0
const char *v30; // x26
unsigned __int64 v31; // x24
unsigned __int64 v32; // x27
char *v33; // x3
EmoteSprite *v34; // x0
int v35; // w0
EmoteSprite *v36; // x0
float v37; // s11
const char *v38; // x1
size_t v39; // x0
EmoteSprite *v40; // x0
int v41; // w0
__int64 v42; // x24
void (__fastcall *v43)(__int64, __int64 *); // x26
__int64 v44; // x24
void (__fastcall *v45)(__int64, __int64 *); // x25
__int64 v46; // x0
__int64 v47; // x3
cocos2d::CCArray *v48; // x0
cocos2d::CCArray *v49; // x24
const char *v50; // x1
__int64 v51; // x2
__int64 v52; // x3
bool v53; // w4
__int64 v54; // x5
const char *v55; // x6
__int64 v56; // x0
cocos2d::CCObject *v57; // x25
const char *v58; // x6
const char *v59; // x5
__int64 v60; // x0
cocos2d::CCObject *v61; // x25
cocos2d::CCNode *v62; // x25
const char *v63; // x1
__int64 v64; // x24
__int64 v65; // x24
cocos2d::CCNode *v66; // x26
void (__fastcall *v67)(__int64, __int64 *); // x25
const char *v68; // x1
__int64 v69; // x25
__int64 v70; // x25
cocos2d::CCNode *v71; // x27
__int64 (__fastcall *v72)(__int64, __int64 *); // x26
GameManager *v73; // x0
GameManager *v74; // x0
const char *v75; // x1
int v76; // w0
int v77; // w0
__int64 v78; // x25
__int64 v79; // x0
cocos2d::CCNode *v80; // x19
__int64 (__fastcall *v81)(__int64); // x1
void (__fastcall *v82)(__int64, __int64 *); // x24
const cocos2d::CCPoint *v83; // x0
void *v84; // x0
void *v85; // x3
unsigned __int64 v86; // x0
void (__fastcall *v87)(__int64, __int64 *); // [xsp+A0h] [xbp+A0h]
int v88; // [xsp+A0h] [xbp+A0h]
void *v89; // [xsp+A0h] [xbp+A0h]
void *v90; // [xsp+A0h] [xbp+A0h]
void *v91; // [xsp+A8h] [xbp+A8h]
void *v92; // [xsp+A8h] [xbp+A8h]
char *v93; // [xsp+A8h] [xbp+A8h]
char *v94; // [xsp+B8h] [xbp+B8h]
__int64 v95; // [xsp+B8h] [xbp+B8h]
__int64 v96; // [xsp+C8h] [xbp+C8h] BYREF
char v97[8]; // [xsp+D0h] [xbp+D0h] BYREF
char v98[8]; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v99; // [xsp+E0h] [xbp+E0h] BYREF
char v100[8]; // [xsp+E8h] [xbp+E8h] BYREF
_BYTE v101[16]; // [xsp+F0h] [xbp+F0h] BYREF
__int64 v102[2]; // [xsp+100h] [xbp+100h] BYREF
__int64 v103; // [xsp+110h] [xbp+110h] BYREF
unsigned __int64 v104; // [xsp+118h] [xbp+118h]
void *v105; // [xsp+120h] [xbp+120h]
unsigned __int8 v106; // [xsp+128h] [xbp+128h]
_BYTE v107[15]; // [xsp+129h] [xbp+129h] BYREF
void *v108; // [xsp+138h] [xbp+138h]
__int64 v109; // [xsp+140h] [xbp+140h] BYREF
size_t v110; // [xsp+148h] [xbp+148h]
void *v111; // [xsp+150h] [xbp+150h]
__int64 v112[2]; // [xsp+158h] [xbp+158h] BYREF
void *v113; // [xsp+168h] [xbp+168h]
__int64 v114; // [xsp+170h] [xbp+170h] BYREF
__int64 v115; // [xsp+178h] [xbp+178h]
void *v116; // [xsp+180h] [xbp+180h]
LODWORD(v102[0]) = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v102);
v5 = v4;
if ( !v4 )
return v5;
FLAlertLayer::incrementForcePrio(this);
*((_QWORD *)this + 83) = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(ShareLevelLayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v7 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(ShareLevelLayer *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v96, v8);
v10 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v10;
(*(void (__fastcall **)(ShareLevelLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v10);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v102, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v102);
v12 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v102, 420.0, 300.0);
v12(v11, v102);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v11,
0xFFFFFFFFLL);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, *(float *)&v96 * 0.5, *((float *)&v96 + 1) * 0.5);
v13(v11, v102);
v114 = 0;
v14 = *((_QWORD *)this + 83);
v115 = 0;
v116 = nullptr;
v15 = (const char *)(v14 + 344);
if ( (*(_BYTE *)(v14 + 344) & 1) != 0 )
{
std::string::__init(&v114, *(void **)(v14 + 360), *(_QWORD *)(v14 + 352));
}
else
{
v16 = *(_QWORD *)(v14 + 352);
v114 = *(_QWORD *)v15;
v115 = v16;
v116 = *(void **)(v14 + 360);
}
v17 = (cocos2d::CCLabelBMFont *)((char *)&v114 + 1);
if ( (v114 & 1) != 0 )
v17 = (cocos2d::CCLabelBMFont *)v116;
v18 = cocos2d::CCLabelBMFont::create(v17, "goldFont.fnt", v15);
if ( (v114 & 1) != 0 )
operator delete(v116);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v18);
v19 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v102,
*(float *)&v96 * 0.5,
(float)((float)(*((float *)&v96 + 1) * 0.5) + 150.0) - 20.0);
v19(v18, v102);
v114 = 0;
v115 = 0;
v116 = nullptr;
std::string::__init(&v114, "You cannot change the name once it is shared.", 0x35u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 0.5, 1.0);
v20 = TextArea::create((char *)&v114, "chatFont.fnt", (const cocos2d::CCPoint *)v102, 0, 0, 1.0, 400.0, 20.0);
if ( (v114 & 1) != 0 )
operator delete(v116);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v20);
v87 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
v91 = (void *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 192LL))(v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v101, 0.0, -20.0);
cocos2d::CCPoint::operator+(v102, v91);
v87(v20, v102);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v97, *(float *)&v96 * 0.5, (float)(*((float *)&v96 + 1) * 0.5) + 60.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v101, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v102, (const cocos2d::CCRect *)v101);
v21 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v102);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v98, 380.0, 50.0);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v21 + 320LL))(v21, v98);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v21,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v21 + 184LL))(v21, v97);
v22 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 960LL);
LOWORD(v102[0]) = 16514;
BYTE2(v102[0]) = 33;
v22(v21, v102);
v103 = 0;
v104 = 0;
v105 = nullptr;
std::string::__init(&v103, "(No description provided)", 0x19u);
GJGameLevel::getUnpackedLevelDescription(a2);
v109 = 0;
v110 = 0;
v111 = nullptr;
std::string::__init(&v109, &byte_11B8890, 0);
if ( (v106 & 1) != 0 )
{
v23 = *(_QWORD *)&v107[7];
v24 = v109 & 1;
if ( (v109 & 1) != 0 )
{
v25 = v110;
v26 = v108;
LABEL_33:
v27 = (char *)v111;
if ( v25 > v23 )
v28 = v23;
else
v28 = v25;
v24 = 1;
if ( !v28 )
goto LABEL_37;
LABEL_20:
v88 = v24;
v92 = (void *)v23;
v29 = memcmp(v26, v27, v28);
v23 = (size_t)v92;
v24 = v88;
if ( v29 )
goto LABEL_21;
goto LABEL_37;
}
v25 = (unsigned __int8)v109 >> 1;
v27 = (char *)&v109 + 1;
v26 = v108;
}
else
{
v23 = v106 >> 1;
v24 = v109 & 1;
if ( (v109 & 1) != 0 )
{
v25 = v110;
v26 = v107;
goto LABEL_33;
}
v25 = (unsigned __int8)v109 >> 1;
v27 = (char *)&v109 + 1;
v26 = v107;
}
if ( v25 > v23 )
v28 = v23;
else
v28 = v25;
if ( v28 )
goto LABEL_20;
LABEL_37:
if ( v23 >= v25 && v23 <= v25 )
{
if ( v24 )
operator delete(v111);
goto LABEL_41;
}
LABEL_21:
if ( v24 )
operator delete(v111);
v30 = v107;
if ( (v106 & 1) != 0 )
v30 = (const char *)v108;
v31 = strlen(v30);
if ( (v103 & 1) == 0 )
{
if ( v31 <= 0x16 )
{
v33 = (char *)&v103 + 1;
goto LABEL_28;
}
if ( v31 - 22 <= 0xFFFFFFFFFFFFFFD8LL )
{
v32 = 22;
v93 = (char *)&v103 + 1;
goto LABEL_73;
}
LABEL_78:
sub_62C6DC();
}
v32 = (v103 & 0xFFFFFFFFFFFFFFFELL) - 1;
if ( v31 <= v32 )
{
v33 = (char *)v105;
LABEL_28:
if ( v31 )
v33 = (char *)memmove(v33, v30, v31);
v33[v31] = 0;
if ( (v103 & 1) != 0 )
v104 = v31;
else
LOBYTE(v103) = 2 * v31;
goto LABEL_41;
}
if ( v31 - ((v103 & 0xFFFFFFFFFFFFFFFELL) - 1) > -17LL - (v103 & 0xFFFFFFFFFFFFFFFELL) )
goto LABEL_78;
v93 = (char *)v105;
v95 = -17;
if ( v32 <= 0x7FFFFFFFFFFFFFE6LL )
{
LABEL_73:
v86 = 2 * v32;
v95 = 23;
if ( 2 * v32 < v31 )
v86 = v31;
if ( v86 > 0x16 )
v95 = (v86 + 16) & 0xFFFFFFFFFFFFFFF0LL;
}
v84 = (void *)operator new(v95);
v85 = v84;
if ( v31 )
{
v89 = v84;
memcpy(v84, v30, v31);
v85 = v89;
}
if ( v32 != 22 )
{
v90 = v85;
operator delete(v93);
v85 = v90;
}
v105 = v85;
v104 = v31;
v103 = v95 | 1;
*((_BYTE *)v85 + v31) = 0;
LABEL_41:
v34 = (EmoteSprite *)GameToolbox::stripNonBreakingSpaces((unsigned __int8 *)&v103);
v35 = EmoteSprite::maxEmotesComment(v34);
v36 = (EmoteSprite *)EmoteSprite::effectiveLength((char *)&v103, v35);
if ( (int)v36 <= 180 )
{
v76 = EmoteSprite::maxEmotesComment(v36);
v77 = EmoteSprite::effectiveLength((char *)&v103, v76);
if ( v77 > 70 )
v37 = (float)((float)((float)(180 - v77) / 180.0) * 0.3) + 0.7;
else
v37 = 1.0;
}
else
{
v37 = 0.7;
}
v38 = (char *)&v103 + 1;
if ( (v103 & 1) != 0 )
v38 = (const char *)v105;
v94 = (char *)v38;
v112[0] = 0;
v112[1] = 0;
v113 = nullptr;
v39 = strlen(v38);
std::string::__init(v112, v94, v39);
v40 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 0.5, 0.5);
v41 = EmoteSprite::maxEmotesComment(v40);
v42 = TextArea::create((char *)v112, "chatFont.fnt", (const cocos2d::CCPoint *)v102, 1, v41, 1.0, 368.5 / v37, 20.0);
if ( (v112[0] & 1) != 0 )
operator delete(v113);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v42);
v43 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v42 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v100, 0.0, 1.0);
cocos2d::CCPoint::operator+(v102, v97);
v43(v42, v102);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v42 + 160LL))(v42, v37);
v114 = 0;
v115 = 0;
v116 = nullptr;
std::string::__init(
&v114,
"By sharing a level you give the rights to use the level\n(in any way) to the creators of Geometry Dash.",
0x66u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 0.5, 1.0);
v44 = TextArea::create((char *)&v114, "chatFont.fnt", (const cocos2d::CCPoint *)v102, 0, 0, 1.0, 380.0, 20.0);
if ( (v114 & 1) != 0 )
operator delete(v116);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v44);
v45 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v44 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v102,
*(float *)&v96 * 0.5,
(float)((float)(*((float *)&v96 + 1) * 0.5) + -150.0) + 65.0);
v45(v44, v102);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v44 + 160LL))(v44, 0.65);
*((_DWORD *)this + 160) = -1;
v46 = cocos2d::CCMenu::create((cocos2d::CCMenu *)0xFFFFFFFFLL);
v47 = *((_QWORD *)this + 73);
*((_QWORD *)this + 69) = v46;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v47 + 464LL))(v47, v46, 10);
v48 = (cocos2d::CCArray *)ShareLevelLayer::setupStars(this);
v49 = (cocos2d::CCArray *)cocos2d::CCArray::create(v48);
v56 = ButtonSprite::create((ButtonSprite *)"Cancel", v50, v51, v52, v53, v54, v55);
v57 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(v56, 0, (__int64)this, (__int64)ShareLevelLayer::onClose, 0);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v57);
cocos2d::CCArray::addObject(v49, v57);
if ( *(_BYTE *)(*((_QWORD *)this + 83) + 785LL) )
v59 = "GJ_button_04.png";
else
v59 = "GJ_button_01.png";
v60 = ButtonSprite::create((ButtonSprite *)"Share Level", nullptr, 0, 0, 1.0, "goldFont.fnt", v59, v58);
v61 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(v60, 0, (__int64)this, (__int64)ShareLevelLayer::onShare, 0);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v61);
cocos2d::CCArray::addObject(v49, v61);
v62 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v100,
*(float *)&v96 * 0.5,
(float)((float)(*((float *)&v96 + 1) * 0.5) + -150.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace(v102, v62, (const cocos2d::CCPoint *)v100);
GameToolbox::alignItemsHorisontally((__int64)v49, (__int64)v102, 0, 15.0);
v64 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsBtn02_001.png", v63);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v64 + 160LL))(v64, 0.8);
v65 = CCMenuItemSpriteExtra::create(v64, 0, (__int64)this, (__int64)ShareLevelLayer::onSettings, 0);
CCMenuItemSpriteExtra::setSizeMult(v65, 2.0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v65);
v66 = *((cocos2d::CCNode **)this + 69);
v67 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v65 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v100,
(float)((float)(*(float *)&v96 * 0.5) + 210.0) - 26.0,
(float)((float)(*((float *)&v96 + 1) * 0.5) + 150.0) - 26.0);
cocos2d::CCNode::convertToNodeSpace(v102, v66, (const cocos2d::CCPoint *)v100);
v67(v65, v102);
v69 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_reportBtn_001.png", v68);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v69 + 160LL))(v69, 0.6);
v70 = CCMenuItemSpriteExtra::create(v69, 0, (__int64)this, (__int64)ShareLevelLayer::onGuidelines, 0);
CCMenuItemSpriteExtra::setSizeMult(v70, 1.2);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v70);
v71 = *((cocos2d::CCNode **)this + 69);
v72 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v70 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v100,
(float)((float)(*(float *)&v96 * 0.5) + -210.0) + 26.0,
(float)((float)(*((float *)&v96 + 1) * 0.5) + 150.0) - 26.0);
cocos2d::CCNode::convertToNodeSpace(v102, v71, (const cocos2d::CCPoint *)v100);
v73 = (GameManager *)v72(v70, v102);
v74 = (GameManager *)GameManager::sharedState(v73);
if ( (unsigned __int8)GameManager::getGameVariable(v74, "0029") )
{
if ( (v106 & 1) == 0 )
goto LABEL_53;
}
else
{
v78 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsTxt_001.png", v75);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v78);
v79 = v65;
v80 = *((cocos2d::CCNode **)this + 69);
v81 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v65 + 192LL);
v82 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v78 + 184LL);
v83 = (const cocos2d::CCPoint *)v81(v79);
cocos2d::CCNode::convertToWorldSpace(&v99, v80, v83);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v100, -55.0, 0.0);
cocos2d::CCPoint::operator+(v102, &v99);
v82(v78, v102);
if ( (v106 & 1) == 0 )
goto LABEL_53;
}
operator delete(v108);
LABEL_53:
if ( (v103 & 1) != 0 )
operator delete(v105);
return v5;
}