{"type": "func", "start": 5370510672, "end": 5370511334, "name": "EditorUI::processSmartObjectsFromType", "pseudocode": "// \n// EditorUI::processSmartObjectsFromType from 0x1401b7d50 to 0x1401b7fe6 (662 bytes)\n// \n// 6 xrefs:\n// > EditorUI::createSmartObjectsFromType @ 0x1401b7ae9\n// > EditorUI::processSmartObjectsFromType @ 0x1401b7efb\n// > EditorUI::processSmartObjectsFromType @ 0x1401b7fcb\n// > <???> @ 0x1408a1e30\n// > <???> @ 0x1408a1e40\n// > <???> @ 0x14091a2c4\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:27:58 +0000\n// \n\nunsigned int __fastcall EditorUI::processSmartObjectsFromType(\n        __int64 a1,\n        unsigned int a2,\n        __int64 a3,\n        cocos2d::CCArray *a4,\n        cocos2d::CCArray *a5,\n        cocos2d::CCArray *a6)\n{\n  bool v10; // bl\n  struct cocos2d::CCObject *v11; // r13\n  int i; // ebx\n  int v13; // eax\n  int v14; // ecx\n  __int64 v15; // rcx\n  struct cocos2d::CCObject *Neighbor; // rsi\n  unsigned int v17; // eax\n  unsigned int SmartObjectKey; // ebp\n  const struct cocos2d::CCPoint *v19; // rax\n  int v20; // eax\n  const struct cocos2d::CCPoint *v21; // rax\n  struct cocos2d::CCObject *Object; // rax\n  unsigned int result; // eax\n  struct cocos2d::CCObject *v24; // rax\n  const struct cocos2d::CCPoint *v25; // rax\n  unsigned int RandomStartKey; // esi\n  int v27; // eax\n  const struct cocos2d::CCPoint *v28; // rax\n  struct cocos2d::CCObject *v29; // rax\n  _BYTE v30[8]; // [rsp+30h] [rbp-68h] BYREF\n  _BYTE v31[8]; // [rsp+38h] [rbp-60h] BYREF\n  _BYTE v32[8]; // [rsp+40h] [rbp-58h] BYREF\n  _BYTE v33[8]; // [rsp+48h] [rbp-50h] BYREF\n  _BYTE v34[16]; // [rsp+50h] [rbp-48h] BYREF\n  bool v35; // [rsp+A8h] [rbp+10h]\n\n  v10 = a2 == 2703 || a2 == 2838 || a2 == 869;\n  v35 = v10;\n  if ( cocos2d::CCArray::count(a5) )\n  {\n    v11 = cocos2d::CCArray::objectAtIndex(a5, 0);\n    (*(void (__fastcall **)(struct cocos2d::CCObject *, _BYTE *))(*(_QWORD *)v11 + 1208LL))(v11, v31);\n    for ( i = 1; i <= 8; ++i )\n    {\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, (const struct cocos2d::CCPoint *)v31);\n      Neighbor = (struct cocos2d::CCObject *)EditorUI::getNeighbor(v14, a2, v13, i, (__int64)a4);\n      if ( Neighbor )\n      {\n        v17 = EditorUI::convertToBaseKey(v15, *((unsigned int *)v11 + 259));\n        SmartObjectKey = EditorUI::getSmartObjectKey(v17, (unsigned int)i);\n        v19 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)Neighbor + 200LL))(Neighbor);\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v19);\n        if ( v35 )\n        {\n          cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, (const struct cocos2d::CCPoint *)v30);\n          SmartObjectKey = EditorUI::convertKeyBasedOnNeighbors(a1, SmartObjectKey, a2, v20, a3);\n        }\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);\n        Object = (struct cocos2d::CCObject *)EditorUI::createObject(a1, SmartObjectKey, v21);\n        cocos2d::CCArray::addObject(a5, Object);\n        cocos2d::CCArray::removeObject(a4, Neighbor, 1);\n      }\n    }\n    cocos2d::CCArray::addObject(a6, v11);\n    cocos2d::CCArray::removeObject(a5, v11, 1);\n    return EditorUI::processSmartObjectsFromType(a1, a2, a3, (_DWORD)a4, (__int64)a5, (__int64)a6);\n  }\n  else\n  {\n    result = cocos2d::CCArray::count(a4);\n    if ( result )\n    {\n      v24 = cocos2d::CCArray::objectAtIndex(a4, 0);\n      v25 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v24 + 200LL))(v24);\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v25);\n      RandomStartKey = EditorUI::getRandomStartKey(a2);\n      if ( v10 )\n      {\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);\n        RandomStartKey = EditorUI::convertKeyBasedOnNeighbors(a1, RandomStartKey, a2, v27, a3);\n      }\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34, (const struct cocos2d::CCPoint *)v30);\n      v29 = (struct cocos2d::CCObject *)EditorUI::createObject(a1, RandomStartKey, v28);\n      cocos2d::CCArray::addObject(a5, v29);\n      cocos2d::CCArray::removeObjectAtIndex(a4, 0, 1);\n      return EditorUI::processSmartObjectsFromType(a1, a2, a3, (_DWORD)a4, (__int64)a5, (__int64)a6);\n    }\n  }\n  return result;\n}", "assembly": "; \n; EditorUI::processSmartObjectsFromType from 0x1401b7d50 to 0x1401b7fe6 (662 bytes)\n; \n; 6 xrefs:\n; > EditorUI::createSmartObjectsFromType @ 0x1401b7ae9\n; > EditorUI::processSmartObjectsFromType @ 0x1401b7efb\n; > EditorUI::processSmartObjectsFromType @ 0x1401b7fcb\n; > <???> @ 0x1408a1e30\n; > <???> @ 0x1408a1e40\n; > <???> @ 0x14091a2c4\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:27:58 +0000\n; \nmov     [rsp+arg_10], r8                                               ; +0x0, 0x1401b7d50\npush    rbx                                                            ; +0x5, 0x1401b7d55\npush    rbp                                                            ; +0x6, 0x1401b7d56\npush    rdi                                                            ; +0x7, 0x1401b7d57\npush    r12                                                            ; +0x8, 0x1401b7d58\npush    r14                                                            ; +0xa, 0x1401b7d5a\npush    r15                                                            ; +0xc, 0x1401b7d5c\nsub     rsp, 68h                                                       ; +0xe, 0x1401b7d5e\nmov     r14, r9                                                        ; +0x12, 0x1401b7d62\nmov     rbp, r8                                                        ; +0x15, 0x1401b7d65\nmov     edi, edx                                                       ; +0x18, 0x1401b7d68\nmov     r15, rcx                                                       ; +0x1a, 0x1401b7d6a\ncmp     edx, 0A8Fh                                                     ; +0x1d, 0x1401b7d6d\njz      short loc_1401B7D89                                            ; +0x23, 0x1401b7d73\ncmp     edx, 0B16h                                                     ; +0x25, 0x1401b7d75\njz      short loc_1401B7D89                                            ; +0x2b, 0x1401b7d7b\ncmp     edx, 365h                                                      ; +0x2d, 0x1401b7d7d\njz      short loc_1401B7D89                                            ; +0x33, 0x1401b7d83\nxor     bl, bl                                                         ; +0x35, 0x1401b7d85\njmp     short loc_1401B7D8B                                            ; +0x37, 0x1401b7d87\nmov     bl, 1                                                          ; +0x39, 0x1401b7d89\nmov     r12, [rsp+98h+arg_20]                                          ; +0x3b, 0x1401b7d8b\nmov     rcx, r12                                                       ; +0x43, 0x1401b7d93\nmov     [rsp+98h+arg_8], bl                                            ; +0x46, 0x1401b7d96\nmov     [rsp+98h+arg_0], rsi                                           ; +0x4d, 0x1401b7d9d\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x55, 0x1401b7da5\ntest    eax, eax                                                       ; +0x5b, 0x1401b7dab\njz      loc_1401B7F0A                                                  ; +0x5d, 0x1401b7dad\nxor     edx, edx                                                       ; +0x63, 0x1401b7db3\nmov     [rsp+98h+var_38], r13                                          ; +0x65, 0x1401b7db5\nmov     rcx, r12                                                       ; +0x6a, 0x1401b7dba\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x6d, 0x1401b7dbd\nlea     rdx, [rsp+98h+var_60]                                          ; +0x73, 0x1401b7dc3\nmov     r13, rax                                                       ; +0x78, 0x1401b7dc8\nmov     rcx, [rax]                                                     ; +0x7b, 0x1401b7dcb\nmov     r8, [rcx+4B8h]                                                 ; +0x7e, 0x1401b7dce\nmov     rcx, rax                                                       ; +0x85, 0x1401b7dd5\ncall    r8                                                             ; +0x88, 0x1401b7dd8\nmov     ebx, 1                                                         ; +0x8b, 0x1401b7ddb\nlea     rdx, [rsp+98h+var_60]                                          ; +0x90, 0x1401b7de0\nlea     rcx, [rsp+98h+var_58]                                          ; +0x95, 0x1401b7de5\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x9a, 0x1401b7dea\nmov     r9d, ebx                                                       ; +0xa0, 0x1401b7df0\nmov     [rsp+98h+var_78], r14                                          ; +0xa3, 0x1401b7df3\nmov     r8, rax                                                        ; +0xa8, 0x1401b7df8\nmov     edx, edi                                                       ; +0xab, 0x1401b7dfb\ncall    EditorUI__getNeighbor                                          ; +0xad, 0x1401b7dfd\nmov     rsi, rax                                                       ; +0xb2, 0x1401b7e02\ntest    rax, rax                                                       ; +0xb5, 0x1401b7e05\njz      loc_1401B7EB3                                                  ; +0xb8, 0x1401b7e08\nmov     edx, [r13+40Ch]                                                ; +0xbe, 0x1401b7e0e\ncall    EditorUI__convertToBaseKey                                     ; +0xc5, 0x1401b7e15\nmov     ecx, eax                                                       ; +0xca, 0x1401b7e1a\nmov     edx, ebx                                                       ; +0xcc, 0x1401b7e1c\ncall    EditorUI__getSmartObjectKey                                    ; +0xce, 0x1401b7e1e\nmov     rcx, [rsi]                                                     ; +0xd3, 0x1401b7e23\nmov     ebp, eax                                                       ; +0xd6, 0x1401b7e26\nmov     rdx, [rcx+0C8h]                                                ; +0xd8, 0x1401b7e28\nmov     rcx, rsi                                                       ; +0xdf, 0x1401b7e2f\ncall    rdx                                                            ; +0xe2, 0x1401b7e32\nmov     rdx, rax                                                       ; +0xe4, 0x1401b7e34\nlea     rcx, [rsp+98h+var_68]                                          ; +0xe7, 0x1401b7e37\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0xec, 0x1401b7e3c\ncmp     [rsp+98h+arg_8], 0                                             ; +0xf2, 0x1401b7e42\njz      short loc_1401B7E7B                                            ; +0xfa, 0x1401b7e4a\nlea     rdx, [rsp+98h+var_68]                                          ; +0xfc, 0x1401b7e4c\nlea     rcx, [rsp+98h+var_50]                                          ; +0x101, 0x1401b7e51\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x106, 0x1401b7e56\nmov     r8d, edi                                                       ; +0x10c, 0x1401b7e5c\nmov     edx, ebp                                                       ; +0x10f, 0x1401b7e5f\nmov     r9, rax                                                        ; +0x111, 0x1401b7e61\nmov     rcx, r15                                                       ; +0x114, 0x1401b7e64\nmov     rax, [rsp+98h+arg_10]                                          ; +0x117, 0x1401b7e67\nmov     [rsp+98h+var_78], rax                                          ; +0x11f, 0x1401b7e6f\ncall    EditorUI__convertKeyBasedOnNeighbors                           ; +0x124, 0x1401b7e74\nmov     ebp, eax                                                       ; +0x129, 0x1401b7e79\nlea     rdx, [rsp+98h+var_68]                                          ; +0x12b, 0x1401b7e7b\nlea     rcx, [rsp+98h+var_48]                                          ; +0x130, 0x1401b7e80\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x135, 0x1401b7e85\nmov     edx, ebp                                                       ; +0x13b, 0x1401b7e8b\nmov     rcx, r15                                                       ; +0x13d, 0x1401b7e8d\nmov     r8, rax                                                        ; +0x140, 0x1401b7e90\ncall    EditorUI__createObject                                         ; +0x143, 0x1401b7e93\nmov     rdx, rax                                                       ; +0x148, 0x1401b7e98\nmov     rcx, r12                                                       ; +0x14b, 0x1401b7e9b\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x14e, 0x1401b7e9e\nmov     r8b, 1                                                         ; +0x154, 0x1401b7ea4\nmov     rdx, rsi                                                       ; +0x157, 0x1401b7ea7\nmov     rcx, r14                                                       ; +0x15a, 0x1401b7eaa\ncall    cs:?removeObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@_N@Z; cocos2d::CCArray::removeObject(cocos2d::CCObject *,bool) ; +0x15d, 0x1401b7ead\ninc     ebx                                                            ; +0x163, 0x1401b7eb3\ncmp     ebx, 8                                                         ; +0x165, 0x1401b7eb5\njle     loc_1401B7DE0                                                  ; +0x168, 0x1401b7eb8\nmov     rbx, [rsp+98h+arg_28]                                          ; +0x16e, 0x1401b7ebe\nmov     rdx, r13                                                       ; +0x176, 0x1401b7ec6\nmov     rcx, rbx                                                       ; +0x179, 0x1401b7ec9\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x17c, 0x1401b7ecc\nmov     r8b, 1                                                         ; +0x182, 0x1401b7ed2\nmov     rdx, r13                                                       ; +0x185, 0x1401b7ed5\nmov     rcx, r12                                                       ; +0x188, 0x1401b7ed8\ncall    cs:?removeObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@_N@Z; cocos2d::CCArray::removeObject(cocos2d::CCObject *,bool) ; +0x18b, 0x1401b7edb\nmov     r8, [rsp+98h+arg_10]                                           ; +0x191, 0x1401b7ee1\nmov     r9, r14                                                        ; +0x199, 0x1401b7ee9\nmov     edx, edi                                                       ; +0x19c, 0x1401b7eec\nmov     [rsp+98h+var_70], rbx                                          ; +0x19e, 0x1401b7eee\nmov     rcx, r15                                                       ; +0x1a3, 0x1401b7ef3\nmov     [rsp+98h+var_78], r12                                          ; +0x1a6, 0x1401b7ef6\ncall    EditorUI__processSmartObjectsFromType                          ; +0x1ab, 0x1401b7efb\nmov     r13, [rsp+98h+var_38]                                          ; +0x1b0, 0x1401b7f00\njmp     loc_1401B7FD0                                                  ; +0x1b5, 0x1401b7f05\nmov     rcx, r14                                                       ; +0x1ba, 0x1401b7f0a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1bd, 0x1401b7f0d\ntest    eax, eax                                                       ; +0x1c3, 0x1401b7f13\njz      loc_1401B7FD0                                                  ; +0x1c5, 0x1401b7f15\nxor     edx, edx                                                       ; +0x1cb, 0x1401b7f1b\nmov     rcx, r14                                                       ; +0x1cd, 0x1401b7f1d\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x1d0, 0x1401b7f20\nmov     rcx, [rax]                                                     ; +0x1d6, 0x1401b7f26\nmov     rdx, [rcx+0C8h]                                                ; +0x1d9, 0x1401b7f29\nmov     rcx, rax                                                       ; +0x1e0, 0x1401b7f30\ncall    rdx                                                            ; +0x1e3, 0x1401b7f33\nmov     rdx, rax                                                       ; +0x1e5, 0x1401b7f35\nlea     rcx, [rsp+98h+var_68]                                          ; +0x1e8, 0x1401b7f38\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x1ed, 0x1401b7f3d\nmov     ecx, edi                                                       ; +0x1f3, 0x1401b7f43\ncall    EditorUI__getRandomStartKey                                    ; +0x1f5, 0x1401b7f45\nmov     esi, eax                                                       ; +0x1fa, 0x1401b7f4a\ntest    bl, bl                                                         ; +0x1fc, 0x1401b7f4c\njz      short loc_1401B7F77                                            ; +0x1fe, 0x1401b7f4e\nlea     rdx, [rsp+98h+var_68]                                          ; +0x200, 0x1401b7f50\nlea     rcx, [rsp+98h+var_48]                                          ; +0x205, 0x1401b7f55\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x20a, 0x1401b7f5a\nmov     r8d, edi                                                       ; +0x210, 0x1401b7f60\nmov     [rsp+98h+var_78], rbp                                          ; +0x213, 0x1401b7f63\nmov     r9, rax                                                        ; +0x218, 0x1401b7f68\nmov     edx, esi                                                       ; +0x21b, 0x1401b7f6b\nmov     rcx, r15                                                       ; +0x21d, 0x1401b7f6d\ncall    EditorUI__convertKeyBasedOnNeighbors                           ; +0x220, 0x1401b7f70\nmov     esi, eax                                                       ; +0x225, 0x1401b7f75\nlea     rdx, [rsp+98h+var_68]                                          ; +0x227, 0x1401b7f77\nlea     rcx, [rsp+98h+var_48]                                          ; +0x22c, 0x1401b7f7c\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x231, 0x1401b7f81\nmov     edx, esi                                                       ; +0x237, 0x1401b7f87\nmov     rcx, r15                                                       ; +0x239, 0x1401b7f89\nmov     r8, rax                                                        ; +0x23c, 0x1401b7f8c\ncall    EditorUI__createObject                                         ; +0x23f, 0x1401b7f8f\nmov     rdx, rax                                                       ; +0x244, 0x1401b7f94\nmov     rcx, r12                                                       ; +0x247, 0x1401b7f97\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x24a, 0x1401b7f9a\nmov     r8b, 1                                                         ; +0x250, 0x1401b7fa0\nxor     edx, edx                                                       ; +0x253, 0x1401b7fa3\nmov     rcx, r14                                                       ; +0x255, 0x1401b7fa5\ncall    cs:?removeObjectAtIndex@CCArray@cocos2d@@QEAAXI_N@Z; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0x258, 0x1401b7fa8\nmov     rax, [rsp+98h+arg_28]                                          ; +0x25e, 0x1401b7fae\nmov     r9, r14                                                        ; +0x266, 0x1401b7fb6\nmov     [rsp+98h+var_70], rax                                          ; +0x269, 0x1401b7fb9\nmov     r8, rbp                                                        ; +0x26e, 0x1401b7fbe\nmov     edx, edi                                                       ; +0x271, 0x1401b7fc1\nmov     [rsp+98h+var_78], r12                                          ; +0x273, 0x1401b7fc3\nmov     rcx, r15                                                       ; +0x278, 0x1401b7fc8\ncall    EditorUI__processSmartObjectsFromType                          ; +0x27b, 0x1401b7fcb\nmov     rsi, [rsp+98h+arg_0]                                           ; +0x280, 0x1401b7fd0\nadd     rsp, 68h                                                       ; +0x288, 0x1401b7fd8\npop     r15                                                            ; +0x28c, 0x1401b7fdc\npop     r14                                                            ; +0x28e, 0x1401b7fde\npop     r12                                                            ; +0x290, 0x1401b7fe0\npop     rdi                                                            ; +0x292, 0x1401b7fe2\npop     rbp                                                            ; +0x293, 0x1401b7fe3\npop     rbx                                                            ; +0x294, 0x1401b7fe4\nretn                                                                   ; +0x295, 0x1401b7fe5", "xrefs": ["EditorUI::createSmartObjectsFromType @ 0x1401b7ae9", "EditorUI::processSmartObjectsFromType @ 0x1401b7efb", "EditorUI::processSmartObjectsFromType @ 0x1401b7fcb", "<???> @ 0x1408a1e30", "<???> @ 0x1408a1e40", "<???> @ 0x14091a2c4"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}