//
// ShareListLayer::init from 0x10034d830 to 0x10034e89b (4203 bytes)
//
// 1 xrefs:
// > sub_10034BDA0 @ 0x10034bf5c
//
// This function is hookable on this platform (idp: pc, 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:28:48 +0000
//
__int64 __fastcall ShareListLayer::init(__m128 *a1, __int64 a2)
{
__int64 v3; // rsi
__int64 v4; // rax
__int64 v5; // r15
__int64 v6; // rax
__int64 v7; // rax
__int8 *v8; // rdi
__int64 v9; // r15
char *v10; // r12
unsigned __int64 *v11; // rbx
__int64 v12; // r12
const std::string::value_type *p_s; // rsi
unsigned __int64 v14; // rsi
int v15; // ecx
int v16; // eax
const char *data; // r15
size_t v18; // rax
size_t v19; // r12
char *v20; // r13
size_t v21; // rbx
unsigned int v22; // eax
char *v23; // r15
__int64 v24; // rax
__int64 v25; // rdi
__int64 v26; // r15
__int64 v27; // rax
_DWORD *v28; // r12
const char *v29; // r9
char *v30; // rax
_DWORD *v31; // r12
__int64 v32; // r12
char *v33; // rax
void *v34; // r15
__int64 v35; // r12
__int64 v36; // r15
unsigned __int8 v37; // r13
__int64 v38; // rbx
__int64 ToggleButton; // r15
__int64 v40; // r15
__int64 v41; // r12
__int64 v42; // r15
unsigned __int8 v43; // bl
__int64 v44; // r12
__int64 v45; // rax
__int64 v46; // r15
__int64 v47; // r12
__int64 v48; // r15
__int64 v49; // r12
__m128 v50; // xmm0
__m128 v51; // xmm1
__m128 v52; // xmm2
__int8 *v53; // rdi
char *v54; // r15
__int64 v55; // rax
__int64 CString; // rax
__int64 v57; // r12
unsigned __int64 *v58; // r14
char v60; // [rsp+0h] [rbp-1F0h]
unsigned __int64 v61[2]; // [rsp+40h] [rbp-1B0h] BYREF
float v62; // [rsp+50h] [rbp-1A0h] BYREF
unsigned __int64 v63; // [rsp+58h] [rbp-198h] BYREF
__int128 v64; // [rsp+60h] [rbp-190h] BYREF
void *v65; // [rsp+70h] [rbp-180h]
char v66; // [rsp+78h] [rbp-178h] BYREF
_BYTE v67[23]; // [rsp+79h] [rbp-177h] BYREF
char v68; // [rsp+90h] [rbp-160h] BYREF
char v69[15]; // [rsp+91h] [rbp-15Fh] BYREF
void *v70; // [rsp+A0h] [rbp-150h]
_QWORD v71[2]; // [rsp+A8h] [rbp-148h] BYREF
void *v72; // [rsp+B8h] [rbp-138h]
char v73; // [rsp+C0h] [rbp-130h] BYREF
char v74[15]; // [rsp+C1h] [rbp-12Fh] BYREF
void *v75; // [rsp+D0h] [rbp-120h]
_QWORD v76[2]; // [rsp+D8h] [rbp-118h] BYREF
void *v77; // [rsp+E8h] [rbp-108h]
unsigned __int64 v78; // [rsp+F0h] [rbp-100h] BYREF
unsigned __int8 v79; // [rsp+F8h] [rbp-F8h] BYREF
std::string::value_type __s; // [rsp+F9h] [rbp-F7h] BYREF
__int64 v81; // [rsp+100h] [rbp-F0h]
void *v82; // [rsp+108h] [rbp-E8h]
char v83; // [rsp+110h] [rbp-E0h] BYREF
_BYTE v84[23]; // [rsp+111h] [rbp-DFh] BYREF
__int128 __dst; // [rsp+128h] [rbp-C8h] BYREF
void *v86; // [rsp+138h] [rbp-B8h]
std::string __str; // [rsp+140h] [rbp-B0h] BYREF
__int64 v88; // [rsp+158h] [rbp-98h]
__m128 v89; // [rsp+160h] [rbp-90h] BYREF
void *__p[2]; // [rsp+170h] [rbp-80h]
__m128 v91; // [rsp+180h] [rbp-70h]
__m128 v92; // [rsp+190h] [rbp-60h]
char v93[16]; // [rsp+1A8h] [rbp-48h] BYREF
unsigned __int8 v94; // [rsp+1BFh] [rbp-31h]
float v95; // [rsp+1C0h] [rbp-30h] BYREF
float v96; // [rsp+1C4h] [rbp-2Ch]
v89.i32[0] = -1778384896;
v94 = cocos2d::CCLayerColor::initWithColor(a1, &v89);
if ( !v94 )
return v94;
FLAlertLayer::incrementForcePrio(a1);
a1[41].i64[1] = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(__m128 *, __int64))(a1->i64[0] + 1000))(a1, 1);
(*(void (__fastcall **)(__m128 *, __int64))(a1->i64[0] + 1072))(a1, 1);
v3 = cocos2d::CCDirector::sharedDirector(a1, 1);
cocos2d::CCDirector::getWinSize(&v95, v3);
v4 = cocos2d::CCLayer::create();
a1[36].i64[1] = v4;
(*(void (__fastcall **)(__m128 *, __int64))(a1->i64[0] + 456))(a1, v4);
sub_100278270((__int64)&v89, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v5 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", &v89);
sub_100278260(v89.f32, 420.0, 300.0);
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v5 + 320LL))(v5, &v89);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1[36].i64[1] + 464LL))(
a1[36].i64[1],
v5,
0xFFFFFFFFLL);
sub_100278250(v89.f32, v95 * 0.5, v96 * 0.5);
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v5 + 184LL))(v5, &v89);
v6 = a1[41].i64[1];
if ( (*(_BYTE *)(v6 + 432) & 1) != 0 )
{
sub_10001AD30(&v89, *(const void **)(v6 + 448), *(_QWORD *)(v6 + 440));
if ( (v89.i8[0] & 1) == 0 )
goto LABEL_4;
}
else
{
v7 = v6 + 432;
__p[0] = *(void **)(v7 + 16);
v89 = *(__m128 *)v7;
if ( (v89.i8[0] & 1) == 0 )
{
LABEL_4:
v8 = &v89.i8[1];
goto LABEL_7;
}
}
v8 = (__int8 *)__p[0];
LABEL_7:
v9 = cocos2d::CCLabelBMFont::create_3(v8, "goldFont.fnt");
if ( (v89.i8[0] & 1) != 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1[36].i64[1] + 456LL))(a1[36].i64[1], v9);
sub_100278250(v89.f32, v95 * 0.5, (float)((float)(v96 * 0.5) + 150.0) + -20.0);
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v9 + 184LL))(v9, &v89);
v65 = operator new(0x38u);
*(_QWORD *)&v64 = 57;
*((_QWORD *)&v64 + 1) = 53;
strcpy((char *)v65, "You cannot change the name once it is shared.");
sub_100278250(v89.f32, 0.5, 1.0);
LODWORD(v88) = 1065353216;
v10 = TextArea::create(&v64, (__int64)"chatFont.fnt", &v89, 0, 0, 1.0, 400.0, 20.0);
if ( (v64 & 1) != 0 )
operator delete(v65);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)a1[36].i64[1] + 456LL))(a1[36].i64[1], v10);
v11 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 192LL))(v9);
sub_100278250((float *)&__str, 0.0, -20.0);
sub_100278350((double *)v89.i64, v11, (unsigned __int64 *)&__str);
(*(void (__fastcall **)(char *, __m128 *))(*(_QWORD *)v10 + 184LL))(v10, &v89);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v10 + 160LL))(v10, 0.80000001);
sub_100278250((float *)&v63, v95 * 0.5, (float)(0.5 * v96) + 45.0);
sub_100278270((__int64)v61, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
sub_1002787F0(&v89, v61);
v12 = cocos2d::extension::CCScale9Sprite::create_2("square02b_001.png", &v89);
sub_100278260(&v62, 380.0, 80.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v12 + 320LL))(v12, &v62);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1[36].i64[1] + 464LL))(
a1[36].i64[1],
v12,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v12 + 184LL))(v12, &v63);
v89.i8[2] = 33;
v89.i16[0] = 16514;
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v12 + 960LL))(v12, &v89);
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x20u);
__str.__r_.__value_.__r.__words[0] = 33;
__str.__r_.__value_.__l.__size_ = 25;
strcpy(__str.__r_.__value_.__l.__data_, "(No description provided)");
p_s = (const std::string::value_type *)a1[41].i64[1];
GJLevelList::getUnpackedDescription(&v79);
if ( (v79 & 1) != 0 )
{
if ( !v81 )
goto LABEL_19;
}
else if ( !(v79 >> 1) )
{
goto LABEL_19;
}
if ( (v79 & 1) != 0 )
p_s = (const std::string::value_type *)v82;
else
p_s = &__s;
std::string::assign(&__str, p_s);
LABEL_19:
sub_1004EE050(&__str);
v14 = (unsigned int)EmoteSprite::maxEmotesComment(&__str, p_s);
v15 = EmoteSprite::effectiveLength(&__str, v14);
v16 = 280;
if ( v15 > 280
|| (v14 = (unsigned int)EmoteSprite::maxEmotesComment(&__str, v14),
v16 = EmoteSprite::effectiveLength(&__str, v14),
v16 >= 71) )
{
*(float *)&v88 = (float)((float)((float)(180 - v16) / 280.0) * 0.2) + 0.80000001;
}
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
data = __str.__r_.__value_.__l.__data_;
else
data = __str.__r_.__value_.__s.__data_;
v18 = strlen(data);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v19 = v18;
if ( v18 >= 0x17 )
{
v21 = 26;
if ( (v18 | 7) != 0x17 )
v21 = (v18 | 7) + 1;
v20 = (char *)operator new(v21);
v86 = v20;
*(_QWORD *)&__dst = v21 | 1;
*((_QWORD *)&__dst + 1) = v19;
goto LABEL_32;
}
LOBYTE(__dst) = 2 * v18;
v20 = (char *)&__dst + 1;
if ( v18 )
{
LABEL_32:
v14 = (unsigned __int64)data;
memmove(v20, data, v19);
}
v20[v19] = 0;
sub_100278250(v89.f32, 0.5, 0.5);
v22 = EmoteSprite::maxEmotesComment(&v89, v14);
v23 = TextArea::create(&__dst, (__int64)"chatFont.fnt", &v89, 1u, v22, 1.0, 352.0 / *(float *)&v88, 20.0);
if ( (__dst & 1) != 0 )
operator delete(v86);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)a1[36].i64[1] + 456LL))(a1[36].i64[1], v23);
sub_100278250((float *)v93, 0.0, 1.0);
sub_100278350((double *)v89.i64, &v63, (unsigned __int64 *)v93);
(*(void (__fastcall **)(char *, __m128 *))(*(_QWORD *)v23 + 184LL))(v23, &v89);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v23 + 160LL))(v23, *(float *)&v88);
a1[40].i32[0] = -1;
v24 = cocos2d::CCMenu::create();
a1[34].i64[1] = v24;
v25 = a1[36].i64[1];
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v25 + 464LL))(v25, v24, 10);
v26 = sub_1007FE900(v25);
v27 = sub_100059E00((__int64)"Cancel");
v28 = CCMenuItemSpriteExtra::create(v27, 0, (__int64)a1, (__int64)ShareListLayer::onClose, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v28 + 160LL))(v28, 0.80000001);
v28[101] = 1061997773;
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)a1[34].i64[1] + 456LL))(a1[34].i64[1], v28);
sub_1007FEBF0(v26, v28);
v29 = "GJ_button_01.png";
if ( *(_BYTE *)(a1[41].i64[1] + 395) )
v29 = "GJ_button_04.png";
v30 = sub_100059FD0((__int64)"Share List", 0, 0, 0, (__int64)"goldFont.fnt", (__int64)v29, 1.0);
v31 = CCMenuItemSpriteExtra::create((__int64)v30, 0, (__int64)a1, (__int64)ShareListLayer::onShare, 0);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v31 + 160LL))(v31, 0.80000001);
v31[101] = 1061997773;
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)a1[34].i64[1] + 456LL))(a1[34].i64[1], v31);
sub_1007FEBF0(v26, v31);
v32 = a1[34].i64[1];
sub_100278250((float *)v93, v95 * 0.5, (float)((float)(v96 * 0.5) + -150.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace((double *)v89.i64, v32, (unsigned int *)v93);
GameToolbox::alignItemsHorisontally(v26, &v89, 0, 15.0);
v33 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_infoIcon_001.png", COERCE_DOUBLE(1097859072));
v34 = CCMenuItemSpriteExtra::create((__int64)v33, 0, (__int64)a1, (__int64)ShareListLayer::onInfo, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v34, 2.0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)a1[34].i64[1] + 456LL))(a1[34].i64[1], v34);
v35 = a1[34].i64[1];
sub_100278250((float *)v93, (float)((float)(v95 * 0.5) + -210.0) + 20.0, (float)((float)(v96 * 0.5) + 150.0) + -20.0);
cocos2d::CCNode::convertToNodeSpace((double *)v89.i64, v35, (unsigned int *)v93);
(*(void (__fastcall **)(void *, __m128 *))(*(_QWORD *)v34 + 184LL))(v34, &v89);
v66 = 16;
strcpy(v67, "Unlisted");
v36 = a1[34].i64[1];
v37 = *(_BYTE *)(a1[41].i64[1] + 393);
sub_100278250(v89.f32, (float)(v95 * 0.5) + -50.0, (float)(v96 * 0.5) + -70.0);
v38 = a1[36].i64[1];
sub_100278250((float *)v93, 8.0, 0.0);
ToggleButton = GameToolbox::createToggleButton(
(unsigned int)&v66,
(unsigned int)ShareListLayer::onUnlisted,
0,
v37,
v36,
(unsigned int)&v89,
(__int64)a1,
v38,
(__int64)v93,
(__int64)"bigFont.fnt",
0,
0,
0);
if ( (v66 & 1) != 0 )
operator delete(*(void **)&v67[15]);
(*(void (__fastcall **)(__int64, _QWORD, double, double, double))(*(_QWORD *)ToggleButton + 72LL))(
ToggleButton,
0,
COERCE_DOUBLE(1061997773),
COERCE_DOUBLE(1053609165),
0.0);
v68 = 8;
strcpy(v69, "Info");
v72 = operator new(0xA8u);
v71[0] = 169;
v71[1] = 162;
strcpy(
(char *)v72,
"Makes it so that your list can only be found by searching for the exact ID. It will not be visible o"
"n your profile, from search, or anywhere else.");
v40 = InfoAlertButton::create(&v68, v71, 0.80000001);
if ( (v71[0] & 1) != 0 )
operator delete(v72);
if ( (v68 & 1) != 0 )
operator delete(v70);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1[34].i64[1] + 456LL))(a1[34].i64[1], v40);
v41 = a1[34].i64[1];
sub_100278250((float *)v93, (float)((float)(v95 * 0.5) + -50.0) + -30.0, (float)(v96 * 0.5) + -70.0);
cocos2d::CCNode::convertToNodeSpace((double *)v89.i64, v41, (unsigned int *)v93);
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v40 + 184LL))(v40, &v89);
v42 = sub_1007FE900(v40);
v83 = 24;
strcpy(v84, "Friends\nOnly");
v88 = a1[34].i64[1];
v43 = *(_BYTE *)(a1[41].i64[1] + 394);
sub_100278250(v89.f32, (float)(v95 * 0.5) + 100.0, (float)(v96 * 0.5) + -70.0);
v44 = a1[36].i64[1];
sub_100278250((float *)v93, 8.0, 0.0);
v45 = GameToolbox::createToggleButton(
(unsigned int)&v83,
(unsigned int)ShareListLayer::onUnlisted,
0,
v43,
v88,
(unsigned int)&v89,
(__int64)a1,
v44,
(__int64)v93,
(__int64)"bigFont.fnt",
0,
0,
v42);
a1[42].i64[0] = v45;
if ( (v83 & 1) != 0 )
{
operator delete(*(void **)&v84[15]);
v45 = a1[42].i64[0];
}
(*(void (__fastcall **)(__int64, __int64, double, double, double))(*(_QWORD *)v45 + 72LL))(
v45,
1,
COERCE_DOUBLE(1061997773),
COERCE_DOUBLE(1053609165),
0.0);
a1[42].i64[1] = sub_1007FEFE0(v42, 1);
v73 = 8;
strcpy(v74, "Info");
v77 = operator new(0xB8u);
v76[0] = 185;
v76[1] = 179;
strcpy(
(char *)v77,
"Makes it so that your list can only be found by friends who search for the exact ID. It will not"
" be visible on your profile, from search, or anywhere else.");
v46 = InfoAlertButton::create(&v73, v76, 0.80000001);
if ( (v76[0] & 1) != 0 )
operator delete(v77);
if ( (v73 & 1) != 0 )
operator delete(v75);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1[34].i64[1] + 456LL))(a1[34].i64[1], v46);
v47 = a1[34].i64[1];
sub_100278250((float *)v93, (float)((float)(v95 * 0.5) + 100.0) + -30.0, (float)(v96 * 0.5) + -70.0);
cocos2d::CCNode::convertToNodeSpace((double *)v89.i64, v47, (unsigned int *)v93);
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)v46 + 184LL))(v46, &v89);
v48 = a1[34].i64[1];
v49 = a1[36].i64[1];
sub_100278250((float *)&v78, (float)(v95 * 0.5) + -180.0, (float)(v96 * 0.5) + -50.0);
*(_QWORD *)v93 = sub_10034ECD0;
*(_QWORD *)&v93[8] = 0;
sub_1004EAD20(
(unsigned int)&v89,
v49,
v48,
(_DWORD)a1,
(unsigned int)sub_10034ECB0,
0,
(__int64)sub_10034ECD0,
0,
(__int64)&v78);
v50 = v89;
v51 = *(__m128 *)__p;
v52 = v91;
a1[46] = v92;
a1[45] = v52;
a1[44] = v51;
a1[43] = v50;
sub_10034ECF0(a1);
GJLevelList::frameForListDifficulty(&v89, *(unsigned int *)(a1[41].i64[1] + 360), 2);
if ( (v89.i8[0] & 1) != 0 )
v53 = (__int8 *)__p[0];
else
v53 = &v89.i8[1];
v54 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v53, *(double *)v50.i64);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1[36].i64[1] + 464LL))(a1[36].i64[1], v54, 1);
sub_100278250((float *)v93, (float)(v95 * 0.5) + -50.0, (float)(0.5 * v96) + -25.0);
(*(void (__fastcall **)(char *, char *))(*(_QWORD *)v54 + 184LL))(v54, v93);
GJLevelList::totalLevels(a1[41].i64[1]);
v55 = sub_10088E820("%i Levels", v60);
CString = cocos2d::CCString::getCString(v55);
v57 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v57 + 160LL))(v57, 0.80000001);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1[36].i64[1] + 464LL))(a1[36].i64[1], v57, 1);
sub_100278250((float *)v93, 0.0, 0.5);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v57 + 296LL))(v57, v93);
v58 = (unsigned __int64 *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v54 + 192LL))(v54);
sub_100278250((float *)&v78, 30.0, 0.0);
sub_100278350((double *)v93, v58, &v78);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v57 + 184LL))(v57, v93);
if ( (v89.i8[0] & 1) == 0 )
{
if ( (v79 & 1) == 0 )
goto LABEL_54;
LABEL_58:
operator delete(v82);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) == 0 )
return v94;
goto LABEL_55;
}
operator delete(__p[0]);
if ( (v79 & 1) != 0 )
goto LABEL_58;
LABEL_54:
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
LABEL_55:
operator delete(__str.__r_.__value_.__l.__data_);
return v94;
}