{"type": "func", "start": 670960, "end": 671196, "name": "sub_A3CF0", "pseudocode": "// \n// sub_A3CF0 from 0xa3cf0 to 0xa3ddc (236 bytes)\n// \n// 2 xrefs:\n// > sub_A40E0 @ 0xa4734\n// > sub_A495C @ 0xa4e2c\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_A3CF0(__int64 a1, _BYTE *a2)\n{\n  __int64 v2; // x8\n  int v3; // w9\n  int v4; // w9\n  int v5; // w11\n  int v6; // w10\n  int v7; // w9\n  int v8; // w12\n  int v9; // w10\n  __int64 result; // x0\n  int v11; // w9\n  char v12; // w10\n\n  v2 = *(_QWORD *)(a1 + 8);\n  switch ( a2[1287] )\n  {\n    case 0:\n      v3 = byte_114028[*(int *)(v2 + 180)];\n      break;\n    case 1:\n      if ( *(int *)(v2 + 180) < 128 )\n        v3 = 64;\n      else\n        v3 = -64;\n      break;\n    case 2:\n      v4 = *(_DWORD *)(v2 + 180) + 128;\n      goto LABEL_9;\n    case 3:\n      v4 = 384 - *(_DWORD *)(v2 + 180);\nLABEL_9:\n      v3 = (((v4 / 256) << 8) - v4 + 128) >> 1;\n      break;\n    default:\n      v3 = 0;\n      break;\n  }\n  v5 = (unsigned __int8)a2[1288];\n  v6 = *(_DWORD *)(v2 + 184);\n  v7 = v3 * (unsigned __int8)a2[1289];\n  if ( a2[1288] )\n    v7 = v6 * v7 / v5;\n  v8 = *(_DWORD *)(v2 + 80);\n  if ( v6 < v5 )\n    v9 = v6 + 1;\n  else\n    v9 = (unsigned __int8)a2[1288];\n  *(_DWORD *)(v2 + 184) = v9;\n  *(_DWORD *)(v2 + 80) = v8 + (v7 >> 6);\n  result = 0;\n  v11 = *(_DWORD *)(v2 + 180) + (unsigned __int8)a2[1290];\n  v12 = *(_BYTE *)(v2 + 60) | 1;\n  if ( v11 > 255 )\n    v11 -= 256;\n  *(_DWORD *)(v2 + 180) = v11;\n  *(_BYTE *)(v2 + 60) = v12;\n  return result;\n}", "assembly": "; \n; sub_A3CF0 from 0xa3cf0 to 0xa3ddc (236 bytes)\n; \n; 2 xrefs:\n; > sub_A40E0 @ 0xa4734\n; > sub_A495C @ 0xa4e2c\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\nLDRB            W9, [X1,#0x507]                                        ; +0x0, 0xa3cf0\nLDR             X8, [X0,#8]                                            ; +0x4, 0xa3cf4\nCMP             W9, #3; switch 4 cases                                 ; +0x8, 0xa3cf8\nB.HI            def_A3D14; jumptable 00000000000A3D14 default case     ; +0xc, 0xa3cfc\nADRL            X10, jpt_A3D14                                         ; +0x10, 0xa3d00\nADR             X11, loc_A3D18; jumptable 00000000000A3D14 case 0      ; +0x18, 0xa3d08\nLDRB            W12, [X10,X9]                                          ; +0x1c, 0xa3d0c\nADD             X11, X11, X12,LSL#2                                    ; +0x20, 0xa3d10\nBR              X11; switch jump                                       ; +0x24, 0xa3d14\nADRP            X10, #off_10F940@PAGE; jumptable 00000000000A3D14 case 0 ; +0x28, 0xa3d18\nLDRSW           X9, [X8,#0xB4]                                         ; +0x2c, 0xa3d1c\nLDR             X10, [X10,#off_10F940@PAGEOFF]; byte_114028            ; +0x30, 0xa3d20\nLDRSB           W9, [X10,X9]                                           ; +0x34, 0xa3d24\nB               loc_A3D78                                              ; +0x38, 0xa3d28\nMOV             W9, WZR; jumptable 00000000000A3D14 default case       ; +0x3c, 0xa3d2c\nB               loc_A3D78                                              ; +0x40, 0xa3d30\nLDR             W9, [X8,#0xB4]; jumptable 00000000000A3D14 case 1      ; +0x44, 0xa3d34\nCMP             W9, #0x80                                              ; +0x48, 0xa3d38\nMOV             W9, #0x40 ; '@'                                        ; +0x4c, 0xa3d3c\nCNEG            W9, W9, GE                                             ; +0x50, 0xa3d40\nB               loc_A3D78                                              ; +0x54, 0xa3d44\nLDR             W9, [X8,#0xB4]; jumptable 00000000000A3D14 case 2      ; +0x58, 0xa3d48\nADD             W9, W9, #0x80                                          ; +0x5c, 0xa3d4c\nB               loc_A3D60                                              ; +0x60, 0xa3d50\nLDR             W9, [X8,#0xB4]; jumptable 00000000000A3D14 case 3      ; +0x64, 0xa3d54\nMOV             W10, #0x180                                            ; +0x68, 0xa3d58\nSUB             W9, W10, W9                                            ; +0x6c, 0xa3d5c\nMOV             W10, #0x100                                            ; +0x70, 0xa3d60\nSDIV            W10, W9, W10                                           ; +0x74, 0xa3d64\nLSL             W10, W10, #8                                           ; +0x78, 0xa3d68\nSUB             W9, W10, W9                                            ; +0x7c, 0xa3d6c\nADD             W9, W9, #0x80                                          ; +0x80, 0xa3d70\nASR             W9, W9, #1                                             ; +0x84, 0xa3d74\nLDRB            W12, [X1,#0x509]                                       ; +0x88, 0xa3d78\nLDRB            W11, [X1,#0x508]                                       ; +0x8c, 0xa3d7c\nLDR             W10, [X8,#0xB8]                                        ; +0x90, 0xa3d80\nMUL             W9, W9, W12                                            ; +0x94, 0xa3d84\nCBZ             W11, loc_A3D94                                         ; +0x98, 0xa3d88\nMUL             W9, W10, W9                                            ; +0x9c, 0xa3d8c\nSDIV            W9, W9, W11                                            ; +0xa0, 0xa3d90\nLDR             W12, [X8,#0x50]                                        ; +0xa4, 0xa3d94\nCMP             W10, W11                                               ; +0xa8, 0xa3d98\nCSINC           W10, W11, W10, GE                                      ; +0xac, 0xa3d9c\nSTR             W10, [X8,#0xB8]                                        ; +0xb0, 0xa3da0\nADD             W9, W12, W9,ASR#6                                      ; +0xb4, 0xa3da4\nSTR             W9, [X8,#0x50]                                         ; +0xb8, 0xa3da8\nLDR             W11, [X8,#0xB4]                                        ; +0xbc, 0xa3dac\nLDRB            W9, [X1,#0x50A]                                        ; +0xc0, 0xa3db0\nLDRB            W10, [X8,#0x3C]                                        ; +0xc4, 0xa3db4\nMOV             W0, WZR                                                ; +0xc8, 0xa3db8\nADD             W9, W11, W9                                            ; +0xcc, 0xa3dbc\nSUB             W11, W9, #0x100                                        ; +0xd0, 0xa3dc0\nCMP             W9, #0xFF                                              ; +0xd4, 0xa3dc4\nORR             W10, W10, #1                                           ; +0xd8, 0xa3dc8\nCSEL            W9, W11, W9, GT                                        ; +0xdc, 0xa3dcc\nSTR             W9, [X8,#0xB4]                                         ; +0xe0, 0xa3dd0\nSTRB            W10, [X8,#0x3C]                                        ; +0xe4, 0xa3dd4\nRET                                                                    ; +0xe8, 0xa3dd8", "xrefs": ["sub_A40E0 @ 0xa4734", "sub_A495C @ 0xa4e2c"], "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"}