//
// MenuLayer::scene from 0x10038ffc0 to 0x100390106 (326 bytes)
//
// 24 xrefs:
// > CreatorLayer::onBack @ 0x100299784
// > CreatorLayer::keyBackClicked @ 0x1002999d4
// > sub_100299A20 @ 0x100299a34
// > GJGarageLayer::onBack @ 0x10036c053
// > GameManager::returnToLastScene @ 0x10038bf52
// > GameManager::returnToLastScene @ 0x10038c0e6
// > GameManager::safePopScene @ 0x10038c2a7
// > GameManager::reloadMenu @ 0x10038c363
// > GameManager::reloadAllStep5 @ 0x10038c6e9
// > LoadingLayer::loadAssets @ 0x1003a3239
// > LoadingLayer::loadingFinished @ 0x1003a3678
// > WorldSelectLayer::onBack @ 0x1003c2677
// > WorldSelectLayer::keyBackClicked @ 0x1003c39d7
// > sub_1003C3A00 @ 0x1003c3a3f
// > LevelSelectLayer::onBack @ 0x100432a0b
// > LevelSelectLayer::keyBackClicked @ 0x1004346fb
// > sub_100434730 @ 0x100434756
// > SecretLayer6::onBack @ 0x10047f068
// > SecretLayer6::keyBackClicked @ 0x10047f808
// > sub_10047F830 @ 0x10047f863
// > SecretLayer::onBack @ 0x1005fb930
// > SecretLayer::keyBackClicked @ 0x1005fe840
// > sub_1005FE870 @ 0x1005fe8b9
// > VideoOptionsLayer::reloadMenu @ 0x1007a0b53
//
// 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
//
cocos2d::CCScene *__fastcall MenuLayer::scene(bool a1)
{
cocos2d::CCScene *v1; // rbx
MenuLayer *v2; // r14
unsigned int v3; // r15d
unsigned int v4; // eax
int v5; // ecx
int v6; // r8d
int v7; // r9d
cocos2d::CCAction *v8; // rax
v1 = cocos2d::CCScene::create();
v1->m_eObjType = MenuLayerObjectType;
AppDelegate::get()->m_runningScene = v1;
v2 = (MenuLayer *)operator new(0x1E0u);
cocos2d::CCLayer::CCLayer(v2);
v2->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (MenuLayer_vtbl *)off_10091F670;
v2->cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)off_10091FB00;
v2->cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&off_10091FB70;
v2->cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)off_10091FB88;
v2->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)off_10091FBA8;
v2->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)off_10091FBC8;
v2->FLAlertLayerProtocol::__vftable = (FLAlertLayerProtocol_vtbl *)&off_10091FBF0;
v2->GooglePlayDelegate::__vftable = (GooglePlayDelegate_vtbl *)&off_10091FC08;
v2->m_showingTOS = 0;
*(_OWORD *)&v2->m_gpSprite = 0;
*(_OWORD *)&v2->m_profileLabel = 0;
v2->m_unknown = nullptr;
if ( MenuLayer::init(v2) )
{
cocos2d::CCObject::autorelease(v2);
}
else
{
((void (__fastcall *)(MenuLayer *))v2->~MenuLayer_0)(v2);
v2 = nullptr;
}
((void (__fastcall *)(cocos2d::CCScene *, MenuLayer *))v1->addChild)(v1, v2);
if ( a1 )
{
v3 = (unsigned int)cocos2d::CCDelayTime::create(0.0);
v4 = (unsigned int)cocos2d::CCCallFunc::create(
v2,
(cocos2d::SEL_CallFunc)(unsigned __int64)MenuLayer::onOptionsInstant);
v8 = (cocos2d::CCAction *)sub_1003B5760(v3, v4, 0, v5, v6, v7);
cocos2d::CCNode::runAction(v2, v8);
}
return v1;
}