//
// LevelInfoLayer::tryCloneLevel from 0x6d6fdc to 0x6d7154 (376 bytes)
//
// 3 xrefs:
// > ??> @ 0x985e0
// > LevelInfoLayer::init @ 0x6dcd18
// > ??> @ 0x122d358
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelInfoLayer::tryCloneLevel(LevelInfoLayer *a1, cocos2d::CCObject *a2)
{
GJGameLevel *m_level; // x2
FLAlertLayer *v4; // x20
void *v5; // x0
NumberInputLayer *v6; // x0
NumberInputLayer_vtbl *v7; // x2
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+30h] [xbp+30h] BYREF
if ( !a1->m_isBusy )
{
m_level = a1->m_level;
if ( m_level->m_password.random - m_level->m_password.seed == 1 )
{
LevelInfoLayer::confirmClone(a1, nullptr);
}
else if ( m_level->m_failedPasswordAttempts <= 4 )
{
v6 = NumberInputLayer::create();
v7 = v6->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v6->m_delegate = &a1->NumberInputDelegate;
v6->m_maximum = 6;
((void (*)(void))v7->show)();
}
else
{
sub_D153B8((int)&v10, "Too many failed attempts!");
v4 = FLAlertLayer::create(0, (__int64)"Error", (__int64)&v10);
v5 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v5);
}
v4->show(v4);
}
}
}