{"type": "func", "start": 4729384, "end": 4729812, "name": "EditorUI::processSmartObjectsFromType", "pseudocode": "// \n// EditorUI::processSmartObjectsFromType from 0x482a28 to 0x482bd4 (428 bytes)\n// \n// 2 xrefs:\n// > EditorUI::processSmartObjectsFromType @ 0x482bbc\n// > EditorUI::createSmartObjectsFromType @ 0x482d36\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:23 +0000\n// \n\nint __fastcall EditorUI::processSmartObjectsFromType(\n        EditorUI *this,\n        EditorUI *a2,\n        cocos2d::CCArray *a3,\n        cocos2d::CCArray *a4,\n        cocos2d::CCArray *a5,\n        cocos2d::CCArray *a6)\n{\n  _BOOL4 v9; // r3\n  int v10; // r11\n  int *v11; // r9\n  cocos2d::CCObject *Neighbor; // r10\n  int v13; // r0\n  const cocos2d::CCPoint *v14; // r0\n  cocos2d::CCObject *Object; // r0\n  int result; // r0\n  int v17; // r0\n  const cocos2d::CCPoint *v18; // r0\n  int v19; // r1\n  GameObject *RandomStartKey; // r10\n  cocos2d::CCObject *v21; // r0\n  _BOOL4 v22; // [sp+Ch] [bp-40h]\n  GameObject *SmartObjectKey; // [sp+14h] [bp-38h]\n  _BYTE v25[8]; // [sp+2Ch] [bp-20h] BYREF\n  _BYTE v26[8]; // [sp+34h] [bp-18h] BYREF\n  _BYTE v27[8]; // [sp+3Ch] [bp-10h] BYREF\n\n  v9 = a2 == (EditorUI *)((char *)&stru_A8C.st_name + 3)\n    || a2 == (EditorUI *)((char *)&stru_B0C.st_size + 2)\n    || a2 == (EditorUI *)((char *)&stru_35C.st_size + 1);\n  v22 = v9;\n  if ( cocos2d::CCArray::count(a5) )\n  {\n    v10 = 1;\n    v11 = (int *)cocos2d::CCArray::objectAtIndex(a5, 0);\n    (*(void (__fastcall **)(_BYTE *, int *))(*v11 + 680))(v25, v11);\n    do\n    {\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, (const cocos2d::CCPoint *)v25);\n      Neighbor = (cocos2d::CCObject *)EditorUI::getNeighbor((int)this, (int)a2, (int)v27, v10, a4);\n      if ( Neighbor )\n      {\n        v13 = EditorUI::convertToBaseKey(this, v11[223]);\n        SmartObjectKey = (GameObject *)EditorUI::getSmartObjectKey(v13, v10);\n        v14 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)Neighbor + 96))(Neighbor);\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, v14);\n        if ( v22 )\n        {\n          cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, (const cocos2d::CCPoint *)v26);\n          SmartObjectKey = (GameObject *)EditorUI::convertKeyBasedOnNeighbors(this, SmartObjectKey, a2, v27, a3);\n        }\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, (const cocos2d::CCPoint *)v26);\n        Object = EditorUI::createObject((int)this, SmartObjectKey, (const cocos2d::CCPoint *)v27);\n        cocos2d::CCArray::addObject(a5, Object);\n        cocos2d::CCArray::removeObject(a4, Neighbor, 1);\n      }\n      ++v10;\n    }\n    while ( v10 != 9 );\n    cocos2d::CCArray::addObject(a6, (cocos2d::CCObject *)v11);\n    cocos2d::CCArray::removeObject(a5, (cocos2d::CCObject *)v11, 1);\n  }\n  else\n  {\n    result = cocos2d::CCArray::count(a4);\n    if ( !result )\n      return result;\n    v17 = cocos2d::CCArray::objectAtIndex(a4, 0);\n    v18 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(int))(*(_DWORD *)v17 + 96))(v17);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, v18);\n    RandomStartKey = (GameObject *)EditorUI::getRandomStartKey(a2, v19);\n    if ( v22 )\n    {\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, (const cocos2d::CCPoint *)v26);\n      RandomStartKey = (GameObject *)EditorUI::convertKeyBasedOnNeighbors(this, RandomStartKey, a2, v27, a3);\n    }\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, (const cocos2d::CCPoint *)v26);\n    v21 = EditorUI::createObject((int)this, RandomStartKey, (const cocos2d::CCPoint *)v27);\n    cocos2d::CCArray::addObject(a5, v21);\n    cocos2d::CCArray::removeObjectAtIndex(a4, 0, 1);\n  }\n  return EditorUI::processSmartObjectsFromType(this, (int)a2, a3, a4, a5, a6);\n}", "assembly": "; \n; EditorUI::processSmartObjectsFromType from 0x482a28 to 0x482bd4 (428 bytes)\n; \n; 2 xrefs:\n; > EditorUI::processSmartObjectsFromType @ 0x482bbc\n; > EditorUI::createSmartObjectsFromType @ 0x482d36\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:23 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x482a28\nSUB             SP, SP, #0x4C                                          ; +0x4, 0x482a2c\nMOV             R6, R3                                                 ; +0x6, 0x482a2e\nMOV             R5, R0                                                 ; +0x8, 0x482a30\nLDR             R3, [SP,#0x4C+arg_4]                                   ; +0xa, 0x482a32\nMOV             R4, R1                                                 ; +0xc, 0x482a34\nSTR             R2, [SP,#0x4C+var_3C]                                  ; +0xe, 0x482a36\nLDR             R7, [SP,#0x4C+arg_0]                                   ; +0x10, 0x482a38\nSTR             R3, [SP,#0x4C+var_34]                                  ; +0x12, 0x482a3a\nLDR             R3, =(__stack_chk_guard_ptr - 0x482A42)                ; +0x14, 0x482a3c\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x16, 0x482a3e\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x18, 0x482a40\nSTR             R3, [SP,#0x4C+var_2C]                                  ; +0x1a, 0x482a42\nLDR             R2, [R3]                                               ; +0x1c, 0x482a44\nSTR             R2, [SP,#0x4C+var_8]                                   ; +0x1e, 0x482a46\nMOVW            R2, #0xA8F                                             ; +0x20, 0x482a48\nCMP             R1, R2                                                 ; +0x24, 0x482a4c\nBEQ             loc_482A64                                             ; +0x26, 0x482a4e\nMOVW            R3, #0xB16                                             ; +0x28, 0x482a50\nCMP             R1, R3                                                 ; +0x2c, 0x482a54\nBEQ             loc_482A64                                             ; +0x2e, 0x482a56\nMOVW            R3, #0x365                                             ; +0x30, 0x482a58\nSUBS            R2, R1, R3                                             ; +0x34, 0x482a5c\nNEGS            R3, R2                                                 ; +0x36, 0x482a5e\nADCS            R3, R2                                                 ; +0x38, 0x482a60\nB               loc_482A66                                             ; +0x3a, 0x482a62\nMOVS            R3, #1                                                 ; +0x3c, 0x482a64\nMOV             R0, R7; this                                           ; +0x3e, 0x482a66\nSTR             R3, [SP,#0x4C+var_40]                                  ; +0x40, 0x482a68\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x42, 0x482a6a\nMOV             R8, R0                                                 ; +0x46, 0x482a6e\nCMP             R0, #0                                                 ; +0x48, 0x482a70\nBEQ             loc_482B3C                                             ; +0x4a, 0x482a72\nMOVS            R1, #0; unsigned int                                   ; +0x4c, 0x482a74\nMOV             R0, R7; this                                           ; +0x4e, 0x482a76\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x50, 0x482a78\nADD.W           R10, SP, #0x4C+var_20                                  ; +0x54, 0x482a7c\nADD.W           R8, SP, #0x4C+var_10                                   ; +0x58, 0x482a80\nMOV.W           R11, #1                                                ; +0x5c, 0x482a84\nLDR             R3, [R0]                                               ; +0x60, 0x482a88\nMOV             R9, R0                                                 ; +0x62, 0x482a8a\nMOV             R1, R9                                                 ; +0x64, 0x482a8c\nMOV             R0, R10                                                ; +0x66, 0x482a8e\nLDR.W           R3, [R3,#0x2A8]                                        ; +0x68, 0x482a90\nBLX             R3                                                     ; +0x6c, 0x482a94\nADD             R3, SP, #0x4C+var_18                                   ; +0x6e, 0x482a96\nSTR.W           R10, [SP,#0x4C+var_28]                                 ; +0x70, 0x482a98\nSTR             R3, [SP,#0x4C+var_30]                                  ; +0x74, 0x482a9c\nLDR             R1, [SP,#0x4C+var_28]; cocos2d::CCPoint *              ; +0x76, 0x482a9e\nMOV             R0, R8; this                                           ; +0x78, 0x482aa0\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x7a, 0x482aa2\nSTR             R6, [SP,#0x4C+var_4C]                                  ; +0x7e, 0x482aa6\nMOV             R0, R5                                                 ; +0x80, 0x482aa8\nMOV             R1, R4                                                 ; +0x82, 0x482aaa\nMOV             R2, R8                                                 ; +0x84, 0x482aac\nMOV             R3, R11                                                ; +0x86, 0x482aae\nBL              _ZN8EditorUI11getNeighborEiN7cocos2d7CCPointE16GJSmartDirectionPNS0_7CCArrayE; EditorUI::getNeighbor(int,cocos2d::CCPoint,GJSmartDirection,cocos2d::CCArray *) ; +0x88, 0x482ab0\nMOV             R10, R0                                                ; +0x8c, 0x482ab4\nCBZ             R0, loc_482B1E                                         ; +0x8e, 0x482ab6\nLDR.W           R1, [R9,#0x37C]; int                                   ; +0x90, 0x482ab8\nMOV             R0, R5; this                                           ; +0x94, 0x482abc\nBL              _ZN8EditorUI16convertToBaseKeyEi; EditorUI::convertToBaseKey(int) ; +0x96, 0x482abe\nMOV             R1, R11                                                ; +0x9a, 0x482ac2\nBL              _ZN8EditorUI17getSmartObjectKeyEi16GJSmartDirection; EditorUI::getSmartObjectKey(int,GJSmartDirection) ; +0x9c, 0x482ac4\nLDR.W           R3, [R10]                                              ; +0xa0, 0x482ac8\nLDR             R3, [R3,#0x60]                                         ; +0xa4, 0x482acc\nSTR             R0, [SP,#0x4C+var_38]                                  ; +0xa6, 0x482ace\nMOV             R0, R10                                                ; +0xa8, 0x482ad0\nBLX             R3                                                     ; +0xaa, 0x482ad2\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0xac, 0x482ad4\nLDR             R0, [SP,#0x4C+var_30]; this                            ; +0xae, 0x482ad6\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xb0, 0x482ad8\nLDR             R3, [SP,#0x4C+var_40]                                  ; +0xb4, 0x482adc\nCBZ             R3, loc_482AFA                                         ; +0xb6, 0x482ade\nLDR             R1, [SP,#0x4C+var_30]; cocos2d::CCPoint *              ; +0xb8, 0x482ae0\nMOV             R0, R8; this                                           ; +0xba, 0x482ae2\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xbc, 0x482ae4\nLDR             R3, [SP,#0x4C+var_3C]                                  ; +0xc0, 0x482ae8\nMOV             R0, R5                                                 ; +0xc2, 0x482aea\nLDR             R1, [SP,#0x4C+var_38]                                  ; +0xc4, 0x482aec\nMOV             R2, R4                                                 ; +0xc6, 0x482aee\nSTR             R3, [SP,#0x4C+var_4C]                                  ; +0xc8, 0x482af0\nMOV             R3, R8                                                 ; +0xca, 0x482af2\nBL              _ZN8EditorUI26convertKeyBasedOnNeighborsEiiN7cocos2d7CCPointEPNS0_7CCArrayE; EditorUI::convertKeyBasedOnNeighbors(int,int,cocos2d::CCPoint,cocos2d::CCArray *) ; +0xcc, 0x482af4\nSTR             R0, [SP,#0x4C+var_38]                                  ; +0xd0, 0x482af8\nLDR             R1, [SP,#0x4C+var_30]; cocos2d::CCPoint *              ; +0xd2, 0x482afa\nMOV             R0, R8; this                                           ; +0xd4, 0x482afc\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xd6, 0x482afe\nMOV             R2, R8                                                 ; +0xda, 0x482b02\nLDR             R1, [SP,#0x4C+var_38]                                  ; +0xdc, 0x482b04\nMOV             R0, R5                                                 ; +0xde, 0x482b06\nBL              _ZN8EditorUI12createObjectEiN7cocos2d7CCPointE; EditorUI::createObject(int,cocos2d::CCPoint) ; +0xe0, 0x482b08\nMOV             R1, R0; cocos2d::CCObject *                            ; +0xe4, 0x482b0c\nMOV             R0, R7; this                                           ; +0xe6, 0x482b0e\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xe8, 0x482b10\nMOV             R0, R6; this                                           ; +0xec, 0x482b14\nMOV             R1, R10; cocos2d::CCObject *                           ; +0xee, 0x482b16\nMOVS            R2, #1; bool                                           ; +0xf0, 0x482b18\nBL              _ZN7cocos2d7CCArray12removeObjectEPNS_8CCObjectEb; cocos2d::CCArray::removeObject(cocos2d::CCObject *,bool) ; +0xf2, 0x482b1a\nADD.W           R11, R11, #1                                           ; +0xf6, 0x482b1e\nCMP.W           R11, #9                                                ; +0xfa, 0x482b22\nBNE             loc_482A9E                                             ; +0xfe, 0x482b26\nLDR             R0, [SP,#0x4C+var_34]; this                            ; +0x100, 0x482b28\nMOV             R1, R9; cocos2d::CCObject *                            ; +0x102, 0x482b2a\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x104, 0x482b2c\nMOV             R0, R7; this                                           ; +0x108, 0x482b30\nMOV             R1, R9; cocos2d::CCObject *                            ; +0x10a, 0x482b32\nMOVS            R2, #1; bool                                           ; +0x10c, 0x482b34\nBL              _ZN7cocos2d7CCArray12removeObjectEPNS_8CCObjectEb; cocos2d::CCArray::removeObject(cocos2d::CCObject *,bool) ; +0x10e, 0x482b36\nB               loc_482BAE                                             ; +0x112, 0x482b3a\nMOV             R0, R6; this                                           ; +0x114, 0x482b3c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x116, 0x482b3e\nCMP             R0, #0                                                 ; +0x11a, 0x482b42\nBEQ             loc_482BC0                                             ; +0x11c, 0x482b44\nMOV             R1, R8; unsigned int                                   ; +0x11e, 0x482b46\nMOV             R0, R6; this                                           ; +0x120, 0x482b48\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x122, 0x482b4a\nADD.W           R9, SP, #0x4C+var_18                                   ; +0x126, 0x482b4e\nADD.W           R8, SP, #0x4C+var_10                                   ; +0x12a, 0x482b52\nLDR             R3, [R0]                                               ; +0x12e, 0x482b56\nLDR             R3, [R3,#0x60]                                         ; +0x130, 0x482b58\nBLX             R3                                                     ; +0x132, 0x482b5a\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x134, 0x482b5c\nMOV             R0, R9; this                                           ; +0x136, 0x482b5e\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x138, 0x482b60\nMOV             R0, R4; this                                           ; +0x13c, 0x482b64\nBL              _ZN8EditorUI17getRandomStartKeyEi; EditorUI::getRandomStartKey(int) ; +0x13e, 0x482b66\nLDR             R3, [SP,#0x4C+var_40]                                  ; +0x142, 0x482b6a\nMOV             R10, R0                                                ; +0x144, 0x482b6c\nCBZ             R3, loc_482B8A                                         ; +0x146, 0x482b6e\nMOV             R1, R9; cocos2d::CCPoint *                             ; +0x148, 0x482b70\nMOV             R0, R8; this                                           ; +0x14a, 0x482b72\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x14c, 0x482b74\nLDR             R3, [SP,#0x4C+var_3C]                                  ; +0x150, 0x482b78\nMOV             R1, R10                                                ; +0x152, 0x482b7a\nMOV             R0, R5                                                 ; +0x154, 0x482b7c\nMOV             R2, R4                                                 ; +0x156, 0x482b7e\nSTR             R3, [SP,#0x4C+var_4C]                                  ; +0x158, 0x482b80\nMOV             R3, R8                                                 ; +0x15a, 0x482b82\nBL              _ZN8EditorUI26convertKeyBasedOnNeighborsEiiN7cocos2d7CCPointEPNS0_7CCArrayE; EditorUI::convertKeyBasedOnNeighbors(int,int,cocos2d::CCPoint,cocos2d::CCArray *) ; +0x15c, 0x482b84\nMOV             R10, R0                                                ; +0x160, 0x482b88\nMOV             R1, R9; cocos2d::CCPoint *                             ; +0x162, 0x482b8a\nMOV             R0, R8; this                                           ; +0x164, 0x482b8c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x166, 0x482b8e\nMOV             R2, R8                                                 ; +0x16a, 0x482b92\nMOV             R1, R10                                                ; +0x16c, 0x482b94\nMOV             R0, R5                                                 ; +0x16e, 0x482b96\nBL              _ZN8EditorUI12createObjectEiN7cocos2d7CCPointE; EditorUI::createObject(int,cocos2d::CCPoint) ; +0x170, 0x482b98\nMOV             R1, R0; cocos2d::CCObject *                            ; +0x174, 0x482b9c\nMOV             R0, R7; this                                           ; +0x176, 0x482b9e\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x178, 0x482ba0\nMOV             R0, R6; this                                           ; +0x17c, 0x482ba4\nMOVS            R1, #0; unsigned int                                   ; +0x17e, 0x482ba6\nMOVS            R2, #1; bool                                           ; +0x180, 0x482ba8\nBL              _ZN7cocos2d7CCArray19removeObjectAtIndexEjb; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0x182, 0x482baa\nLDR             R3, [SP,#0x4C+var_34]                                  ; +0x186, 0x482bae\nMOV             R0, R5; this                                           ; +0x188, 0x482bb0\nSTR             R7, [SP,#0x4C+var_4C]; cocos2d::CCArray *              ; +0x18a, 0x482bb2\nMOV             R1, R4; int                                            ; +0x18c, 0x482bb4\nLDR             R2, [SP,#0x4C+var_3C]; cocos2d::CCArray *              ; +0x18e, 0x482bb6\nSTR             R3, [SP,#0x4C+var_48]; cocos2d::CCArray *              ; +0x190, 0x482bb8\nMOV             R3, R6; cocos2d::CCArray *                             ; +0x192, 0x482bba\nBL              _ZN8EditorUI27processSmartObjectsFromTypeEiPN7cocos2d7CCArrayES2_S2_S2_; EditorUI::processSmartObjectsFromType(int,cocos2d::CCArray *,cocos2d::CCArray *,cocos2d::CCArray *,cocos2d::CCArray *) ; +0x194, 0x482bbc\nLDR             R3, [SP,#0x4C+var_2C]                                  ; +0x198, 0x482bc0\nLDR             R2, [SP,#0x4C+var_8]                                   ; +0x19a, 0x482bc2\nLDR             R3, [R3]                                               ; +0x19c, 0x482bc4\nCMP             R2, R3                                                 ; +0x19e, 0x482bc6\nBEQ             loc_482BCE                                             ; +0x1a0, 0x482bc8\nBLX             __stack_chk_fail                                       ; +0x1a2, 0x482bca\nADD             SP, SP, #0x4C ; 'L'                                    ; +0x1a6, 0x482bce\nPOP.W           {R4-R11,PC}                                            ; +0x1a8, 0x482bd0", "xrefs": ["EditorUI::processSmartObjectsFromType @ 0x482bbc", "EditorUI::createSmartObjectsFromType @ 0x482d36"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}