//
// GJGameLevel::duplicate from 0x81535c to 0x815b1c (1984 bytes)
//
// 2 xrefs:
// > LevelCell::recallLevel @ 0x7373fc
// > ??> @ 0xc4a08
//
// 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:54 +0000
//
__int64 __fastcall GJGameLevel::duplicate(GJGameLevel *this)
{
__int64 v2; // x20
int v3; // w23
float v4; // s0
char v5; // w0
__int64 v6; // x0
size_t v7; // x1
__int64 *v8; // x0
char v9; // w0
__int64 v10; // x0
size_t v11; // x1
__int64 *v12; // x0
char v13; // w0
__int64 v14; // x0
size_t v15; // x1
__int64 *v16; // x0
int v17; // w23
float v18; // s0
char v19; // w0
__int64 v20; // x0
size_t v21; // x1
__int64 *v22; // x0
int v23; // w23
float v24; // s0
char v25; // w0
__int64 v26; // x0
size_t v27; // x1
__int64 *v28; // x0
int v29; // w23
float v30; // s0
int v31; // w23
float v32; // s0
int v33; // w23
float v34; // s0
int v35; // w23
float v36; // s0
int v37; // w23
float v38; // s0
char v39; // w0
__int64 v40; // x0
size_t v41; // x1
__int64 *v42; // x0
int v43; // w23
float v44; // s0
int v45; // w23
float v46; // s9
char v47; // w0
__int64 v48; // x0
size_t v49; // x1
__int64 *v50; // x0
char v51; // w0
__int64 v52; // x0
size_t v53; // x1
__int64 *v54; // x0
__int64 *v55; // x0
__int64 *v56; // x0
__int64 v58; // [xsp+50h] [xbp+50h] BYREF
size_t v59; // [xsp+58h] [xbp+58h]
void *v60; // [xsp+60h] [xbp+60h]
v2 = GJGameLevel::create(_stack_chk_guard);
v3 = *((_DWORD *)this + 82) - *((_DWORD *)this + 83);
*(_DWORD *)(v2 + 336) = v3;
v4 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 332) = (int)v4;
*(_DWORD *)(v2 + 328) = v3 + (int)v4;
v58 = 0;
v5 = *((_BYTE *)this + 344);
v59 = 0;
v60 = nullptr;
if ( (v5 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 45), *((_QWORD *)this + 44));
}
else
{
v6 = *((_QWORD *)this + 43);
v7 = *((_QWORD *)this + 44);
v60 = *((void **)this + 45);
v58 = v6;
v59 = v7;
}
v8 = (__int64 *)(v2 + 344);
if ( (__int64 *)(v2 + 344) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v8, v60, v59);
else
std::string::assign(v8, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
*(_DWORD *)(v2 + 788) = *((_DWORD *)this + 197);
v58 = 0;
v9 = *((_BYTE *)this + 368);
v59 = 0;
v60 = nullptr;
if ( (v9 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 48), *((_QWORD *)this + 47));
}
else
{
v10 = *((_QWORD *)this + 46);
v11 = *((_QWORD *)this + 47);
v60 = *((void **)this + 48);
v58 = v10;
v59 = v11;
}
v12 = (__int64 *)(v2 + 368);
if ( (__int64 *)(v2 + 368) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v12, v60, v59);
else
std::string::assign(v12, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
v13 = *((_BYTE *)this + 392);
v58 = 0;
v59 = 0;
v60 = nullptr;
if ( (v13 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 51), *((_QWORD *)this + 50));
}
else
{
v14 = *((_QWORD *)this + 49);
v15 = *((_QWORD *)this + 50);
v60 = *((void **)this + 51);
v58 = v14;
v59 = v15;
}
v16 = (__int64 *)(v2 + 392);
if ( (__int64 *)(v2 + 392) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v16, v60, v59);
else
std::string::assign(v16, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
v17 = *((_DWORD *)this + 144) - *((_DWORD *)this + 145);
*(_DWORD *)(v2 + 584) = v17;
v18 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 580) = (int)v18;
*(_DWORD *)(v2 + 576) = v17 + (int)v18;
v58 = 0;
v19 = *((_BYTE *)this + 416);
v59 = 0;
v60 = nullptr;
if ( (v19 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 54), *((_QWORD *)this + 53));
}
else
{
v20 = *((_QWORD *)this + 52);
v21 = *((_QWORD *)this + 53);
v60 = *((void **)this + 54);
v58 = v20;
v59 = v21;
}
v22 = (__int64 *)(v2 + 416);
if ( (__int64 *)(v2 + 416) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v22, v60, v59);
else
std::string::assign(v22, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
v23 = *((_DWORD *)this + 147) - *((_DWORD *)this + 148);
*(_DWORD *)(v2 + 596) = v23;
v24 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 592) = (int)v24;
*(_DWORD *)(v2 + 588) = v23 + (int)v24;
v58 = 0;
v25 = *((_BYTE *)this + 440);
v59 = 0;
v60 = nullptr;
if ( (v25 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 57), *((_QWORD *)this + 56));
}
else
{
v26 = *((_QWORD *)this + 55);
v27 = *((_QWORD *)this + 56);
v60 = *((void **)this + 57);
v58 = v26;
v59 = v27;
}
v28 = (__int64 *)(v2 + 440);
if ( (__int64 *)(v2 + 440) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v28, v60, v59);
else
std::string::assign(v28, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
*(_DWORD *)(v2 + 636) = *((_DWORD *)this + 159);
*(_DWORD *)(v2 + 640) = *((_DWORD *)this + 160);
*(_DWORD *)(v2 + 644) = *((_DWORD *)this + 161);
*(_DWORD *)(v2 + 604) = *((_DWORD *)this + 151);
*(_BYTE *)(v2 + 1000) = *((_BYTE *)this + 1000);
*(_DWORD *)(v2 + 792) = *((_DWORD *)this + 198);
*(_DWORD *)(v2 + 892) = *((_DWORD *)this + 223);
*(_DWORD *)(v2 + 896) = *((_DWORD *)this + 224);
*(_DWORD *)(v2 + 900) = *((_DWORD *)this + 225);
v29 = *((_DWORD *)this + 233) - *((_DWORD *)this + 234);
*(_DWORD *)(v2 + 940) = v29;
v30 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 936) = (int)v30;
*(_DWORD *)(v2 + 932) = v29 + (int)v30;
*(_DWORD *)(v2 + 944) = *((_DWORD *)this + 236);
v31 = *((_DWORD *)this + 237) - *((_DWORD *)this + 238);
*(_DWORD *)(v2 + 956) = v31;
v32 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 952) = (int)v32;
*(_DWORD *)(v2 + 948) = v31 + (int)v32;
*(_DWORD *)(v2 + 904) = *((_DWORD *)this + 226);
*(_DWORD *)(v2 + 908) = *((_DWORD *)this + 227);
*(_BYTE *)(v2 + 960) = *((_BYTE *)this + 960);
v33 = *((_DWORD *)this + 245) - *((_DWORD *)this + 246);
v34 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 984) = (int)v34;
*(_DWORD *)(v2 + 980) = v33 + (int)v34;
v35 = *((_DWORD *)this + 247) - *((_DWORD *)this + 248);
*(_DWORD *)(v2 + 996) = v35;
v36 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 992) = (int)v36;
*(_DWORD *)(v2 + 988) = v35 + (int)v36;
*(_DWORD *)(v2 + 608) = *((_DWORD *)this + 152);
*(_DWORD *)(v2 + 964) = *((_DWORD *)this + 241);
v37 = *((_DWORD *)this + 242) - *((_DWORD *)this + 243);
*(_DWORD *)(v2 + 976) = v37;
v38 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 972) = (int)v38;
*(_DWORD *)(v2 + 968) = v37 + (int)v38;
*(_DWORD *)(v2 + 1044) = *((_DWORD *)this + 261);
v58 = 0;
v39 = *((_BYTE *)this + 1176);
v59 = 0;
v60 = nullptr;
if ( (v39 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 149), *((_QWORD *)this + 148));
}
else
{
v40 = *((_QWORD *)this + 147);
v41 = *((_QWORD *)this + 148);
v60 = *((void **)this + 149);
v58 = v40;
v59 = v41;
}
v42 = (__int64 *)(v2 + 1176);
if ( (__int64 *)(v2 + 1176) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v42, v60, v59);
else
std::string::assign(v42, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
*(_BYTE *)(v2 + 768) = *((_BYTE *)this + 768);
v43 = *((_DWORD *)this + 230) - *((_DWORD *)this + 231);
*(_DWORD *)(v2 + 928) = v43;
v44 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 924) = (int)v44;
*(_DWORD *)(v2 + 920) = v43 + (int)v44;
*(_BYTE *)(v2 + 649) = *((_BYTE *)this + 649);
v45 = *((_DWORD *)this + 155) - *((_DWORD *)this + 156);
*(_DWORD *)(v2 + 628) = v45;
v46 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*(_DWORD *)(v2 + 624) = (int)v46;
*(_DWORD *)(v2 + 620) = v45 + (int)v46;
*(_DWORD *)(v2 + 652) = *((_DWORD *)this + 163);
*(_DWORD *)(v2 + 656) = *((_DWORD *)this + 164);
*(_DWORD *)(v2 + 1232) = *((_DWORD *)this + 308);
v58 = 0;
v47 = *((_BYTE *)this + 464);
v59 = 0;
v60 = nullptr;
if ( (v47 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 60), *((_QWORD *)this + 59));
}
else
{
v48 = *((_QWORD *)this + 58);
v49 = *((_QWORD *)this + 59);
v60 = *((void **)this + 60);
v58 = v48;
v59 = v49;
}
v50 = (__int64 *)(v2 + 464);
if ( (__int64 *)(v2 + 464) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v50, v60, v59);
else
std::string::assign(v50, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
v51 = *((_BYTE *)this + 488);
v58 = 0;
v59 = 0;
v60 = nullptr;
if ( (v51 & 1) != 0 )
{
std::string::__init(&v58, *((void **)this + 63), *((_QWORD *)this + 62));
}
else
{
v52 = *((_QWORD *)this + 61);
v53 = *((_QWORD *)this + 62);
v60 = *((void **)this + 63);
v58 = v52;
v59 = v53;
}
v54 = (__int64 *)(v2 + 488);
if ( (__int64 *)(v2 + 488) != &v58 )
{
if ( (v58 & 1) != 0 )
std::string::assign(v54, v60, v59);
else
std::string::assign(v54, (char *)&v58 + 1, (unsigned __int8)v58 >> 1);
}
if ( (v58 & 1) != 0 )
operator delete(v60);
v55 = (__int64 *)(v2 + 1240);
*(_DWORD *)(v2 + 512) = *((_DWORD *)this + 128);
*(_DWORD *)(v2 + 516) = *((_DWORD *)this + 129);
if ( (GJGameLevel *)(v2 + 1240) != (GJGameLevel *)((char *)this + 1240) )
{
if ( (*((_BYTE *)this + 1240) & 1) != 0 )
std::string::assign(v55, *((const void **)this + 157), *((_QWORD *)this + 156));
else
std::string::assign(v55, (char *)this + 1241, *((_BYTE *)this + 1240) >> 1);
}
v56 = (__int64 *)(v2 + 1264);
if ( (GJGameLevel *)(v2 + 1264) != (GJGameLevel *)((char *)this + 1264) )
{
if ( (*((_BYTE *)this + 1264) & 1) != 0 )
std::string::assign(v56, *((const void **)this + 160), *((_QWORD *)this + 159));
else
std::string::assign(v56, (char *)this + 1265, *((_BYTE *)this + 1264) >> 1);
}
*(_DWORD *)(v2 + 1288) = *((_DWORD *)this + 322);
*(_DWORD *)(v2 + 1140) = *((_DWORD *)this + 285);
return v2;
}