//
// sub_1401F5CF0 from 0x1401f5cf0 to 0x1401f5df0 (256 bytes)
//
// 3 xrefs:
// > sub_1401F88F0 @ 0x1401f88f7
// > ??> @ 0x1405637b8
// > ??> @ 0x1406cc8b8
//
// 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
cocos2d::CCLayer *__fastcall sub_1401F5CF0(cocos2d::CCLayer *Block, char a2)
{
char *v4; // rdi
__int64 v5; // rax
void *v6; // rax
cocos2d::CCObject *v7; // rcx
Block->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCLayer_vtbl *)&GauntletLayer::`vftable';
Block->cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&GauntletLayer::`vftable';
Block->cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&GauntletLayer::`vftable';
Block->cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&GauntletLayer::`vftable';
Block->cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&GauntletLayer::`vftable';
Block->cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&GauntletLayer::`vftable';
v4 = (char *)&Block[1];
Block[1].cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCLayer_vtbl *)&GauntletLayer::`vftable';
v5 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v6 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v5 = qword_1406C2EC0;
}
if ( *(char **)(v5 + 720) == v4 )
*(_QWORD *)(v5 + 720) = 0;
v7 = *(cocos2d::CCObject **)&Block[1].m_fRotationX;
if ( v7 )
cocos2d::CCObject::release(v7);
cocos2d::CCLayer::~CCLayer(Block);
if ( (a2 & 1) != 0 )
j_j_free(Block);
return Block;
}