//
// EditLevelLayer::setupLevelInfo from 0x140179dc0 to 0x14017a62f (2159 bytes)
//
// 2 xrefs:
// > EditLevelLayer::init @ 0x14017924a
// > ??> @ 0x1409186ec
//
// 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 11:27:34 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall EditLevelLayer::setupLevelInfo(_QWORD *a1)
{
__int64 v2; // rax
__int64 v3; // rcx
struct cocos2d::CCObject *v4; // r13
struct cocos2d::CCObject *v5; // r14
struct cocos2d::CCObject *v6; // rbx
__int64 v7; // rax
struct cocos2d::CCLabelBMFont *v8; // r15
__int64 SongName; // rax
struct cocos2d::CCObject *v10; // r12
unsigned __int64 v11; // rdi
__int64 v12; // rcx
char *v13; // rax
char v14; // bl
int *v15; // rcx
int *v16; // rcx
void **v17; // rcx
cocos2d::CCLabelBMFont *v18; // rdi
__int64 v19; // rax
__int64 v20; // rbx
__int64 v21; // rax
struct cocos2d::CCObject *v22; // rbx
struct cocos2d::CCObject *v23; // rdx
cocos2d::CCArray *v24; // r15
__int64 v25; // rax
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rcx
cocos2d::CCDirector *v29; // rax
float v30; // xmm0_4
__int64 v31; // rax
cocos2d::CCString *v32; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v34; // rdi
const char *v35; // rax
int v36; // edx
cocos2d::CCString *v37; // rax
int v38; // r8d
cocos2d::CCString *v39; // rax
struct cocos2d::CCLabelBMFont *v40; // rbx
__int64 v41; // rcx
cocos2d::CCDirector *v42; // rax
float ScreenBottom; // xmm0_4
__int64 v44; // rax
__int64 v45; // rax
void *v46; // rcx
__int64 v47; // [rsp+38h] [rbp-99h] BYREF
struct cocos2d::CCObject *v48; // [rsp+40h] [rbp-91h] BYREF
struct cocos2d::CCObject *v49; // [rsp+48h] [rbp-89h] BYREF
cocos2d::CCArray *v50; // [rsp+50h] [rbp-81h]
struct cocos2d::CCObject *v51; // [rsp+58h] [rbp-79h]
struct cocos2d::CCSprite *v52; // [rsp+60h] [rbp-71h]
float v53; // [rsp+68h] [rbp-69h] BYREF
_BYTE v54[8]; // [rsp+70h] [rbp-61h] BYREF
struct cocos2d::CCObject *v55; // [rsp+78h] [rbp-59h]
void *Block[2]; // [rsp+80h] [rbp-51h] BYREF
__int64 v57; // [rsp+90h] [rbp-41h]
unsigned __int64 v58; // [rsp+98h] [rbp-39h]
_BYTE v59[32]; // [rsp+A0h] [rbp-31h] BYREF
_BYTE v60[32]; // [rsp+C0h] [rbp-11h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v53);
v50 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
v4 = (struct cocos2d::CCObject *)cocos2d::CCNode::create();
(*(void (__fastcall **)(_QWORD *, struct cocos2d::CCObject *))(*a1 + 464LL))(a1, v4);
v5 = (struct cocos2d::CCObject *)cocos2d::CCNode::create();
v49 = v5;
(*(void (__fastcall **)(_QWORD *, struct cocos2d::CCObject *))(*a1 + 464LL))(a1, v5);
v6 = (struct cocos2d::CCObject *)cocos2d::CCNode::create();
v51 = v6;
(*(void (__fastcall **)(_QWORD *, struct cocos2d::CCObject *))(*a1 + 464LL))(a1, v6);
v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
(*(void (__fastcall **)(struct cocos2d::CCObject *, struct cocos2d::CCObject *))(*(_QWORD *)v4 + 464LL))(v4, v55);
v48 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_noteIcon_001.png");
(*(void (__fastcall **)(struct cocos2d::CCObject *, struct cocos2d::CCObject *))(*(_QWORD *)v5 + 464LL))(v5, v48);
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
(*(void (__fastcall **)(struct cocos2d::CCObject *, struct cocos2d::CCSprite *))(*(_QWORD *)v6 + 464LL))(v6, v52);
v7 = GJGameLevel::lengthKeyToString(v59, *(unsigned int *)(a1[59] + 972LL));
if ( *(_QWORD *)(v7 + 24) > 0xFu )
v7 = *(_QWORD *)v7;
v8 = cocos2d::CCLabelBMFont::create((const char *)v7, (const char *)&qword_140704F78);
sub_14003D310((__int64)v59);
(*(void (__fastcall **)(struct cocos2d::CCObject *, struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v4 + 464LL))(v4, v8);
fminf(100.0 / *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v8 + 320LL))(v8), 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v8 + 160LL))(v8);
SongName = GJGameLevel::getSongName(a1[59], v60);
if ( *(_QWORD *)(SongName + 24) > 0xFu )
SongName = *(_QWORD *)SongName;
v10 = cocos2d::CCLabelBMFont::create((const char *)SongName, (const char *)&qword_140704F78);
sub_14003D310((__int64)v60);
(*(void (__fastcall **)(struct cocos2d::CCObject *, struct cocos2d::CCObject *))(*(_QWORD *)v5 + 464LL))(v5, v10);
fminf(100.0 / *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v10 + 320LL))(v10), 0.5);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v10 + 160LL))(v10);
*(_OWORD *)Block = 0;
v57 = 0;
v11 = 15;
v58 = 15;
LOBYTE(Block[0]) = 0;
v12 = a1[59];
if ( *(_BYTE *)(v12 + 857) )
{
v57 = 8;
strcpy((char *)Block, "Uploaded");
}
else if ( *(_DWORD *)(v12 + 848) - *(_DWORD *)(v12 + 852) == 1 )
{
v57 = 8;
strcpy((char *)Block, "Verified");
}
else
{
v57 = 10;
strcpy((char *)Block, "Unverified");
if ( *(int *)(v12 + 1036) > 0 )
{
v13 = (char *)sub_14003D460(0x20u);
v57 = 23;
v58 = 31;
strcpy(v13, "Unverified\nReq. Coins: ");
Block[0] = v13;
v5 = v49;
v14 = 1;
if ( *(_DWORD *)(a1[59] + 1080LL) - *(_DWORD *)(a1[59] + 1084LL) != 1 )
{
v14 = 0;
sub_140044D80(Block, &word_14070D060, 1u);
}
v15 = (int *)a1[59];
if ( v15[259] >= 2 && v15[273] - v15[274] != 1 )
{
if ( !v14 )
sub_140044D80(Block, ", ", 2u);
v14 = 0;
sub_140044D80(Block, &word_14070D058, 1u);
}
v16 = (int *)a1[59];
if ( v16[259] >= 3 && v16[276] - v16[277] != 1 )
{
if ( !v14 )
sub_140044D80(Block, ", ", 2u);
sub_140044D80(Block, &word_14070D054, 1u);
}
v6 = v51;
v11 = v58;
}
}
v17 = Block;
if ( v11 > 0xF )
v17 = (void **)Block[0];
v18 = cocos2d::CCLabelBMFont::create((const char *)v17, (const char *)&qword_140704F78);
(*(void (__fastcall **)(struct cocos2d::CCObject *, cocos2d::CCLabelBMFont *))(*(_QWORD *)v6 + 464LL))(v6, v18);
cocos2d::CCLabelBMFont::limitLabelWidth(v18, 100.0, 0.5, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, 0.0, 2.0);
v20 = v19;
v21 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v52 + 200LL))(v52);
cocos2d::CCPoint::operator+(v21, &v49, v20);
v22 = v52;
(*(void (__fastcall **)(struct cocos2d::CCSprite *, struct cocos2d::CCObject **))(*(_QWORD *)v52 + 184LL))(v52, &v49);
cocos2d::CCArray::removeAllObjects(v50);
cocos2d::CCArray::addObject(v50, v55);
v23 = v8;
v24 = v50;
cocos2d::CCArray::addObject(v50, v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const struct cocos2d::CCPoint *)&unk_14090A508);
GameToolbox::alignItemsHorisontally((__int64)v24, 4.0, v25, 0);
cocos2d::CCArray::removeAllObjects(v24);
cocos2d::CCArray::addObject(v24, v48);
cocos2d::CCArray::addObject(v24, v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const struct cocos2d::CCPoint *)&unk_14090A508);
GameToolbox::alignItemsHorisontally((__int64)v24, 4.0, v26, 0);
cocos2d::CCArray::removeAllObjects(v24);
cocos2d::CCArray::addObject(v24, v22);
cocos2d::CCArray::addObject(v24, v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const struct cocos2d::CCPoint *)&unk_14090A508);
GameToolbox::alignItemsHorisontally((__int64)v24, 4.0, v27, 0);
cocos2d::CCArray::removeAllObjects(v24);
cocos2d::CCArray::addObject(v24, v4);
cocos2d::CCArray::addObject(v24, v5);
cocos2d::CCArray::addObject(v24, v51);
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v28);
v30 = cocos2d::CCDirector::getScreenBottom(v29) + 55.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, v53 * 0.5, v30);
GameToolbox::alignItemsHorisontally((__int64)v24, 140.0, v31, 0);
v32 = cocos2d::CCString::createWithFormat("Version: %i", *(_DWORD *)(a1[59] + 860LL));
CString = cocos2d::CCString::getCString(v32);
v34 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD *, struct cocos2d::CCLabelBMFont *))(*a1 + 464LL))(a1, v34);
v35 = "ID: na";
v36 = *(_DWORD *)(a1[59] + 328LL) - *(_DWORD *)(a1[59] + 332LL);
if ( v36 )
{
v37 = cocos2d::CCString::createWithFormat("ID: %i", v36);
v35 = cocos2d::CCString::getCString(v37);
}
v38 = *(_DWORD *)(a1[59] + 1060LL) - *(_DWORD *)(a1[59] + 1064LL);
if ( v38 )
{
v39 = cocos2d::CCString::createWithFormat("%s (%i)", v35, v38);
v35 = cocos2d::CCString::getCString(v39);
}
v40 = cocos2d::CCLabelBMFont::create(v35, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD *, struct cocos2d::CCLabelBMFont *))(*a1 + 464LL))(a1, v40);
v42 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v41);
ScreenBottom = cocos2d::CCDirector::getScreenBottom(v42);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v53 * 0.5, ScreenBottom + 14.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, -75.0, 0.0);
cocos2d::CCPoint::operator+(v54, &v48, v44);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, struct cocos2d::CCObject **))(*(_QWORD *)v34 + 184LL))(
v34,
&v48);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, 75.0, 0.0);
cocos2d::CCPoint::operator+(v54, &v48, v45);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, struct cocos2d::CCObject **))(*(_QWORD *)v40 + 184LL))(
v40,
&v48);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v34 + 160LL))(v34);
if ( *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v40 + 320LL))(v40) > 150.0 )
{
(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v40 + 320LL))(v40);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v40 + 160LL))(v40);
}
fminf(
0.60000002,
COERCE_FLOAT(COERCE_UNSIGNED_INT64((*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v40 + 168LL))(v40))));
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v40 + 160LL))(v40);
if ( v58 > 0xF )
{
v46 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v46 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v46 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v46);
}
}