//
// LevelInfoLayer::onClone from 0x7e76ac to 0x7e77a0 (244 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x7e84a0
// > ??> @ 0x5d1f0
//
// 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:29 +0000
//
__int64 __fastcall LevelInfoLayer::onClone(GJGameLevel **this, cocos2d::CCObject *a2)
{
__int64 result; // x0
GameLevelManager *v4; // x0
GameLevelManager *v5; // x0
GJGameLevel *NewLevel; // x20
_DWORD *v7; // x1
int v8; // w0
int v9; // w19
int v10; // w19
cocos2d::CCDirector *v11; // x0
cocos2d::CCDirector *v12; // x19
GJGameLevel *v13; // x1
cocos2d::CCTransitionFade *v14; // x0
cocos2d::CCScene *v15; // x1
cocos2d::CCScene *v16; // x0
int v17; // w2
int v18; // w0
result = LevelInfoLayer::shouldDownloadLevel((LevelInfoLayer *)this);
if ( !(_BYTE)result )
{
result = *((unsigned __int8 *)this + 488);
if ( !*((_BYTE *)this + 488) )
{
(*((void (__fastcall **)(GJGameLevel **, _QWORD))*this + 134))(this, 0);
*((_BYTE *)this + 488) = (unsigned __int8)&dword_0 + 1;
v4 = (GameLevelManager *)GameManager::sharedState((GameManager *)((char *)&dword_0 + 1));
*((_DWORD *)v4 + 177) = 2;
v5 = (GameLevelManager *)GameLevelManager::sharedState(v4);
NewLevel = (GJGameLevel *)GameLevelManager::createNewLevel(v5);
GJGameLevel::copyLevelInfo(NewLevel, *(this + 63));
v7 = *(this + 63);
v8 = v7[247];
v9 = v7[248];
if ( v8 == v9 )
{
v17 = v7[82];
v18 = v7[83];
v10 = v17 - v18;
if ( v17 == v18 )
v10 = 0;
}
else
{
v10 = v8 - v9;
}
*((_DWORD *)NewLevel + 249) = v10;
v11 = (cocos2d::CCDirector *)(unsigned int)(int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
*((_DWORD *)NewLevel + 248) = (_DWORD)v11;
*((_DWORD *)NewLevel + 247) = v10 + (_DWORD)v11;
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
v14 = (cocos2d::CCTransitionFade *)EditLevelLayer::scene(NewLevel, v13);
v16 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create(v14, 0.5, v15);
return cocos2d::CCDirector::replaceScene(v12, v16);
}
}
return result;
}