//
// sub_180051AA0 from 0x180051aa0 to 0x180051b31 (145 bytes)
//
// 2 xrefs:
// > ??> @ 0x1800ee8f0
// > ??> @ 0x1801b22b0
//
// 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::CCNode *__fastcall sub_180051AA0(cocos2d::CCNode *Block, char a2)
{
int v3; // esi
v3 = a2 & 1;
if ( (a2 & 2) != 0 )
{
`eh vector destructor iterator'(
Block,
0x148u,
*(_QWORD *)&Block[-1].m_bUseChildIndex,
(void (*)(void *))cocos2d::CCScene::~CCScene);
if ( v3 )
j_j_j_free_0(&Block[-1].m_bUseChildIndex);
return (cocos2d::CCNode *)((char *)Block - 8);
}
else
{
Block->__vftable = (cocos2d::CCNode_vtbl *)&cocos2d::CCScene::`vftable';
cocos2d::CCNode::~CCNode(Block);
if ( v3 )
j_j_free_0(Block);
return Block;
}
}