//
// EditorUI::processSmartObjectsFromType from 0x1401b7d50 to 0x1401b7fe6 (662 bytes)
//
// 6 xrefs:
// > EditorUI::createSmartObjectsFromType @ 0x1401b7ae9
// > EditorUI::processSmartObjectsFromType @ 0x1401b7efb
// > EditorUI::processSmartObjectsFromType @ 0x1401b7fcb
// > ??> @ 0x1408a1e30
// > ??> @ 0x1408a1e40
// > ??> @ 0x14091a2c4
//
// 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:27:58 +0000
//
unsigned int __fastcall EditorUI::processSmartObjectsFromType(
__int64 a1,
unsigned int a2,
__int64 a3,
cocos2d::CCArray *a4,
cocos2d::CCArray *a5,
cocos2d::CCArray *a6)
{
bool v10; // bl
struct cocos2d::CCObject *v11; // r13
int i; // ebx
int v13; // eax
int v14; // ecx
__int64 v15; // rcx
struct cocos2d::CCObject *Neighbor; // rsi
unsigned int v17; // eax
unsigned int SmartObjectKey; // ebp
const struct cocos2d::CCPoint *v19; // rax
int v20; // eax
const struct cocos2d::CCPoint *v21; // rax
struct cocos2d::CCObject *Object; // rax
unsigned int result; // eax
struct cocos2d::CCObject *v24; // rax
const struct cocos2d::CCPoint *v25; // rax
unsigned int RandomStartKey; // esi
int v27; // eax
const struct cocos2d::CCPoint *v28; // rax
struct cocos2d::CCObject *v29; // rax
_BYTE v30[8]; // [rsp+30h] [rbp-68h] BYREF
_BYTE v31[8]; // [rsp+38h] [rbp-60h] BYREF
_BYTE v32[8]; // [rsp+40h] [rbp-58h] BYREF
_BYTE v33[8]; // [rsp+48h] [rbp-50h] BYREF
_BYTE v34[16]; // [rsp+50h] [rbp-48h] BYREF
bool v35; // [rsp+A8h] [rbp+10h]
v10 = a2 == 2703 || a2 == 2838 || a2 == 869;
v35 = v10;
if ( cocos2d::CCArray::count(a5) )
{
v11 = cocos2d::CCArray::objectAtIndex(a5, 0);
(*(void (__fastcall **)(struct cocos2d::CCObject *, _BYTE *))(*(_QWORD *)v11 + 1208LL))(v11, v31);
for ( i = 1; i <= 8; ++i )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (const struct cocos2d::CCPoint *)v31);
Neighbor = (struct cocos2d::CCObject *)EditorUI::getNeighbor(v14, a2, v13, i, (__int64)a4);
if ( Neighbor )
{
v17 = EditorUI::convertToBaseKey(v15, *((unsigned int *)v11 + 259));
SmartObjectKey = EditorUI::getSmartObjectKey(v17, (unsigned int)i);
v19 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)Neighbor + 200LL))(Neighbor);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v19);
if ( v35 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, (const struct cocos2d::CCPoint *)v30);
SmartObjectKey = EditorUI::convertKeyBasedOnNeighbors(a1, SmartObjectKey, a2, v20, a3);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);
Object = (struct cocos2d::CCObject *)EditorUI::createObject(a1, SmartObjectKey, v21);
cocos2d::CCArray::addObject(a5, Object);
cocos2d::CCArray::removeObject(a4, Neighbor, 1);
}
}
cocos2d::CCArray::addObject(a6, v11);
cocos2d::CCArray::removeObject(a5, v11, 1);
return EditorUI::processSmartObjectsFromType(a1, a2, a3, (_DWORD)a4, (__int64)a5, (__int64)a6);
}
else
{
result = cocos2d::CCArray::count(a4);
if ( result )
{
v24 = cocos2d::CCArray::objectAtIndex(a4, 0);
v25 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v24 + 200LL))(v24);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v25);
RandomStartKey = EditorUI::getRandomStartKey(a2);
if ( v10 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);
RandomStartKey = EditorUI::convertKeyBasedOnNeighbors(a1, RandomStartKey, a2, v27, a3);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);
v29 = (struct cocos2d::CCObject *)EditorUI::createObject(a1, RandomStartKey, v28);
cocos2d::CCArray::addObject(a5, v29);
cocos2d::CCArray::removeObjectAtIndex(a4, 0, 1);
return EditorUI::processSmartObjectsFromType(a1, a2, a3, (_DWORD)a4, (__int64)a5, (__int64)a6);
}
}
return result;
}