{"type": "func", "start": 3693800, "end": 3694074, "name": "EditorUI::applySpecialOffset", "pseudocode": "// \n// EditorUI::applySpecialOffset from 0x385ce8 to 0x385dfa (274 bytes)\n// \n// 3 xrefs:\n// > EditorUI::findSnapObject @ 0x385eaa\n// > EditorUI::findSnapObject @ 0x385f84\n// > EditorUI::ccTouchEnded @ 0x3a55f4\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\ncocos2d::CCPoint *EditorUI::applySpecialOffset(\n        cocos2d::CCPoint *__return_ptr retstr,\n        EditorUI *a2,\n        cocos2d::CCPoint a3,\n        GameObject *a4,\n        cocos2d::CCPoint a5)\n{\n  float y; // r5\n  float x; // r4\n  const cocos2d::CCPoint *v9; // r0\n  cocos2d::CCPoint v10; // r2\n  int v11; // r2\n  bool v12; // r3\n  const cocos2d::CCPoint *v13; // r0\n  float v14; // s15\n  float v15; // s15\n  cocos2d::CCPoint v17; // [sp+4h] [bp-18h] BYREF\n  cocos2d::CCPoint v18; // [sp+Ch] [bp-10h] BYREF\n\n  y = a3.y;\n  x = a3.x;\n  if ( EditorUI::isSpecialSnapObject(a2, *(_DWORD *)(LODWORD(a3.y) + 884)) )\n  {\n    v9 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(float))(*(_DWORD *)LODWORD(y) + 96))(COERCE_FLOAT(LODWORD(y)));\n    cocos2d::CCPoint::CCPoint(&v18, v9);\n    LODWORD(v10.x) = &v18;\n    EditorUI::getGridSnappedPos(&v17, a2, v10);\n    if ( !cocos2d::CCPoint::equals((cocos2d::CCPoint *)a4, (const cocos2d::CCPoint *)&flt_AC5D38) )\n      cocos2d::CCPoint::operator=((PlayerObject *)&v17, *(float *)&a4, v11, v12);\n    v13 = (const cocos2d::CCPoint *)(*(int (__fastcall **)(float))(*(_DWORD *)LODWORD(y) + 96))(COERCE_FLOAT(LODWORD(y)));\n    cocos2d::CCPoint::CCPoint(&v18, v13);\n    v14 = fabsf(*(float *)LODWORD(x));\n    if ( v14 > 0.0 )\n    {\n      if ( fabsf((float)(v18.x + v14) - v17.x) < fabsf((float)(v18.x - v14) - v17.x) )\n        v14 = -v14;\n      *(float *)LODWORD(x) = v14;\n    }\n    v15 = fabsf(*(float *)(LODWORD(x) + 4));\n    if ( v15 > 0.0 )\n    {\n      if ( fabsf((float)(v18.y + v15) - v17.y) < fabsf((float)(v18.y - v15) - v17.y) )\n        v15 = -v15;\n      *(float *)(LODWORD(x) + 4) = v15;\n    }\n  }\n  cocos2d::CCPoint::CCPoint(retstr, (const cocos2d::CCPoint *)LODWORD(x));\n  return retstr;\n}", "assembly": "; \n; EditorUI::applySpecialOffset from 0x385ce8 to 0x385dfa (274 bytes)\n; \n; 3 xrefs:\n; > EditorUI::findSnapObject @ 0x385eaa\n; > EditorUI::findSnapObject @ 0x385f84\n; > EditorUI::ccTouchEnded @ 0x3a55f4\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x385ce8\nMOV             R5, R3                                                 ; +0x4, 0x385cec\nLDR             R6, =(__stack_chk_guard_ptr - 0x385CFA)                ; +0x6, 0x385cee\nSUB             SP, SP, #0x1C                                          ; +0x8, 0x385cf0\nMOV             R8, R0                                                 ; +0xa, 0x385cf2\nMOV             R10, R1                                                ; +0xc, 0x385cf4\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x385cf6\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x385cf8\nMOV             R0, R1; this                                           ; +0x12, 0x385cfa\nLDR.W           R1, [R5,#0x374]; int                                   ; +0x14, 0x385cfc\nMOV             R4, R2                                                 ; +0x18, 0x385d00\nLDR             R3, [R6]                                               ; +0x1a, 0x385d02\nLDR.W           R9, [SP,#0x1C+arg_0]                                   ; +0x1c, 0x385d04\nSTR             R3, [SP,#0x1C+var_8]                                   ; +0x20, 0x385d08\nBL              _ZN8EditorUI19isSpecialSnapObjectEi; EditorUI::isSpecialSnapObject(int) ; +0x22, 0x385d0a\nCMP             R0, #0                                                 ; +0x26, 0x385d0e\nBEQ             loc_385DDE                                             ; +0x28, 0x385d10\nLDR             R3, [R5]                                               ; +0x2a, 0x385d12\nMOV             R0, R5                                                 ; +0x2c, 0x385d14\nADD             R7, SP, #0x1C+var_10                                   ; +0x2e, 0x385d16\nADD.W           R11, SP, #0x1C+var_18                                  ; +0x30, 0x385d18\nLDR             R3, [R3,#0x60]                                         ; +0x34, 0x385d1c\nBLX             R3                                                     ; +0x36, 0x385d1e\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x38, 0x385d20\nMOV             R0, R7; this                                           ; +0x3a, 0x385d22\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x3c, 0x385d24\nMOV             R0, R11                                                ; +0x40, 0x385d28\nMOV             R1, R10                                                ; +0x42, 0x385d2a\nMOV             R2, R7                                                 ; +0x44, 0x385d2c\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0x46, 0x385d2e\nLDR             R1, =(flt_AC5D38 - 0x385D3A)                           ; +0x4a, 0x385d32\nMOV             R0, R9; this                                           ; +0x4c, 0x385d34\nADD             R1, PC; flt_AC5D38 ; cocos2d::CCPoint *                ; +0x4e, 0x385d36\nBL              _ZNK7cocos2d7CCPoint6equalsERKS0_; cocos2d::CCPoint::equals(cocos2d::CCPoint const&) ; +0x50, 0x385d38\nCBNZ            R0, loc_385D46                                         ; +0x54, 0x385d3c\nMOV             R0, R11                                                ; +0x56, 0x385d3e\nMOV             R1, R9                                                 ; +0x58, 0x385d40\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x5a, 0x385d42\nLDR             R3, [R5]                                               ; +0x5e, 0x385d46\nMOV             R0, R5                                                 ; +0x60, 0x385d48\nLDR             R3, [R3,#0x60]                                         ; +0x62, 0x385d4a\nBLX             R3                                                     ; +0x64, 0x385d4c\nMOV             R1, R0; cocos2d::CCPoint *                             ; +0x66, 0x385d4e\nMOV             R0, R7; this                                           ; +0x68, 0x385d50\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x6a, 0x385d52\nVLDR            S15, [R4]                                              ; +0x6e, 0x385d56\nVABS.F32        S15, S15                                               ; +0x72, 0x385d5a\nVCMPE.F32       S15, #0.0                                              ; +0x76, 0x385d5e\nVMRS            APSR_nzcv, FPSCR                                       ; +0x7a, 0x385d62\nBLE             loc_385D9A                                             ; +0x7e, 0x385d66\nVLDR            S14, [SP,#0x1C+var_10]                                 ; +0x80, 0x385d68\nVLDR            S12, [SP,#0x1C+var_18]                                 ; +0x84, 0x385d6c\nVADD.F32        S13, S14, S15                                          ; +0x88, 0x385d70\nVSUB.F32        S14, S14, S15                                          ; +0x8c, 0x385d74\nVSUB.F32        S13, S13, S12                                          ; +0x90, 0x385d78\nVSUB.F32        S14, S14, S12                                          ; +0x94, 0x385d7c\nVABS.F32        S13, S13                                               ; +0x98, 0x385d80\nVABS.F32        S14, S14                                               ; +0x9c, 0x385d84\nVCMPE.F32       S13, S14                                               ; +0xa0, 0x385d88\nVMRS            APSR_nzcv, FPSCR                                       ; +0xa4, 0x385d8c\nIT LT                                                                  ; +0xa8, 0x385d90\nVNEGLT.F32      S15, S15                                               ; +0xaa, 0x385d92\nVSTR            S15, [R4]                                              ; +0xae, 0x385d96\nVLDR            S15, [R4,#4]                                           ; +0xb2, 0x385d9a\nVABS.F32        S15, S15                                               ; +0xb6, 0x385d9e\nVCMPE.F32       S15, #0.0                                              ; +0xba, 0x385da2\nVMRS            APSR_nzcv, FPSCR                                       ; +0xbe, 0x385da6\nBLE             loc_385DDE                                             ; +0xc2, 0x385daa\nVLDR            S14, [SP,#0x1C+var_C]                                  ; +0xc4, 0x385dac\nVLDR            S12, [SP,#0x1C+var_14]                                 ; +0xc8, 0x385db0\nVADD.F32        S13, S14, S15                                          ; +0xcc, 0x385db4\nVSUB.F32        S14, S14, S15                                          ; +0xd0, 0x385db8\nVSUB.F32        S13, S13, S12                                          ; +0xd4, 0x385dbc\nVSUB.F32        S14, S14, S12                                          ; +0xd8, 0x385dc0\nVABS.F32        S13, S13                                               ; +0xdc, 0x385dc4\nVABS.F32        S14, S14                                               ; +0xe0, 0x385dc8\nVCMPE.F32       S13, S14                                               ; +0xe4, 0x385dcc\nVMRS            APSR_nzcv, FPSCR                                       ; +0xe8, 0x385dd0\nIT LT                                                                  ; +0xec, 0x385dd4\nVNEGLT.F32      S15, S15                                               ; +0xee, 0x385dd6\nVSTR            S15, [R4,#4]                                           ; +0xf2, 0x385dda\nMOV             R0, R8; this                                           ; +0xf6, 0x385dde\nMOV             R1, R4; cocos2d::CCPoint *                             ; +0xf8, 0x385de0\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xfa, 0x385de2\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0xfe, 0x385de6\nLDR             R3, [R6]                                               ; +0x100, 0x385de8\nMOV             R0, R8                                                 ; +0x102, 0x385dea\nCMP             R2, R3                                                 ; +0x104, 0x385dec\nBEQ             loc_385DF4                                             ; +0x106, 0x385dee\nBLX             __stack_chk_fail                                       ; +0x108, 0x385df0\nADD             SP, SP, #0x1C                                          ; +0x10c, 0x385df4\nPOP.W           {R4-R11,PC}                                            ; +0x10e, 0x385df6", "xrefs": ["EditorUI::findSnapObject @ 0x385eaa", "EditorUI::findSnapObject @ 0x385f84", "EditorUI::ccTouchEnded @ 0x3a55f4"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}