//
// SetupSmartBlockLayer::onCreateAll from 0x1000700b4 to 0x1000701f4 (320 bytes)
//
// 1 xrefs:
// > SetupSmartBlockLayer::init @ 0x10006f488
//
// 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 SetupSmartBlockLayer::onCreateAll(SetupSmartBlockLayer *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v2; // x0
GJSmartTemplate *ActiveSmartTemplate; // x0
GJSmartTemplate *v4; // x19
cocos2d::CCDictionary *m_prefabArrays; // x20
cocos2d::CCArray *v6; // x21
unsigned int v7; // w22
cocos2d::CCString *v8; // x0
char *CString; // x0
__int64 v10; // x23
__int64 i; // x24
__int64 v12; // x25
EditorUI *m_editorUI; // x26
void *__p[2]; // [xsp+0h] [xbp-70h] BYREF
__int64 v15; // [xsp+10h] [xbp-60h]
void *v16[2]; // [xsp+18h] [xbp-58h] BYREF
__int64 v17; // [xsp+28h] [xbp-48h]
v2 = GameLevelManager::sharedState();
ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v2);
if ( ActiveSmartTemplate )
{
v4 = ActiveSmartTemplate;
ActiveSmartTemplate->m_prefabIndex = 0;
m_prefabArrays = ActiveSmartTemplate->m_prefabArrays;
if ( m_prefabArrays )
{
v6 = cocos2d::CCDictionary::allKeys(ActiveSmartTemplate->m_prefabArrays);
if ( (unsigned int)sub_10024A36C(v6) )
{
v7 = 0;
do
{
v8 = cocos2d::CCArray::stringAtIndex(v6, v7);
CString = (char *)cocos2d::CCString::getCString(v8);
sub_100009900(v16, CString);
v10 = cocos2d::CCDictionary::objectForKey_1(m_prefabArrays, v16);
for ( i = 0; (unsigned int)i < (unsigned int)sub_10024A36C(v10); i = (unsigned int)(i + 1) )
{
v12 = sub_10024A388(v10, i);
m_editorUI = GameManager::sharedState()->m_levelEditorLayer->m_editorUI;
if ( SHIBYTE(v17) < 0 )
{
sub_1000097D0(__p, v16[0], (unsigned __int64)v16[1]);
}
else
{
*(_OWORD *)__p = *(_OWORD *)v16;
v15 = v17;
}
EditorUI::createPrefab(m_editorUI, v4, __p, *(unsigned int *)(v12 + 104));
if ( SHIBYTE(v15) < 0 )
operator delete(__p[0]);
}
if ( SHIBYTE(v17) < 0 )
operator delete(v16[0]);
++v7;
}
while ( v7 < (unsigned int)sub_10024A36C(v6) );
}
}
}
}