//
// GJGameLevel::copyLevelInfo from 0x4c0aa4 to 0x4c0dae (778 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::onClone @ 0x49b25e
// > EditLevelLayer::onClone @ 0x4a20ea
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:23 +0000
//
int __fastcall GJGameLevel::copyLevelInfo(GJGameLevel *this, GJGameLevel *a2)
{
int v4; // r8
unsigned __int8 *v5; // r9
int v6; // r3
int v7; // r2
size_t v8; // r11
cocos2d::CCNode *v9; // r10
char v10; // r3
char *v11; // r1
size_t v12; // r2
int *v13; // r0
int v14; // r1
int v15; // r2
_BYTE v17[8]; // [sp+10h] [bp-8h] BYREF
int v18[3]; // [sp+18h] [bp+0h] BYREF
int v19[3]; // [sp+24h] [bp+Ch] BYREF
int v20[3]; // [sp+30h] [bp+18h] BYREF
int v21[3]; // [sp+3Ch] [bp+24h] BYREF
int v22[3]; // [sp+48h] [bp+30h] BYREF
unsigned __int8 v23[12]; // [sp+54h] [bp+3Ch] BYREF
int v24[3]; // [sp+60h] [bp+48h] BYREF
_DWORD v25[3]; // [sp+6Ch] [bp+54h] BYREF
int v26[3]; // [sp+78h] [bp+60h] BYREF
int v27[3]; // [sp+84h] [bp+6Ch] BYREF
int v28[3]; // [sp+90h] [bp+78h] BYREF
v4 = GameLevelManager::sharedState(this);
std::string::basic_string(v28, (int)a2 + 280);
GameLevelManager::getNextLevelName(v18, v4, (unsigned __int8 *)v28);
std::string::~string((int)v28);
std::string::basic_string(v19, (int)v18);
std::string::operator=((unsigned __int8 *)this + 280, (unsigned __int8 *)v19);
std::string::~string((int)v19);
std::string::basic_string(v20, (int)a2 + 304);
v5 = (unsigned __int8 *)this + 304;
std::string::operator=((unsigned __int8 *)this + 304, (unsigned __int8 *)v20);
std::string::~string((int)v20);
*((_DWORD *)this + 108) = *((_DWORD *)a2 + 108);
*((_DWORD *)this + 109) = *((_DWORD *)a2 + 109);
*((_BYTE *)this + 824) = *((_BYTE *)a2 + 824);
*((_DWORD *)this + 181) = *((_DWORD *)a2 + 181);
*((_DWORD *)this + 250) = *((_DWORD *)a2 + 250);
*((_DWORD *)this + 197) = *((_DWORD *)a2 + 197);
GJGameLevel::unverifyCoins(this);
*((_DWORD *)this + 235) = *((_DWORD *)a2 + 235);
*((_DWORD *)this + 236) = *((_DWORD *)a2 + 236);
*((_DWORD *)this + 234) = *((_DWORD *)a2 + 234);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v17, (GJGameLevel *)((char *)a2 + 928));
cocos2d::CCPoint::operator=((char *)this + 928, v17);
*((_DWORD *)this + 237) = *((_DWORD *)a2 + 237);
*((_DWORD *)this + 121) = *((_DWORD *)a2 + 121) + *((_DWORD *)a2 + 120);
*((_DWORD *)this + 120) = 0;
std::string::basic_string(v21, (int)a2 + 384);
std::string::operator=((unsigned __int8 *)this + 384, (unsigned __int8 *)v21);
std::string::~string((int)v21);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v17, (GJGameLevel *)((char *)a2 + 396));
cocos2d::CCPoint::operator=((char *)this + 396, v17);
std::string::basic_string(v22, (int)a2 + 372);
std::string::operator=((unsigned __int8 *)this + 372, (unsigned __int8 *)v22);
std::string::~string((int)v22);
std::string::operator=((unsigned __int8 *)this + 1020, (unsigned __int8 *)a2 + 1020);
std::string::operator=((unsigned __int8 *)this + 1008, (unsigned __int8 *)a2 + 1008);
*((_DWORD *)this + 258) = *((_DWORD *)a2 + 258);
std::string::operator=((unsigned __int8 *)this + 1328, (unsigned __int8 *)a2 + 1328);
*((_DWORD *)this + 335) = *((_DWORD *)a2 + 335);
std::string::operator=((unsigned __int8 *)this + 1344, (unsigned __int8 *)a2 + 1344);
*((_DWORD *)this + 339) = *((_DWORD *)a2 + 339);
*((_BYTE *)this + 1360) = *((_BYTE *)a2 + 1360);
memcpy((char *)this + 488, (char *)a2 + 488, 0x64u);
if ( *((_DWORD *)a2 + 238) != 2 )
{
v6 = *((_DWORD *)a2 + 67);
v7 = *((_DWORD *)a2 + 68);
if ( v6 != v7 )
{
*((_DWORD *)this + 136) = v6 - v7;
*((_DWORD *)this + 137) = *((_DWORD *)a2 + 153);
}
}
std::string::basic_string(v24, (int)v5);
cocos2d::ZipUtils::decompressString(v23, v24, 0, 11);
std::string::~string((int)v24);
v8 = std::string::find(v23, 59, 0);
if ( v8 != -1 )
{
std::string::basic_string(v27, v23, 0, v8);
v9 = LevelSettingsObject::objectFromString((cocos2d::CCDictionary *)v27);
std::string::~string((int)v27);
v10 = *((_BYTE *)v9 + 377);
if ( v10 )
v10 = *((_BYTE *)v9 + 378);
*((_BYTE *)v9 + 378) = v10;
*((_BYTE *)v9 + 377) = 1;
LevelSettingsObject::getSaveString((LevelSettingsObject *)v25, (int)v9);
std::string::basic_string(v26, v23, v8, 0xFFFFFFFF);
if ( (v26[0] & 1) != 0 )
{
v11 = (char *)v26[2];
v12 = v26[1];
}
else
{
v12 = (int)LOBYTE(v26[0]) >> 1;
v11 = (char *)v26 + 1;
}
v13 = std::string::append(v25, v11, v12);
v14 = v13[1];
v15 = v13[2];
v27[0] = *v13;
v27[1] = v14;
v27[2] = v15;
*v13 = 0;
v13[1] = 0;
v13[2] = 0;
cocos2d::ZipUtils::compressString(v28, v27, 0, -1, 11);
std::string::operator=(v5, (unsigned __int8 *)v28);
std::string::~string((int)v28);
std::string::~string((int)v27);
std::string::~string((int)v26);
std::string::~string((int)v25);
}
std::string::~string((int)v23);
return std::string::~string((int)v18);
}