{"type": "func", "start": 8156648, "end": 8157272, "name": "EditorUI::findSnapObject", "pseudocode": "// \n// EditorUI::findSnapObject from 0x7c75e8 to 0x7c7858 (624 bytes)\n// \n// 3 xrefs:\n// > EditorUI::findSnapObject @ 0x7c7938\n// > EditorUI::findSnapObject @ 0x7c798c\n// > <???> @ 0x5be88\n// \n// This function is hookable on this platform (idp: arm, 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 12:54:09 +0000\n// \n\n__int64 __fastcall EditorUI::findSnapObject(GameObject **this, cocos2d::CCArray *a2, float a3)\n{\n  unsigned int v6; // w22\n  float v7; // s10\n  GameObject *v8; // x24\n  float v9; // s0\n  float v10; // s1\n  float v11; // s8\n  __int64 v13; // x0\n  __int64 v14; // [xsp+78h] [xbp+78h]\n  __int64 v15; // [xsp+80h] [xbp+80h] BYREF\n  __int64 v16; // [xsp+88h] [xbp+88h] BYREF\n  float v17; // [xsp+90h] [xbp+90h] BYREF\n\n  if ( a2 && (unsigned int)cocos2d::CCArray::count(a2) )\n  {\n    v6 = 0;\n    v7 = 999.0;\n    while ( v6 < (unsigned int)cocos2d::CCArray::count(a2) )\n    {\n      v8 = (GameObject *)cocos2d::CCArray::objectAtIndex(a2, v6);\n      GameObject::updateStartPos(v8);\n      ((void (__fastcall *)(EditorUI *__hidden, GameObject *))EditorUI::positionWithoutOffset)((EditorUI *)this, v8);\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, (const cocos2d::CCPoint *)&dword_155C778);\n      EditorUI::applySpecialOffset(&v15, this, &v16, v8, &v17);\n      cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, (const cocos2d::CCPoint *)&v15);\n      EditorUI::getGridSnappedPos((__int64)this, &v17, (__int64)&v16);\n      v9 = vabds_f32(*(float *)&v16, *(float *)&v15);\n      v10 = vabds_f32(*((float *)&v16 + 1), *((float *)&v15 + 1));\n      if ( (a3 <= 0.0 || a3 >= v9 && a3 >= v10)\n        && (v11 = v9 + v10, v7 > (float)(v9 + v10))\n        && (*(this + 188) = v8, EditorUI::shouldSnap((EditorUI *)this, v8)) )\n      {\n        v7 = v11;\n        if ( v11 == 0.0 )\n          return _stack_chk_guard;\n      }\n      else if ( v7 == 0.0 )\n      {\n        return _stack_chk_guard;\n      }\n      ++v6;\n    }\n  }\n  else\n  {\n    v13 = (__int64)*(this + 187);\n    if ( v13 )\n    {\n      if ( !((int)(*(float (__fastcall **)(__int64))(*(_QWORD *)v13 + 368LL))(v13) % 90) )\n      {\n        EditorUI::positionWithoutOffset(&v16, (EditorUI *)this, *(this + 187));\n        v14 = (__int64)*(this + 187);\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, (const cocos2d::CCPoint *)&dword_155C778);\n        EditorUI::applySpecialOffset(&v15, this, &v16, v14, &v17);\n        cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, (const cocos2d::CCPoint *)&v15);\n        EditorUI::getGridSnappedPos((__int64)this, &v17, (__int64)&v16);\n        if ( a3 <= 0.0\n          || a3 >= vabds_f32(*(float *)&v16, *(float *)&v15)\n          && a3 >= vabds_f32(*((float *)&v16 + 1), *((float *)&v15 + 1)) )\n        {\n          *(this + 188) = *(this + 187);\n        }\n      }\n    }\n  }\n  return _stack_chk_guard;\n}", "assembly": "; \n; EditorUI::findSnapObject from 0x7c75e8 to 0x7c7858 (624 bytes)\n; \n; 3 xrefs:\n; > EditorUI::findSnapObject @ 0x7c7938\n; > EditorUI::findSnapObject @ 0x7c798c\n; > <???> @ 0x5be88\n; \n; This function is hookable on this platform (idp: arm, 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 12:54:09 +0000\n; \nSTP             X29, X30, [SP,#var_A0]!                                ; +0x0, 0x7c75e8\nMOV             X29, SP                                                ; +0x4, 0x7c75ec\nSTR             X27, [SP,#0xA0+var_50]                                 ; +0x8, 0x7c75f0\nADRP            X27, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x7c75f4\nSTP             D8, D9, [SP,#0xA0+var_48]                              ; +0x10, 0x7c75f8\nSTP             X23, X24, [SP,#0xA0+var_70]                            ; +0x14, 0x7c75fc\nMOV             X23, X0                                                ; +0x18, 0x7c7600\nLDR             X0, [X27,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x7c7604\nSTP             X25, X26, [SP,#0xA0+var_60]                            ; +0x20, 0x7c7608\nSTP             X19, X20, [SP,#0xA0+var_90]                            ; +0x24, 0x7c760c\nSTP             X21, X22, [SP,#0xA0+var_80]                            ; +0x28, 0x7c7610\nSTR             D10, [SP,#0xA0+var_38]                                 ; +0x2c, 0x7c7614\nMOV             X25, X1                                                ; +0x30, 0x7c7618\nLDR             X0, [X0]                                               ; +0x34, 0x7c761c\nSTR             X0, [X29,#0xA0+var_8]                                  ; +0x38, 0x7c7620\nFMOV            S9, S0                                                 ; +0x3c, 0x7c7624\nCBZ             X1, loc_7C7770                                         ; +0x40, 0x7c7628\nMOV             X0, X1; this                                           ; +0x44, 0x7c762c\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x48, 0x7c7630\nCBZ             W0, loc_7C7770                                         ; +0x4c, 0x7c7634\nADRP            X26, #dword_155C778@PAGE                               ; +0x50, 0x7c7638\nMOV             W22, #0                                                ; +0x54, 0x7c763c\nLDR             S10, =0x4479C000                                       ; +0x58, 0x7c7640\nADD             X19, X29, #0xA0+var_18                                 ; +0x5c, 0x7c7644\nADD             X21, X29, #0xA0+var_10                                 ; +0x60, 0x7c7648\nADD             X26, X26, #dword_155C778@PAGEOFF                       ; +0x64, 0x7c764c\nADD             X20, X29, #0xA0+var_20                                 ; +0x68, 0x7c7650\nB               loc_7C7664                                             ; +0x6c, 0x7c7654\nFCMP            S10, #0.0                                              ; +0x70, 0x7c7658\nB.EQ            loc_7C7738                                             ; +0x74, 0x7c765c\nADD             W22, W22, #1                                           ; +0x78, 0x7c7660\nMOV             X0, X25; this                                          ; +0x7c, 0x7c7664\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x80, 0x7c7668\nCMP             W22, W0                                                ; +0x84, 0x7c766c\nB.CS            loc_7C7738                                             ; +0x88, 0x7c7670\nMOV             W1, W22; unsigned int                                  ; +0x8c, 0x7c7674\nMOV             X0, X25; this                                          ; +0x90, 0x7c7678\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x94, 0x7c767c\nMOV             X24, X0                                                ; +0x98, 0x7c7680\nBL              _ZN10GameObject14updateStartPosEv; GameObject::updateStartPos(void) ; +0x9c, 0x7c7684\nMOV             X8, X19                                                ; +0xa0, 0x7c7688\nMOV             X0, X23; this                                          ; +0xa4, 0x7c768c\nMOV             X1, X24; GameObject *                                  ; +0xa8, 0x7c7690\nBL              _ZN8EditorUI21positionWithoutOffsetEP10GameObject; EditorUI::positionWithoutOffset(GameObject *) ; +0xac, 0x7c7694\nMOV             X0, X21; this                                          ; +0xb0, 0x7c7698\nMOV             X1, X26; cocos2d::CCPoint *                            ; +0xb4, 0x7c769c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xb8, 0x7c76a0\nMOV             X8, X20                                                ; +0xbc, 0x7c76a4\nMOV             X2, X24                                                ; +0xc0, 0x7c76a8\nMOV             X3, X21                                                ; +0xc4, 0x7c76ac\nMOV             X0, X23                                                ; +0xc8, 0x7c76b0\nMOV             X1, X19                                                ; +0xcc, 0x7c76b4\nBL              _ZN8EditorUI18applySpecialOffsetEN7cocos2d7CCPointEP10GameObjectS1_; EditorUI::applySpecialOffset(cocos2d::CCPoint,GameObject *,cocos2d::CCPoint) ; +0xd0, 0x7c76b8\nMOV             X0, X21; this                                          ; +0xd4, 0x7c76bc\nMOV             X1, X20; cocos2d::CCPoint *                            ; +0xd8, 0x7c76c0\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xdc, 0x7c76c4\nMOV             X8, X19                                                ; +0xe0, 0x7c76c8\nMOV             X0, X23                                                ; +0xe4, 0x7c76cc\nMOV             X1, X21                                                ; +0xe8, 0x7c76d0\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0xec, 0x7c76d4\nLDR             S0, [X19]                                              ; +0xf0, 0x7c76d8\nLDR             S3, [X20]                                              ; +0xf4, 0x7c76dc\nLDR             S1, [X19,#4]                                           ; +0xf8, 0x7c76e0\nLDR             S2, [X20,#4]                                           ; +0xfc, 0x7c76e4\nFCMPE           S9, #0.0                                               ; +0x100, 0x7c76e8\nFABD            S0, S0, S3                                             ; +0x104, 0x7c76ec\nFABD            S1, S1, S2                                             ; +0x108, 0x7c76f0\nB.LS            loc_7C7708                                             ; +0x10c, 0x7c76f4\nFCMPE           S9, S0                                                 ; +0x110, 0x7c76f8\nB.LT            loc_7C7658                                             ; +0x114, 0x7c76fc\nFCMPE           S9, S1                                                 ; +0x118, 0x7c7700\nB.LT            loc_7C7658                                             ; +0x11c, 0x7c7704\nFADD            S8, S0, S1                                             ; +0x120, 0x7c7708\nFCMPE           S10, S8                                                ; +0x124, 0x7c770c\nB.LE            loc_7C7658                                             ; +0x128, 0x7c7710\nSTR             X24, [X23,#0x5E0]                                      ; +0x12c, 0x7c7714\nMOV             X0, X23; this                                          ; +0x130, 0x7c7718\nMOV             X1, X24; GameObject *                                  ; +0x134, 0x7c771c\nBL              _ZN8EditorUI10shouldSnapEP10GameObject; EditorUI::shouldSnap(GameObject *) ; +0x138, 0x7c7720\nUXTB            W0, W0                                                 ; +0x13c, 0x7c7724\nCBZ             W0, loc_7C7658                                         ; +0x140, 0x7c7728\nFMOV            S10, S8                                                ; +0x144, 0x7c772c\nFCMP            S10, #0.0                                              ; +0x148, 0x7c7730\nB.NE            loc_7C7660                                             ; +0x14c, 0x7c7734\nLDR             X27, [X27,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x150, 0x7c7738\nLDR             X1, [X29,#0xA0+var_8]                                  ; +0x154, 0x7c773c\nLDR             X0, [X27]                                              ; +0x158, 0x7c7740\nCMP             X1, X0                                                 ; +0x15c, 0x7c7744\nB.NE            loc_7C7854                                             ; +0x160, 0x7c7748\nLDP             X19, X20, [SP,#0xA0+var_90]                            ; +0x164, 0x7c774c\nLDP             D8, D9, [SP,#0xA0+var_48]                              ; +0x168, 0x7c7750\nLDP             X21, X22, [SP,#0xA0+var_80]                            ; +0x16c, 0x7c7754\nLDP             X23, X24, [SP,#0xA0+var_70]                            ; +0x170, 0x7c7758\nLDP             X25, X26, [SP,#0xA0+var_60]                            ; +0x174, 0x7c775c\nLDR             X27, [SP,#0xA0+var_50]                                 ; +0x178, 0x7c7760\nLDR             D10, [SP,#0xA0+var_38]                                 ; +0x17c, 0x7c7764\nLDP             X29, X30, [SP+0xA0+var_A0],#0xA0                       ; +0x180, 0x7c7768\nRET                                                                    ; +0x184, 0x7c776c\nLDR             X0, [X23,#0x5D8]                                       ; +0x188, 0x7c7770\nCBZ             X0, loc_7C7738                                         ; +0x18c, 0x7c7774\nLDR             X1, [X0]                                               ; +0x190, 0x7c7778\nLDR             X1, [X1,#0x170]                                        ; +0x194, 0x7c777c\nBLR             X1                                                     ; +0x198, 0x7c7780\nFCVTZS          W1, S0                                                 ; +0x19c, 0x7c7784\nMOV             W0, #0xB60B60B7                                        ; +0x1a0, 0x7c7788\nMOV             W2, #0x5A ; 'Z'                                        ; +0x1a8, 0x7c7790\nSMULL           X0, W1, W0                                             ; +0x1ac, 0x7c7794\nLSR             X0, X0, #0x20 ; ' '                                    ; +0x1b0, 0x7c7798\nADD             W0, W1, W0                                             ; +0x1b4, 0x7c779c\nASR             W0, W0, #6                                             ; +0x1b8, 0x7c77a0\nSUB             W0, W0, W1,ASR#31                                      ; +0x1bc, 0x7c77a4\nMSUB            W0, W0, W2, W1                                         ; +0x1c0, 0x7c77a8\nCBNZ            W0, loc_7C7738                                         ; +0x1c4, 0x7c77ac\nADD             X20, X29, #0xA0+var_18                                 ; +0x1c8, 0x7c77b0\nLDR             X1, [X23,#0x5D8]; GameObject *                         ; +0x1cc, 0x7c77b4\nMOV             X8, X20                                                ; +0x1d0, 0x7c77b8\nMOV             X0, X23; this                                          ; +0x1d4, 0x7c77bc\nADD             X19, X29, #0xA0+var_10                                 ; +0x1d8, 0x7c77c0\nADD             X21, X29, #0xA0+var_20                                 ; +0x1dc, 0x7c77c4\nBL              _ZN8EditorUI21positionWithoutOffsetEP10GameObject; EditorUI::positionWithoutOffset(GameObject *) ; +0x1e0, 0x7c77c8\nLDR             X2, [X23,#0x5D8]                                       ; +0x1e4, 0x7c77cc\nADRP            X1, #dword_155C778@PAGE                                ; +0x1e8, 0x7c77d0\nMOV             X0, X19; this                                          ; +0x1ec, 0x7c77d4\nADD             X1, X1, #dword_155C778@PAGEOFF; cocos2d::CCPoint *     ; +0x1f0, 0x7c77d8\nSTR             X2, [X29,#0xA0+var_28]                                 ; +0x1f4, 0x7c77dc\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x1f8, 0x7c77e0\nLDR             X2, [X29,#0xA0+var_28]                                 ; +0x1fc, 0x7c77e4\nMOV             X3, X19                                                ; +0x200, 0x7c77e8\nMOV             X8, X21                                                ; +0x204, 0x7c77ec\nMOV             X0, X23                                                ; +0x208, 0x7c77f0\nMOV             X1, X20                                                ; +0x20c, 0x7c77f4\nBL              _ZN8EditorUI18applySpecialOffsetEN7cocos2d7CCPointEP10GameObjectS1_; EditorUI::applySpecialOffset(cocos2d::CCPoint,GameObject *,cocos2d::CCPoint) ; +0x210, 0x7c77f8\nMOV             X0, X19; this                                          ; +0x214, 0x7c77fc\nMOV             X1, X21; cocos2d::CCPoint *                            ; +0x218, 0x7c7800\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x21c, 0x7c7804\nMOV             X8, X20                                                ; +0x220, 0x7c7808\nMOV             X0, X23                                                ; +0x224, 0x7c780c\nMOV             X1, X19                                                ; +0x228, 0x7c7810\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0x22c, 0x7c7814\nFCMPE           S9, #0.0                                               ; +0x230, 0x7c7818\nB.LS            loc_7C7848                                             ; +0x234, 0x7c781c\nLDR             S1, [X29,#0xA0+var_20]                                 ; +0x238, 0x7c7820\nLDR             S0, [X29,#0xA0+var_18]                                 ; +0x23c, 0x7c7824\nFABD            S0, S0, S1                                             ; +0x240, 0x7c7828\nFCMPE           S9, S0                                                 ; +0x244, 0x7c782c\nB.LT            loc_7C7738                                             ; +0x248, 0x7c7830\nLDR             S0, [X20,#4]                                           ; +0x24c, 0x7c7834\nLDR             S1, [X21,#4]                                           ; +0x250, 0x7c7838\nFABD            S0, S0, S1                                             ; +0x254, 0x7c783c\nFCMPE           S9, S0                                                 ; +0x258, 0x7c7840\nB.LT            loc_7C7738                                             ; +0x25c, 0x7c7844\nLDR             X0, [X23,#0x5D8]                                       ; +0x260, 0x7c7848\nSTR             X0, [X23,#0x5E0]                                       ; +0x264, 0x7c784c\nB               loc_7C7738                                             ; +0x268, 0x7c7850\nBL              .__stack_chk_fail                                      ; +0x26c, 0x7c7854", "xrefs": ["EditorUI::findSnapObject @ 0x7c7938", "EditorUI::findSnapObject @ 0x7c798c", "<???> @ 0x5be88"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}