//
// SetupSmartBlockLayer::onCreateTemplate from 0x1405ee250 to 0x1405ee34d (253 bytes)
//
// 2 xrefs:
// > SetupSmartBlockLayer::init @ 0x1405ec810
// > ??> @ 0x14092f0fc
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:35:04 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall SetupSmartBlockLayer::onCreateTemplate(__int64 a1)
{
cocos2d::CCArray *v2; // rax
cocos2d::CCArray *v3; // rbx
struct cocos2d::CCObject *v4; // rdx
struct cocos2d::CCArray *v5; // rdx
__int64 v6; // rax
__int64 v7; // rsi
__int64 v8; // rcx
void *v10; // [rsp+30h] [rbp+8h]
void *v11; // [rsp+30h] [rbp+8h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v3 = v2;
v4 = *(struct cocos2d::CCObject **)(a1 + 688);
if ( v4 )
{
cocos2d::CCArray::addObject(v2, v4);
}
else
{
v5 = *(struct cocos2d::CCArray **)(a1 + 696);
if ( v5 )
cocos2d::CCArray::addObjectsFromArray(v2, v5);
}
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v10 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v10);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
v7 = *(_QWORD *)(v6 + 1664);
v8 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v11 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v8 = qword_14090BFD0;
}
EditorUI::addObjectsToSmartTemplate(*(_QWORD *)(*(_QWORD *)(v8 + 568) + 14904LL), v7, v3);
return SetupSmartBlockLayer::onClose(a1);
}