//
// EditorPauseLayer::init from 0x10027ca90 to 0x10027d20f (1919 bytes)
//
// 1 xrefs:
// > EditorPauseLayer::create @ 0x10027ca4d
//
// 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:27:42 +0000
//
__int64 __fastcall EditorPauseLayer::init(__int64 *a1, __int64 a2)
{
unsigned int v2; // r13d
int v3; // ebx
__int64 v4; // rax
__int64 v5; // rcx
unsigned __int8 v6; // r14
unsigned __int8 v7; // cl
__int64 v8; // rax
const std::string::value_type *CString; // rax
char v10; // r14
__int64 v11; // rax
const std::string::value_type *v12; // rax
__int64 *v13; // r14
_BYTE *v14; // rax
unsigned __int64 v15; // rcx
int v16; // esi
_BYTE *v17; // rdx
unsigned __int64 v18; // rdi
__m128i v19; // xmm0
__int64 v20; // rsi
__m128i si128; // xmm2
__m128i v22; // xmm3
__m128i v23; // xmm1
__m128i v24; // xmm1
__m128i v25; // xmm0
_BYTE *v26; // rax
__int64 v27; // rcx
char *v28; // rax
unsigned __int64 v29; // rcx
int v30; // edx
char *v31; // rdi
unsigned __int64 v32; // r8
__m128i v33; // xmm0
__int64 v34; // rdx
__m128i v35; // xmm2
__m128i v36; // xmm3
__m128i v37; // xmm1
__m128i v38; // xmm1
__m128i v39; // xmm0
char *v40; // rax
int v41; // edx
__int64 v42; // rax
const std::string::value_type *v43; // rax
std::string::pointer data; // rdi
__int64 v45; // r15
__m128i v46; // xmm0
__int64 *v47; // rdi
__int64 v48; // rdi
__int64 v49; // rax
__int64 *v50; // rbx
float v51; // xmm0_4
__int64 v52; // rbx
__int64 v53; // rax
int v54; // ecx
unsigned int LengthKey; // eax
char *v56; // r12
size_t v57; // rax
size_t v58; // r13
char *v59; // rbx
const char *v60; // rdi
size_t v61; // r14
__m128 v62; // xmm0
int v63; // esi
__int64 v64; // rax
__int64 v65; // r12
unsigned __int64 *v66; // rbx
char v68; // [rsp+0h] [rbp-E0h]
char v69; // [rsp+0h] [rbp-E0h]
char v70; // [rsp+0h] [rbp-E0h]
char v71[8]; // [rsp+18h] [rbp-C8h] BYREF
unsigned __int64 v72; // [rsp+20h] [rbp-C0h] BYREF
unsigned __int8 v73; // [rsp+28h] [rbp-B8h] BYREF
_BYTE v74[7]; // [rsp+29h] [rbp-B7h] BYREF
unsigned __int64 v75; // [rsp+30h] [rbp-B0h]
void *v76; // [rsp+38h] [rbp-A8h]
size_t v77; // [rsp+40h] [rbp-A0h] BYREF
unsigned __int64 v78; // [rsp+48h] [rbp-98h]
void *v79; // [rsp+50h] [rbp-90h]
double v80[2]; // [rsp+58h] [rbp-88h] BYREF
char *__s; // [rsp+68h] [rbp-78h]
std::string v82; // [rsp+70h] [rbp-70h] BYREF
_QWORD __dst[2]; // [rsp+90h] [rbp-50h] BYREF
void *__p; // [rsp+A0h] [rbp-40h]
__int64 *v85; // [rsp+A8h] [rbp-38h]
float v86; // [rsp+B0h] [rbp-30h]
unsigned __int8 v87; // [rsp+B6h] [rbp-2Ah]
bool v88; // [rsp+B7h] [rbp-29h] BYREF
a1[72] = a2;
v2 = CCBlockLayer::init();
if ( !(_BYTE)v2 )
return v2;
v3 = *(_DWORD *)(*(_QWORD *)(a1[72] + 1936) + 1140LL);
v4 = cocos2d::CCDirector::sharedDirector(a1, a2);
cocos2d::CCDirector::getWinSize(v71, v4);
v85 = a1;
v5 = *(_QWORD *)(a1[72] + 1936);
v6 = *(_BYTE *)(v5 + 1200);
v7 = *(_BYTE *)(v5 + 1201);
memset(&v82, 0, sizeof(v82));
if ( (v7 & v6) == 1 )
{
v8 = sub_10088E820("Objects: %i (Unlimited)", v68);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v8);
std::string::assign(&v82, CString);
}
else
{
v10 = v7 | v6;
v11 = sub_10088E820("Objects: %i/%i", v68);
v12 = (const std::string::value_type *)cocos2d::CCString::getCString(v11);
std::string::assign(&v82, v12);
if ( v10 )
std::string::append(&v82, " (high)");
}
v88 = 0;
v13 = v85;
LevelEditorLayer::getSongIDs((__int64)&v73, v85[72], &v88);
LevelEditorLayer::getSFXIDs(&v77, v13[72]);
if ( (v73 & 1) != 0 )
{
v15 = v75;
if ( v75 )
{
v14 = v76;
v16 = 0;
v17 = v76;
if ( v75 < 8 )
goto LABEL_15;
LABEL_12:
v18 = v15 & 0xFFFFFFFFFFFFFFF8LL;
v17 = &v14[v15 & 0xFFFFFFFFFFFFFFF8LL];
v19 = 0;
v20 = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_100A072B0);
v22 = _mm_cvtepi8_epi32(16843009);
v23 = 0;
do
{
v19 = _mm_add_epi32(
v19,
_mm_and_si128(_mm_cvtepu8_epi32(_mm_cmpeq_epi8(_mm_cvtsi32_si128(*(_DWORD *)&v14[v20]), si128)), v22));
v23 = _mm_add_epi32(
v23,
_mm_and_si128(
_mm_cvtepu8_epi32(_mm_cmpeq_epi8(_mm_cvtsi32_si128(*(_DWORD *)&v14[v20 + 4]), si128)),
v22));
v20 += 8;
}
while ( v18 != v20 );
v24 = _mm_add_epi32(v23, v19);
v25 = _mm_add_epi32(_mm_shuffle_epi32(v24, 238), v24);
v16 = _mm_cvtsi128_si32(_mm_add_epi32(_mm_shuffle_epi32(v25, 85), v25));
if ( v15 == v18 )
{
LABEL_17:
v27 = (unsigned __int8)v77;
if ( (v77 & 1) == 0 )
goto LABEL_18;
goto LABEL_22;
}
LABEL_15:
v26 = &v14[v15];
do
v16 += *v17++ == 44;
while ( v17 != v26 );
goto LABEL_17;
}
}
else if ( v73 )
{
v14 = v74;
v15 = v73 >> 1;
v16 = 0;
v17 = v74;
if ( v15 < 8 )
goto LABEL_15;
goto LABEL_12;
}
v27 = (unsigned __int8)v77;
if ( (v77 & 1) == 0 )
{
LABEL_18:
if ( v27 )
{
v28 = (char *)&v77 + 1;
v29 = (unsigned int)v27 >> 1;
v30 = 0;
v31 = (char *)&v77 + 1;
if ( v29 < 8 )
goto LABEL_27;
goto LABEL_24;
}
goto LABEL_31;
}
LABEL_22:
v29 = v78;
if ( v78 )
{
v28 = (char *)v79;
v30 = 0;
v31 = (char *)v79;
if ( v78 < 8 )
goto LABEL_27;
LABEL_24:
v32 = v29 & 0xFFFFFFFFFFFFFFF8LL;
v31 = &v28[v29 & 0xFFFFFFFFFFFFFFF8LL];
v33 = 0;
v34 = 0;
v35 = _mm_load_si128((const __m128i *)&xmmword_100A072B0);
v36 = _mm_cvtepi8_epi32(16843009);
v37 = 0;
do
{
v33 = _mm_add_epi32(
v33,
_mm_and_si128(_mm_cvtepu8_epi32(_mm_cmpeq_epi8(_mm_cvtsi32_si128(*(_DWORD *)&v28[v34]), v35)), v36));
v37 = _mm_add_epi32(
v37,
_mm_and_si128(_mm_cvtepu8_epi32(_mm_cmpeq_epi8(_mm_cvtsi32_si128(*(_DWORD *)&v28[v34 + 4]), v35)), v36));
v34 += 8;
}
while ( v32 != v34 );
v38 = _mm_add_epi32(v37, v33);
v39 = _mm_add_epi32(_mm_shuffle_epi32(v38, 238), v38);
v30 = _mm_cvtsi128_si32(_mm_add_epi32(_mm_shuffle_epi32(v39, 85), v39));
if ( v29 == v32 )
{
LABEL_29:
v41 = v30 + 1;
if ( v88 )
goto LABEL_33;
LABEL_32:
if ( v41 <= 0 )
goto LABEL_34;
goto LABEL_33;
}
LABEL_27:
v40 = &v28[v29];
do
v30 += *v31++ == 44;
while ( v31 != v40 );
goto LABEL_29;
}
LABEL_31:
v41 = 0;
if ( !v88 )
goto LABEL_32;
LABEL_33:
v42 = sub_10088E820(", Songs: %i, SFX: %i", v69);
v43 = (const std::string::value_type *)cocos2d::CCString::getCString(v42);
std::string::append(&v82, v43);
LABEL_34:
if ( v3 != 2 )
std::string::append(&v82, " (Read-Only)");
if ( (*(_BYTE *)&v82.__r_.__value_.__s.0 & 1) != 0 )
data = v82.__r_.__value_.__l.__data_;
else
data = v82.__r_.__value_.__s.__data_;
v45 = cocos2d::CCLabelBMFont::create_3(data, "goldFont.fnt");
v46 = 0;
sub_100278250((float *)__dst, 0.0, 1.0);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v45 + 296LL))(v45, __dst);
v47 = v85;
(*(void (__fastcall **)(__int64 *, __int64))(*v85 + 456))(v85, v45);
v48 = cocos2d::CCDirector::sharedDirector(v47, v45);
*(float *)v46.i32 = sub_100479760(v48);
v86 = COERCE_FLOAT(_mm_cvtsi128_si32(v46));
v49 = cocos2d::CCDirector::sharedDirector(v48, v45);
*(double *)v46.i64 = sub_100479740(v49);
sub_100278250((float *)__dst, v86 + 10.0, *(float *)v46.i32 + -5.0);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v45 + 184LL))(v45, __dst);
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)v45 + 160LL))(v45, *(double *)_mm_cvtsi32_si128(0x3F000000u).i64);
v50 = v85;
v51 = LevelEditorLayer::getLastObjectX(v85[72]) + 340.0;
v52 = *(_QWORD *)(v50[72] + 14288);
sub_100278250((float *)__dst, v51, 0.0);
DrawGridLayer::timeForPos(v52, (__int64)__dst, 0, 0, 0, 0, 0, 0);
v53 = v85[72];
v54 = *(_DWORD *)(*(_QWORD *)(v53 + 1936) + 1232LL);
if ( v54 > 0 )
v51 = fmaxf((float)v54 / 240.0, v51);
v86 = v51;
LengthKey = GJGameLevel::getLengthKey((unsigned int)(int)v51, *(unsigned __int8 *)(*(_QWORD *)(v53 + 3272) + 341LL));
GJGameLevel::lengthKeyToString(v80, LengthKey);
v87 = v2;
if ( (LOBYTE(v80[0]) & 1) != 0 )
v56 = __s;
else
v56 = (char *)v80 + 1;
v57 = strlen(v56);
if ( v57 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v58 = v57;
if ( v57 >= 0x17 )
{
v61 = 26;
if ( (v57 | 7) != 0x17 )
v61 = (v57 | 7) + 1;
v59 = (char *)operator new(v61);
__p = v59;
__dst[0] = v61 | 1;
__dst[1] = v58;
}
else
{
LOBYTE(__dst[0]) = 2 * v57;
v59 = (char *)__dst + 1;
if ( !v57 )
{
BYTE1(__dst[0]) = 0;
if ( (LOBYTE(v80[0]) & 1) == 0 )
goto LABEL_49;
goto LABEL_48;
}
}
memmove(v59, v56, v58);
v59[v58] = 0;
if ( (LOBYTE(v80[0]) & 1) != 0 )
LABEL_48:
operator delete(__s);
LABEL_49:
v2 = v87;
if ( *(_BYTE *)(*(_QWORD *)(v85[72] + 3272) + 341LL) )
{
v60 = "Length: Platformer";
goto LABEL_62;
}
v62 = (__m128)LODWORD(v86);
v62.f32[0] = v86 / 60.0;
v63 = (int)_mm_round_ss(v62, v62, 9).f32[0];
if ( (__dst[0] & 1) == 0 )
{
if ( v63 <= 0 )
goto LABEL_58;
LABEL_60:
v64 = sub_10088E820("Length: %imin %is (%s)", v70);
goto LABEL_61;
}
if ( v63 > 0 )
goto LABEL_60;
LABEL_58:
v64 = sub_10088E820("Length: %i seconds (%s)", v70);
LABEL_61:
v60 = (const char *)cocos2d::CCString::getCString(v64);
LABEL_62:
v65 = cocos2d::CCLabelBMFont::create_3(v60, "goldFont.fnt");
sub_100278250((float *)v80, 0.0, 1.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v65 + 296LL))(v65, v80);
(*(void (__fastcall **)(__int64 *, __int64))(*v85 + 456))(v85, v65);
v66 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v45 + 192LL))(v45);
sub_100278250((float *)&v72, 0.0, -20.0);
sub_100278350(v80, v66, &v72);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v65 + 184LL))(v65, v80);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v65 + 160LL))(v65, 0.5);
if ( (__dst[0] & 1) != 0 )
{
operator delete(__p);
if ( (v77 & 1) == 0 )
{
LABEL_64:
if ( (v73 & 1) == 0 )
goto LABEL_65;
LABEL_70:
operator delete(v76);
if ( (*(_BYTE *)&v82.__r_.__value_.__s.0 & 1) == 0 )
return v2;
goto LABEL_66;
}
}
else if ( (v77 & 1) == 0 )
{
goto LABEL_64;
}
operator delete(v79);
if ( (v73 & 1) != 0 )
goto LABEL_70;
LABEL_65:
if ( (*(_BYTE *)&v82.__r_.__value_.__s.0 & 1) != 0 )
LABEL_66:
operator delete(v82.__r_.__value_.__l.__data_);
return v2;
}