//
// LevelListLayer::cloneList from 0x100360000 to 0x1003601ad (429 bytes)
//
// 1 xrefs:
// > LevelListLayer::FLAlert_Clicked @ 0x10035ff7e
//
// 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 __fastcall LevelListLayer::cloneList(LevelListLayer *a1)
{
__int128 v1; // xmm0
GameLevelManager *v2; // rax
GJLevelList *NewLevelList; // r14
GJLevelList *m_levelList; // rsi
GJLevelList *v5; // rax
std::string *p_m_listName; // rax
unsigned int v7; // eax
GJLevelList *v8; // rcx
int m_original; // eax
cocos2d::CCDirector *v10; // rbx
cocos2d::CCScene *v11; // rax
cocos2d::CCTransitionFade *v12; // rax
std::string __str; // [rsp+0h] [rbp-50h] BYREF
std::string v14; // [rsp+20h] [rbp-30h] BYREF
if ( a1->m_exiting )
return;
((void (__fastcall *)(LevelListLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
a1->m_exiting = 1;
GameManager::sharedState()->m_sceneEnum = 14;
v2 = GameLevelManager::sharedState();
NewLevelList = GameLevelManager::createNewLevelList(v2);
GameLevelManager::sharedState()->m_returnToLocalLevels = 1;
m_levelList = a1->m_levelList;
NewLevelList->m_difficulty = m_levelList->m_difficulty;
std::string::operator=((std::string *)&NewLevelList->m_listDesc, (const std::string *)&m_levelList->m_listDesc);
GJLevelList::duplicateListLevels(NewLevelList);
v5 = a1->m_levelList;
if ( (v5->m_listName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v14, v5->m_listName.m_data.m_long.longStorage, v5->m_listName.m_data.m_long.size, *(double *)&v1);
v7 = (unsigned int)v14.__r_.__value_.__l.0;
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_4:
if ( v7 >> 1 > 0x17uLL )
goto LABEL_5;
LABEL_9:
std::string::append(&v14, " 2");
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_6;
LABEL_10:
sub_100006B70(&__str, v14.__r_.__value_.__l.__data_, v14.__r_.__value_.__l.__size_, *(double *)&v1);
goto LABEL_11;
}
}
else
{
p_m_listName = &v5->m_listName;
v14.__r_.__value_.__r.__words[2] = (std::string::size_type)p_m_listName->m_data.m_long.longStorage;
v1 = *(_OWORD *)&p_m_listName->m_data.m_short.sizex2;
*(_OWORD *)&v14.__r_.__value_.__l.0 = *(_OWORD *)&p_m_listName->m_data.m_short.sizex2;
v7 = (unsigned int)v14.__r_.__value_.__l.0;
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_4;
}
if ( v14.__r_.__value_.__l.__size_ <= 0x17 )
goto LABEL_9;
LABEL_5:
if ( (v7 & 1) != 0 )
goto LABEL_10;
LABEL_6:
__str = v14;
LABEL_11:
std::string::operator=((std::string *)&NewLevelList->m_listName, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
v8 = a1->m_levelList;
m_original = v8->m_original;
if ( !m_original )
m_original = v8->m_listID;
NewLevelList->m_original = m_original;
v10 = cocos2d::CCDirector::sharedDirector();
v11 = LevelListLayer::scene(NewLevelList);
v12 = cocos2d::CCTransitionFade::create_1(0.5, v11);
cocos2d::CCDirector::replaceScene(v10, v12);
if ( (*(_BYTE *)&v14.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v14.__r_.__value_.__l.__data_);
}