{"type": "func", "start": 667168, "end": 667324, "name": "sub_A2E20", "pseudocode": "// \n// sub_A2E20 from 0xa2e20 to 0xa2ebc (156 bytes)\n// \n// 4 xrefs:\n// > sub_A2CC8 @ 0xa2d5c\n// > sub_A2CC8 @ 0xa2da4\n// > sub_A2EBC @ 0xa2f80\n// > sub_A2EBC @ 0xa2fb4\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\n__int64 __fastcall sub_A2E20(int a1, int a2, int a3)\n{\n  int v3; // w8\n  int v4; // w8\n  unsigned int v5; // w9\n\n  v3 = a3 >> 3;\n  switch ( a1 )\n  {\n    case 1:\n      goto LABEL_8;\n    case 2:\n      goto LABEL_5;\n    case 3:\n      goto LABEL_7;\n    case 4:\n      v3 += a3;\n      break;\n    case 5:\n      v3 += a3;\n      goto LABEL_8;\n    case 6:\n      v3 += a3;\nLABEL_5:\n      v3 += a3 >> 1;\n      break;\n    case 7:\n      v3 += a3;\nLABEL_7:\n      v3 += a3 >> 1;\nLABEL_8:\n      v3 += a3 >> 2;\n      break;\n    case 8:\n      goto LABEL_16;\n    case 9:\n      goto LABEL_15;\n    case 10:\n      goto LABEL_12;\n    case 11:\n      goto LABEL_14;\n    case 12:\n      v3 += a3;\n      goto LABEL_16;\n    case 13:\n      v3 += a3;\n      goto LABEL_15;\n    case 14:\n      v3 += a3;\nLABEL_12:\n      v3 += a3 >> 1;\n      goto LABEL_16;\n    case 15:\n      v3 += a3;\nLABEL_14:\n      v3 += a3 >> 1;\nLABEL_15:\n      v3 += a3 >> 2;\nLABEL_16:\n      v3 = -v3;\n      break;\n    default:\n      break;\n  }\n  v4 = v3 + a2;\n  if ( v4 < -32768 )\n    v5 = -32768;\n  else\n    v5 = 0x7FFF;\n  if ( v4 == (__int16)v4 )\n    return (unsigned int)v4;\n  else\n    return v5;\n}", "assembly": "; \n; sub_A2E20 from 0xa2e20 to 0xa2ebc (156 bytes)\n; \n; 4 xrefs:\n; > sub_A2CC8 @ 0xa2d5c\n; > sub_A2CC8 @ 0xa2da4\n; > sub_A2EBC @ 0xa2f80\n; > sub_A2EBC @ 0xa2fb4\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             W9, W0, #1; switch 15 cases                            ; +0x0, 0xa2e20\nCMP             W9, #0xE                                               ; +0x4, 0xa2e24\nASR             W8, W2, #3                                             ; +0x8, 0xa2e28\nB.HI            def_A2E44; jumptable 00000000000A2E44 default case     ; +0xc, 0xa2e2c\nADRL            X10, jpt_A2E44                                         ; +0x10, 0xa2e30\nADR             X11, loc_A2E48; jumptable 00000000000A2E44 case 4      ; +0x18, 0xa2e38\nLDRB            W12, [X10,X9]                                          ; +0x1c, 0xa2e3c\nADD             X11, X11, X12,LSL#2                                    ; +0x20, 0xa2e40\nBR              X11; switch jump                                       ; +0x24, 0xa2e44\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 4          ; +0x28, 0xa2e48\nB               def_A2E44; jumptable 00000000000A2E44 default case     ; +0x2c, 0xa2e4c\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 5          ; +0x30, 0xa2e50\nB               loc_A2E6C; jumptable 00000000000A2E44 case 1           ; +0x34, 0xa2e54\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 6          ; +0x38, 0xa2e58\nADD             W8, W8, W2,ASR#1; jumptable 00000000000A2E44 case 2    ; +0x3c, 0xa2e5c\nB               def_A2E44; jumptable 00000000000A2E44 default case     ; +0x40, 0xa2e60\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 7          ; +0x44, 0xa2e64\nADD             W8, W8, W2,ASR#1; jumptable 00000000000A2E44 case 3    ; +0x48, 0xa2e68\nADD             W8, W8, W2,ASR#2; jumptable 00000000000A2E44 case 1    ; +0x4c, 0xa2e6c\nB               def_A2E44; jumptable 00000000000A2E44 default case     ; +0x50, 0xa2e70\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 12         ; +0x54, 0xa2e74\nB               loc_A2E9C; jumptable 00000000000A2E44 case 8           ; +0x58, 0xa2e78\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 13         ; +0x5c, 0xa2e7c\nB               loc_A2E98; jumptable 00000000000A2E44 case 9           ; +0x60, 0xa2e80\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 14         ; +0x64, 0xa2e84\nADD             W8, W8, W2,ASR#1; jumptable 00000000000A2E44 case 10   ; +0x68, 0xa2e88\nB               loc_A2E9C; jumptable 00000000000A2E44 case 8           ; +0x6c, 0xa2e8c\nADD             W8, W8, W2; jumptable 00000000000A2E44 case 15         ; +0x70, 0xa2e90\nADD             W8, W8, W2,ASR#1; jumptable 00000000000A2E44 case 11   ; +0x74, 0xa2e94\nADD             W8, W8, W2,ASR#2; jumptable 00000000000A2E44 case 9    ; +0x78, 0xa2e98\nNEG             W8, W8; jumptable 00000000000A2E44 case 8              ; +0x7c, 0xa2e9c\nADD             W8, W8, W1; jumptable 00000000000A2E44 default case    ; +0x80, 0xa2ea0\nMOV             W9, #0xFFFF8000                                        ; +0x84, 0xa2ea4\nCMN             W8, #8,LSL#12                                          ; +0x88, 0xa2ea8\nCINV            W9, W9, GE                                             ; +0x8c, 0xa2eac\nCMP             W8, W8,SXTH                                            ; +0x90, 0xa2eb0\nCSEL            W0, W9, W8, NE                                         ; +0x94, 0xa2eb4\nRET                                                                    ; +0x98, 0xa2eb8", "xrefs": ["sub_A2CC8 @ 0xa2d5c", "sub_A2CC8 @ 0xa2da4", "sub_A2EBC @ 0xa2f80", "sub_A2EBC @ 0xa2fb4"], "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"}