{"type": "func", "start": 7394664, "end": 7394936, "name": "EditorUI::applySpecialOffset", "pseudocode": "// \n// EditorUI::applySpecialOffset from 0x70d568 to 0x70d678 (272 bytes)\n// \n// 3 xrefs:\n// > EditorUI::findSnapObject @ 0x48509a\n// > EditorUI::findSnapObject @ 0x485174\n// > EditorUI::ccTouchEnded @ 0x6f0f34\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:57:42 +0000\n// \n\ncocos2d::CCPoint *__fastcall EditorUI::applySpecialOffset(\n        cocos2d::CCPoint *a1,\n        int a2,\n        float *a3,\n        char **a4,\n        cocos2d::CCPoint *a5)\n{\n  const cocos2d::CCPoint *v9; // r0\n  const cocos2d::CCPoint *v10; // r0\n  float v11; // s15\n  float v12; // s15\n  float v14; // [sp+4h] [bp-18h] BYREF\n  float v15; // [sp+8h] [bp-14h]\n  float v16; // [sp+Ch] [bp-10h] BYREF\n  float v17; // [sp+10h] [bp-Ch]\n\n  if ( isSpecialSnapObject(a4[223]) )\n  {\n    v9 = (const cocos2d::CCPoint *)(*((int (__fastcall **)(char **))*a4 + 24))(a4);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, v9);\n    EditorUI::getGridSnappedPos((int)&v14, a2, &v16);\n    if ( !cocos2d::CCPoint::equals(a5, (const cocos2d::CCPoint *)&unk_D2DBE0) )\n      cocos2d::CCPoint::operator=(&v14, a5);\n    v10 = (const cocos2d::CCPoint *)(*((int (__fastcall **)(char **))*a4 + 24))(a4);\n    cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, v10);\n    v11 = fabsf(*a3);\n    if ( v11 > 0.0 )\n    {\n      if ( fabsf((float)(v16 + v11) - v14) < fabsf((float)(v16 - v11) - v14) )\n        v11 = -v11;\n      *a3 = v11;\n    }\n    v12 = fabsf(a3[1]);\n    if ( v12 > 0.0 )\n    {\n      if ( fabsf((float)(v17 + v12) - v15) < fabsf((float)(v17 - v12) - v15) )\n        v12 = -v12;\n      a3[1] = v12;\n    }\n  }\n  cocos2d::CCPoint::CCPoint(a1, (const cocos2d::CCPoint *)a3);\n  return a1;\n}", "assembly": "; \n; EditorUI::applySpecialOffset from 0x70d568 to 0x70d678 (272 bytes)\n; \n; 3 xrefs:\n; > EditorUI::findSnapObject @ 0x48509a\n; > EditorUI::findSnapObject @ 0x485174\n; > EditorUI::ccTouchEnded @ 0x6f0f34\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:57:42 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x70d568\nMOV             R5, R3                                                 ; +0x4, 0x70d56c\nLDR             R6, =(__stack_chk_guard_ptr - 0x70D57C)                ; +0x6, 0x70d56e\nSUB             SP, SP, #0x1C                                          ; +0x8, 0x70d570\nMOV             R8, R0                                                 ; +0xa, 0x70d572\nLDR.W           R0, [R5,#0x37C]; int                                   ; +0xc, 0x70d574\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x10, 0x70d578\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x12, 0x70d57a\nMOV             R10, R1                                                ; +0x14, 0x70d57c\nMOV             R4, R2                                                 ; +0x16, 0x70d57e\nLDR.W           R9, [SP,#0x1C+arg_0]                                   ; +0x18, 0x70d580\nLDR             R3, [R6]                                               ; +0x1c, 0x70d584\nSTR             R3, [SP,#0x1C+var_8]                                   ; +0x1e, 0x70d586\nBL              _Z19isSpecialSnapObjecti; isSpecialSnapObject(int)     ; +0x20, 0x70d588\nCMP             R0, #0                                                 ; +0x24, 0x70d58c\nBEQ             loc_70D65C                                             ; +0x26, 0x70d58e\nLDR             R3, [R5]                                               ; +0x28, 0x70d590\nMOV             R0, R5                                                 ; +0x2a, 0x70d592\nADD             R7, SP, #0x1C+var_10                                   ; +0x2c, 0x70d594\nADD.W           R11, SP, #0x1C+var_18                                  ; +0x2e, 0x70d596\nLDR             R3, [R3,#0x60]                                         ; +0x32, 0x70d59a\nBLX             R3                                                     ; +0x34, 0x70d59c\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x36, 0x70d59e\nMOV             R0, R7; this                                           ; +0x38, 0x70d5a0\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x3a, 0x70d5a2\nMOV             R0, R11                                                ; +0x3e, 0x70d5a6\nMOV             R1, R10                                                ; +0x40, 0x70d5a8\nMOV             R2, R7                                                 ; +0x42, 0x70d5aa\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0x44, 0x70d5ac\nLDR             R1, =(unk_D2DBE0 - 0x70D5B8)                           ; +0x48, 0x70d5b0\nMOV             R0, R9; this                                           ; +0x4a, 0x70d5b2\nADD             R1, PC; unk_D2DBE0 ; cocos2d::CCPoint *                ; +0x4c, 0x70d5b4\nBL              _ZNK7cocos2d7CCPoint6equalsERKS0_; cocos2d::CCPoint::equals(cocos2d::CCPoint const&) ; +0x4e, 0x70d5b6\nCBNZ            R0, loc_70D5C4                                         ; +0x52, 0x70d5ba\nMOV             R0, R11                                                ; +0x54, 0x70d5bc\nMOV             R1, R9                                                 ; +0x56, 0x70d5be\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x58, 0x70d5c0\nLDR             R3, [R5]                                               ; +0x5c, 0x70d5c4\nMOV             R0, R5                                                 ; +0x5e, 0x70d5c6\nLDR             R3, [R3,#0x60]                                         ; +0x60, 0x70d5c8\nBLX             R3                                                     ; +0x62, 0x70d5ca\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x64, 0x70d5cc\nMOV             R0, R7; this                                           ; +0x66, 0x70d5ce\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x68, 0x70d5d0\nVLDR            S15, [R4]                                              ; +0x6c, 0x70d5d4\nVABS.F32        S15, S15                                               ; +0x70, 0x70d5d8\nVCMPE.F32       S15, #0.0                                              ; +0x74, 0x70d5dc\nVMRS            APSR_nzcv, FPSCR                                       ; +0x78, 0x70d5e0\nBLE             loc_70D618                                             ; +0x7c, 0x70d5e4\nVLDR            S14, [SP,#0x1C+var_10]                                 ; +0x7e, 0x70d5e6\nVLDR            S12, [SP,#0x1C+var_18]                                 ; +0x82, 0x70d5ea\nVADD.F32        S13, S14, S15                                          ; +0x86, 0x70d5ee\nVSUB.F32        S14, S14, S15                                          ; +0x8a, 0x70d5f2\nVSUB.F32        S13, S13, S12                                          ; +0x8e, 0x70d5f6\nVSUB.F32        S14, S14, S12                                          ; +0x92, 0x70d5fa\nVABS.F32        S13, S13                                               ; +0x96, 0x70d5fe\nVABS.F32        S14, S14                                               ; +0x9a, 0x70d602\nVCMPE.F32       S13, S14                                               ; +0x9e, 0x70d606\nVMRS            APSR_nzcv, FPSCR                                       ; +0xa2, 0x70d60a\nIT LT                                                                  ; +0xa6, 0x70d60e\nVNEGLT.F32      S15, S15                                               ; +0xa8, 0x70d610\nVSTR            S15, [R4]                                              ; +0xac, 0x70d614\nVLDR            S15, [R4,#4]                                           ; +0xb0, 0x70d618\nVABS.F32        S15, S15                                               ; +0xb4, 0x70d61c\nVCMPE.F32       S15, #0.0                                              ; +0xb8, 0x70d620\nVMRS            APSR_nzcv, FPSCR                                       ; +0xbc, 0x70d624\nBLE             loc_70D65C                                             ; +0xc0, 0x70d628\nVLDR            S14, [SP,#0x1C+var_C]                                  ; +0xc2, 0x70d62a\nVLDR            S12, [SP,#0x1C+var_14]                                 ; +0xc6, 0x70d62e\nVADD.F32        S13, S14, S15                                          ; +0xca, 0x70d632\nVSUB.F32        S14, S14, S15                                          ; +0xce, 0x70d636\nVSUB.F32        S13, S13, S12                                          ; +0xd2, 0x70d63a\nVSUB.F32        S14, S14, S12                                          ; +0xd6, 0x70d63e\nVABS.F32        S13, S13                                               ; +0xda, 0x70d642\nVABS.F32        S14, S14                                               ; +0xde, 0x70d646\nVCMPE.F32       S13, S14                                               ; +0xe2, 0x70d64a\nVMRS            APSR_nzcv, FPSCR                                       ; +0xe6, 0x70d64e\nIT LT                                                                  ; +0xea, 0x70d652\nVNEGLT.F32      S15, S15                                               ; +0xec, 0x70d654\nVSTR            S15, [R4,#4]                                           ; +0xf0, 0x70d658\nMOV             R0, R8; this                                           ; +0xf4, 0x70d65c\nMOV             R1, R4; cocos2d::CCPoint *                             ; +0xf6, 0x70d65e\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xf8, 0x70d660\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0xfc, 0x70d664\nLDR             R3, [R6]                                               ; +0xfe, 0x70d666\nMOV             R0, R8                                                 ; +0x100, 0x70d668\nCMP             R2, R3                                                 ; +0x102, 0x70d66a\nBEQ             loc_70D672                                             ; +0x104, 0x70d66c\nBLX             __stack_chk_fail                                       ; +0x106, 0x70d66e\nADD             SP, SP, #0x1C                                          ; +0x10a, 0x70d672\nPOP.W           {R4-R11,PC}                                            ; +0x10c, 0x70d674", "xrefs": ["EditorUI::findSnapObject @ 0x48509a", "EditorUI::findSnapObject @ 0x485174", "EditorUI::ccTouchEnded @ 0x6f0f34"], "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"}