{"type": "func", "start": 535408, "end": 535560, "name": "sub_82B70", "pseudocode": "// \n// sub_82B70 from 0x82b70 to 0x82c08 (152 bytes)\n// \n// 1 xrefs:\n// > sub_83348 @ 0x835a8\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:41:18 +0000\n// \n\nint __fastcall sub_82B70(int a1)\n{\n  int v2; // r1\n  int v3; // r5\n  int v4; // r2\n  unsigned int v5; // r0\n  int v6; // r2\n  int v7; // r3\n  signed int v8; // r0\n  char v9; // r0\n\n  v2 = *(unsigned __int8 *)(a1 + 234);\n  v3 = *(_DWORD *)(a1 + 4);\n  v4 = (*(unsigned __int8 *)(a1 + 262) >> 4) & 3;\n  v5 = 255;\n  switch ( v4 )\n  {\n    case 0:\n      v5 = byte_E8004[v2 & 0x1F];\n      break;\n    case 1:\n      v5 = (8 * v2) ^ ((unsigned int)(char)v2 >> 7);\n      goto LABEL_5;\n    case 2:\n      break;\n    case 3:\n      LOBYTE(v5) = sub_4F410((int *)(*(_DWORD *)a1 + 2460));\n      LOBYTE(v2) = *(_BYTE *)(a1 + 234);\nLABEL_5:\n      v5 = (unsigned __int8)v5;\n      break;\n  }\n  v6 = *(unsigned __int8 *)(a1 + 236);\n  v7 = *(_DWORD *)(v3 + 44);\n  v8 = (v6 * v5) >> 6;\n  if ( (v2 & 0x80u) != 0 )\n  {\n    if ( (__int16)v7 < v8 )\n      v8 = *(_DWORD *)(v3 + 44);\n    v8 = -v8;\n  }\n  else if ( v8 + v7 > 64 )\n  {\n    v8 = 64 - v7;\n  }\n  *(_DWORD *)(v3 + 52) = v8;\n  v9 = v2 + v6;\n  if ( (char)(v2 + v6) > 31 )\n    v9 -= 64;\n  *(_BYTE *)(a1 + 234) = v9;\n  *(_BYTE *)(v3 + 36) |= 2u;\n  return 0;\n}", "assembly": "; \n; sub_82B70 from 0x82b70 to 0x82c08 (152 bytes)\n; \n; 1 xrefs:\n; > sub_83348 @ 0x835a8\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:41:18 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x82b70\nADD             R7, SP, #0xC                                           ; +0x2, 0x82b72\nPUSH.W          {R11}                                                  ; +0x4, 0x82b74\nMOV             R4, R0                                                 ; +0x8, 0x82b78\nLDRB.W          R1, [R0,#0xEA]                                         ; +0xa, 0x82b7a\nLDR             R5, [R0,#4]                                            ; +0xe, 0x82b7e\nLDRB.W          R0, [R0,#0x106]                                        ; +0x10, 0x82b80\nUBFX.W          R2, R0, #4, #2                                         ; +0x14, 0x82b84\nMOVS            R0, #0xFF                                              ; +0x18, 0x82b88\nTBB.W           [PC,R2]; switch 4 cases                                ; +0x1a, 0x82b8a\nDCB 2; jump table for switch statement                                 ; +0x1e, 0x82b8e\nDCB 9                                                                  ; +0x1f, 0x82b8f\nDCB 0x16                                                               ; +0x20, 0x82b90\nDCB 0xE                                                                ; +0x21, 0x82b91\nLDR             R2, =(off_E6220 - 0x82B9C); jumptable 00082B8A case 0  ; +0x22, 0x82b92\nAND.W           R0, R1, #0x1F                                          ; +0x24, 0x82b94\nADD             R2, PC; off_E6220                                      ; +0x28, 0x82b98\nLDR             R2, [R2]; byte_E8004                                   ; +0x2a, 0x82b9a\nLDRB            R0, [R2,R0]                                            ; +0x2c, 0x82b9c\nB               loc_82BBA; jumptable 00082B8A case 2                   ; +0x2e, 0x82b9e\nSXTB            R0, R1; jumptable 00082B8A case 1                      ; +0x30, 0x82ba0\nLSLS            R2, R1, #3                                             ; +0x32, 0x82ba2\nEOR.W           R0, R2, R0,LSR#7                                       ; +0x34, 0x82ba4\nB               loc_82BB8                                              ; +0x38, 0x82ba8\nLDR             R0, [R4]; jumptable 00082B8A case 3                    ; +0x3a, 0x82baa\nADDW            R0, R0, #0x99C                                         ; +0x3c, 0x82bac\nBL              sub_4F410                                              ; +0x40, 0x82bb0\nLDRB.W          R1, [R4,#0xEA]                                         ; +0x44, 0x82bb4\nUXTB            R0, R0                                                 ; +0x48, 0x82bb8\nLDRB.W          R2, [R4,#0xEC]; jumptable 00082B8A case 2              ; +0x4a, 0x82bba\nSXTB            R6, R1                                                 ; +0x4e, 0x82bbe\nLDR             R3, [R5,#0x2C]                                         ; +0x50, 0x82bc0\nCMP             R6, #0                                                 ; +0x52, 0x82bc2\nMUL             R0, R2, R0                                             ; +0x54, 0x82bc4\nMOV.W           R0, R0,LSR#6                                           ; +0x58, 0x82bc8\nBMI             loc_82BDA                                              ; +0x5c, 0x82bcc\nADDS            R6, R0, R3                                             ; +0x5e, 0x82bce\nCMP             R6, #0x40 ; '@'                                        ; +0x60, 0x82bd0\nIT GT                                                                  ; +0x62, 0x82bd2\nRSBGT.W         R0, R3, #0x40 ; '@'                                    ; +0x64, 0x82bd4\nB               loc_82BE4                                              ; +0x68, 0x82bd8\nSXTH            R6, R3                                                 ; +0x6a, 0x82bda\nCMP             R6, R0                                                 ; +0x6c, 0x82bdc\nIT LT                                                                  ; +0x6e, 0x82bde\nMOVLT           R0, R3                                                 ; +0x70, 0x82be0\nNEGS            R0, R0                                                 ; +0x72, 0x82be2\nSTR             R0, [R5,#0x34]                                         ; +0x74, 0x82be4\nADDS            R0, R1, R2                                             ; +0x76, 0x82be6\nSXTB            R1, R0                                                 ; +0x78, 0x82be8\nCMP             R1, #0x1F                                              ; +0x7a, 0x82bea\nIT GT                                                                  ; +0x7c, 0x82bec\nSUBGT           R0, #0x40 ; '@'                                        ; +0x7e, 0x82bee\nSTRB.W          R0, [R4,#0xEA]                                         ; +0x80, 0x82bf0\nLDRB.W          R0, [R5,#0x24]                                         ; +0x84, 0x82bf4\nORR.W           R0, R0, #2                                             ; +0x88, 0x82bf8\nSTRB.W          R0, [R5,#0x24]                                         ; +0x8c, 0x82bfc\nMOVS            R0, #0                                                 ; +0x90, 0x82c00\nPOP.W           {R11}                                                  ; +0x92, 0x82c02\nPOP             {R4-R7,PC}                                             ; +0x96, 0x82c06", "xrefs": ["sub_83348 @ 0x835a8"], "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"}