//
// BrowseSmartKeyLayer::createTemplateObjects from 0x1004eb7a0 to 0x1004eb901 (353 bytes)
//
// 1 xrefs:
// > BrowseSmartKeyLayer::onButton @ 0x1004eb742
//
// 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
//
void __fastcall BrowseSmartKeyLayer::createTemplateObjects(BrowseSmartKeyLayer *a1)
{
double v1; // xmm0_8
cocos2d::CCArray *AllSelectedBlocks; // r14
std::string *p_m_prefabKey; // r12
unsigned int v4; // r15d
__int64 v5; // r13
int v6; // eax
cocos2d::CCObject *v7; // rax
__int128 v8; // [rsp+8h] [rbp-78h] BYREF
void *v9; // [rsp+18h] [rbp-68h]
std::string v10; // [rsp+20h] [rbp-60h] BYREF
char v11; // [rsp+38h] [rbp-48h] BYREF
_BYTE v12[23]; // [rsp+39h] [rbp-47h] BYREF
std::string::pointer *p_data; // [rsp+50h] [rbp-30h]
AllSelectedBlocks = BrowseSmartKeyLayer::getAllSelectedBlocks(a1);
if ( (unsigned int)sub_100720070(AllSelectedBlocks) )
{
if ( (unsigned int)sub_100720070(AllSelectedBlocks) )
{
p_m_prefabKey = &a1->m_prefabKey;
v4 = 0;
p_data = &v10.__r_.__value_.__l.__data_;
do
{
v5 = sub_1007200C0(AllSelectedBlocks, v4);
if ( (p_m_prefabKey->m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v10, a1->m_prefabKey.m_data.m_long.longStorage, a1->m_prefabKey.m_data.m_long.size, v1);
}
else
{
v10.__r_.__value_.__r.__words[2] = (std::string::size_type)a1->m_prefabKey.m_data.m_long.longStorage;
*(_OWORD *)&v10.__r_.__value_.__l.0 = *(_OWORD *)&p_m_prefabKey->m_data.m_short.sizex2;
}
v1 = (*(double (__fastcall **)(__int64))(*(_QWORD *)v5 + 64LL))(v5);
BrowseSmartTemplateLayer::createPrefab((__int64)a1, &v10, v6, v1);
if ( (*(_BYTE *)&v10.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v10.__r_.__value_.__l.__data_);
++v4;
}
while ( v4 < (unsigned int)sub_100720070(AllSelectedBlocks) );
}
v11 = 30;
strcpy(v12, "Added to editor");
LOWORD(v8) = 0;
v7 = TextAlertPopup::create((__int64)&v11, 0x96u, &v8, (__m128)0x3F000000u, 0.60000002);
((void (__fastcall *)(BrowseSmartKeyLayer *, cocos2d::CCObject *, __int64))a1->addChild_0)(a1, v7, 100);
if ( (v8 & 1) != 0 )
operator delete(v9);
if ( (v11 & 1) != 0 )
operator delete(*(void **)&v12[15]);
}
}