//
// sub_1403F3740 from 0x1403f3740 to 0x1403f3882 (322 bytes)
//
// 3 xrefs:
// > sub_1403F82EC @ 0x1403f82f3
// > ??> @ 0x1405d5398
// > ??> @ 0x1406d81e0
//
// 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_1403F3740(cocos2d::CCLayer *Block, char a2)
{
unsigned int *p_m_uAutoReleaseCount; // rdi
cocos2d::CCObject *v5; // rcx
__int64 v6; // rax
void *v7; // rax
Block->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCLayer_vtbl *)&SecretLayer5::`vftable';
Block->cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&SecretLayer5::`vftable';
Block->cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&SecretLayer5::`vftable';
Block->cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&SecretLayer5::`vftable';
Block->cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&SecretLayer5::`vftable';
Block->cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&SecretLayer5::`vftable';
Block[1].cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCLayer_vtbl *)&SecretLayer5::`vftable';
*(_QWORD *)&Block[1].m_uID = &SecretLayer5::`vftable';
*(_QWORD *)&Block[1].m_nTag = &SecretLayer5::`vftable';
p_m_uAutoReleaseCount = &Block[1].m_uAutoReleaseCount;
*(_QWORD *)&Block[1].m_uAutoReleaseCount = &SecretLayer5::`vftable';
v5 = *(cocos2d::CCObject **)&Block[1].m_obAnchorPointInPoints.y;
if ( v5 )
cocos2d::CCObject::release(v5);
v6 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v7 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v6 = qword_1406C2EC0;
}
if ( *(unsigned int **)(v6 + 864) == p_m_uAutoReleaseCount )
*(_QWORD *)(v6 + 864) = 0;
sub_14005E430((__int64)&Block[1].m_pCamera);
sub_14003A830((__int64)&Block[1].m_obContentSize.height);
cocos2d::CCLayer::~CCLayer(Block);
if ( (a2 & 1) != 0 )
j_j_free(Block);
return Block;
}