//
// sub_140333810 from 0x140333810 to 0x1403338fe (238 bytes)
//
// 3 xrefs:
// > sub_1403363E8 @ 0x1403363ef
// > ??> @ 0x1405aae48
// > ??> @ 0x1406d50e4
//
// 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
//
// Hidden C++ exception states: #wind=1
MenuLayer *__fastcall sub_140333810(MenuLayer *Block, char a2)
{
__int64 v4; // rax
void *v5; // rax
Block->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (MenuLayer_vtbl *)&MenuLayer::`vftable';
Block->cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&MenuLayer::`vftable';
Block->cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&MenuLayer::`vftable';
Block->cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&MenuLayer::`vftable';
Block->cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&MenuLayer::`vftable';
Block->cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&MenuLayer::`vftable';
Block->FLAlertLayerProtocol::__vftable = (FLAlertLayerProtocol_vtbl *)&MenuLayer::`vftable';
Block->GooglePlayDelegate::__vftable = (GooglePlayDelegate_vtbl *)&MenuLayer::`vftable';
v4 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v5 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v5);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = qword_1406C2ED8;
}
*(_QWORD *)(v4 + 552) = 0;
MenuLayer::willClose(Block);
cocos2d::CCLayer::~CCLayer(Block);
if ( (a2 & 1) != 0 )
j_j_free(Block);
return Block;
}