{"type": "func", "start": 8803532, "end": 8803632, "name": "GJBaseGameLayer::performMathOperation", "pseudocode": "// \n// GJBaseGameLayer::performMathOperation from 0x8654cc to 0x865530 (100 bytes)\n// \n// 6 xrefs:\n// > GJBaseGameLayer::activateItemCompareTrigger @ 0x86567c\n// > GJBaseGameLayer::activateItemCompareTrigger @ 0x865774\n// > GJBaseGameLayer::activateItemEditTrigger @ 0x8911c4\n// > GJBaseGameLayer::activateItemEditTrigger @ 0x891248\n// > GJBaseGameLayer::activateItemEditTrigger @ 0x891308\n// > <???> @ 0x329a0\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\ndouble GJBaseGameLayer::performMathOperation(GJBaseGameLayer *a1, double a2, double a3, int a4)\n{\n  double v4; // d2\n  double result; // d0\n\n  v4 = 0.0;\n  switch ( a4 )\n  {\n    case 1:\n      return a2 + a3;\n    case 2:\n      v4 = a2 - a3;\n      goto LABEL_3;\n    case 3:\n      return a2 * a3;\n    case 4:\n      v4 = 0.0;\n      if ( a3 == 0.0 )\n        goto LABEL_3;\n      result = a2 / a3;\n      break;\n    default:\nLABEL_3:\n      result = v4;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::performMathOperation from 0x8654cc to 0x865530 (100 bytes)\n; \n; 6 xrefs:\n; > GJBaseGameLayer::activateItemCompareTrigger @ 0x86567c\n; > GJBaseGameLayer::activateItemCompareTrigger @ 0x865774\n; > GJBaseGameLayer::activateItemEditTrigger @ 0x8911c4\n; > GJBaseGameLayer::activateItemEditTrigger @ 0x891248\n; > GJBaseGameLayer::activateItemEditTrigger @ 0x891308\n; > <???> @ 0x329a0\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\nSUB             W1, W1, #1; switch 4 cases                             ; +0x0, 0x8654cc\nCMP             W1, #3                                                 ; +0x4, 0x8654d0\nFMOV            D2, XZR                                                ; +0x8, 0x8654d4\nB.HI            def_8654F0; jumptable 00000000008654F0 default case    ; +0xc, 0x8654d8\nADRL            X0, jpt_8654F0                                         ; +0x10, 0x8654dc\nLDRB            W0, [X0,W1,UXTW]                                       ; +0x18, 0x8654e4\nADR             X1, loc_8654F4; jumptable 00000000008654F0 case 2      ; +0x1c, 0x8654e8\nADD             X0, X1, W0,SXTB#2                                      ; +0x20, 0x8654ec\nBR              X0; switch jump                                        ; +0x24, 0x8654f0\nFSUB            D2, D0, D1; jumptable 00000000008654F0 case 2          ; +0x28, 0x8654f4\nFMOV            D0, D2; jumptable 00000000008654F0 default case        ; +0x2c, 0x8654f8\nRET                                                                    ; +0x30, 0x8654fc\nFMUL            D2, D0, D1; jumptable 00000000008654F0 case 3          ; +0x34, 0x865500\nFMOV            D0, D2                                                 ; +0x38, 0x865504\nRET                                                                    ; +0x3c, 0x865508\nFADD            D2, D0, D1; jumptable 00000000008654F0 case 1          ; +0x40, 0x86550c\nFMOV            D0, D2                                                 ; +0x44, 0x865510\nRET                                                                    ; +0x48, 0x865514\nFCMP            D1, #0.0; jumptable 00000000008654F0 case 4            ; +0x4c, 0x865518\nFMOV            D2, XZR                                                ; +0x50, 0x86551c\nB.EQ            def_8654F0; jumptable 00000000008654F0 default case    ; +0x54, 0x865520\nFDIV            D2, D0, D1                                             ; +0x58, 0x865524\nFMOV            D0, D2                                                 ; +0x5c, 0x865528\nRET                                                                    ; +0x60, 0x86552c", "xrefs": ["GJBaseGameLayer::activateItemCompareTrigger @ 0x86567c", "GJBaseGameLayer::activateItemCompareTrigger @ 0x865774", "GJBaseGameLayer::activateItemEditTrigger @ 0x8911c4", "GJBaseGameLayer::activateItemEditTrigger @ 0x891248", "GJBaseGameLayer::activateItemEditTrigger @ 0x891308", "<???> @ 0x329a0"], "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"}