{"type": "func", "start": 551568, "end": 551750, "name": "sub_86A90", "pseudocode": "// \n// sub_86A90 from 0x86a90 to 0x86b46 (182 bytes)\n// \n// 2 xrefs:\n// > sub_86DAC @ 0x87332\n// > sub_874A4 @ 0x879a2\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:20 +0000\n// \n\nint __fastcall sub_86A90(int a1, _BYTE *a2)\n{\n  int v2; // r6\n  int v3; // r0\n  int v4; // r0\n  int v5; // r5\n  int v6; // r4\n  int v7; // r0\n  int v8; // r0\n  int v9; // r0\n\n  v2 = *(_DWORD *)(a1 + 4);\n  switch ( a2[1223] )\n  {\n    case 0:\n      v3 = byte_E8024[*(_DWORD *)(v2 + 156)];\n      break;\n    case 1:\n      v3 = -64;\n      if ( *(int *)(v2 + 156) < 128 )\n        v3 = 64;\n      break;\n    case 2:\n      v4 = *(_DWORD *)(v2 + 156) + 128;\n      goto LABEL_9;\n    case 3:\n      v4 = 384 - *(_DWORD *)(v2 + 156);\nLABEL_9:\n      v3 = (int)(((v4 + ((unsigned int)(v4 >> 31) >> 24)) & 0xFFFFFF00) - v4 + 128) >> 1;\n      break;\n    default:\n      v3 = 0;\n      break;\n  }\n  v5 = (unsigned __int8)a2[1224];\n  v6 = *(_DWORD *)(v2 + 160);\n  v7 = v3 * (unsigned __int8)a2[1225];\n  if ( a2[1224] )\n    v7 = v7 * v6 / v5;\n  else\n    v5 = 0;\n  if ( v6 < v5 )\n    v5 = v6 + 1;\n  *(_DWORD *)(v2 + 160) = v5;\n  *(_DWORD *)(v2 + 56) += v7 >> 6;\n  v8 = (unsigned __int8)a2[1226];\n  *(_BYTE *)(v2 + 36) |= 1u;\n  v9 = v8 + *(_DWORD *)(v2 + 156);\n  if ( v9 > 255 )\n    v9 -= 256;\n  *(_DWORD *)(v2 + 156) = v9;\n  return 0;\n}", "assembly": "; \n; sub_86A90 from 0x86a90 to 0x86b46 (182 bytes)\n; \n; 2 xrefs:\n; > sub_86DAC @ 0x87332\n; > sub_874A4 @ 0x879a2\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:20 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x86a90\nADD             R7, SP, #0xC                                           ; +0x2, 0x86a92\nPUSH.W          {R8}                                                   ; +0x4, 0x86a94\nLDR             R6, [R0,#4]                                            ; +0x8, 0x86a98\nMOV             R8, R1                                                 ; +0xa, 0x86a9a\nLDRB.W          R0, [R1,#0x4C7]                                        ; +0xc, 0x86a9c\nCMP             R0, #3; switch 4 cases                                 ; +0x10, 0x86aa0\nBHI             def_86AA4; jumptable 00086AA4 default case             ; +0x12, 0x86aa2\nTBB.W           [PC,R0]; switch jump                                   ; +0x14, 0x86aa4\nDCB 2; jump table for switch statement                                 ; +0x18, 0x86aa8\nDCB 0xB                                                                ; +0x19, 0x86aa9\nDCB 0x13                                                               ; +0x1a, 0x86aaa\nDCB 0x17                                                               ; +0x1b, 0x86aab\nLDR.W           R0, [R6,#0x9C]; jumptable 00086AA4 case 0              ; +0x1c, 0x86aac\nLDR             R1, =(off_E6224 - 0x86AB6)                             ; +0x20, 0x86ab0\nADD             R1, PC; off_E6224                                      ; +0x22, 0x86ab2\nLDR             R1, [R1]; byte_E8024                                   ; +0x24, 0x86ab4\nLDRSB           R0, [R1,R0]                                            ; +0x26, 0x86ab6\nB               loc_86AEE                                              ; +0x28, 0x86ab8\nMOVS            R0, #0; jumptable 00086AA4 default case                ; +0x2a, 0x86aba\nB               loc_86AEE                                              ; +0x2c, 0x86abc\nLDR.W           R1, [R6,#0x9C]; jumptable 00086AA4 case 1              ; +0x2e, 0x86abe\nMOV             R0, #0xFFFFFFC0                                        ; +0x32, 0x86ac2\nCMP             R1, #0x80                                              ; +0x36, 0x86ac6\nIT LT                                                                  ; +0x38, 0x86ac8\nMOVLT           R0, #0x40 ; '@'                                        ; +0x3a, 0x86aca\nB               loc_86AEE                                              ; +0x3c, 0x86acc\nLDR.W           R0, [R6,#0x9C]; jumptable 00086AA4 case 2              ; +0x3e, 0x86ace\nADDS            R0, #0x80                                              ; +0x42, 0x86ad2\nB               loc_86ADE                                              ; +0x44, 0x86ad4\nLDR.W           R0, [R6,#0x9C]; jumptable 00086AA4 case 3              ; +0x46, 0x86ad6\nRSB.W           R0, R0, #0x180                                         ; +0x4a, 0x86ada\nASRS            R1, R0, #0x1F                                          ; +0x4e, 0x86ade\nADD.W           R1, R0, R1,LSR#24                                      ; +0x50, 0x86ae0\nBIC.W           R1, R1, #0xFF                                          ; +0x54, 0x86ae4\nSUBS            R0, R1, R0                                             ; +0x58, 0x86ae8\nADDS            R0, #0x80                                              ; +0x5a, 0x86aea\nASRS            R0, R0, #1                                             ; +0x5c, 0x86aec\nLDRB.W          R1, [R8,#0x4C9]                                        ; +0x5e, 0x86aee\nLDRB.W          R5, [R8,#0x4C8]                                        ; +0x62, 0x86af2\nLDR.W           R4, [R6,#0xA0]                                         ; +0x66, 0x86af6\nMULS            R0, R1                                                 ; +0x6a, 0x86afa\nCBZ             R5, loc_86B08                                          ; +0x6c, 0x86afc\nMULS            R0, R4                                                 ; +0x6e, 0x86afe\nMOV             R1, R5                                                 ; +0x70, 0x86b00\nBLX             j___divsi3                                             ; +0x72, 0x86b02\nB               loc_86B0A                                              ; +0x76, 0x86b06\nMOVS            R5, #0                                                 ; +0x78, 0x86b08\nCMP             R4, R5                                                 ; +0x7a, 0x86b0a\nIT LT                                                                  ; +0x7c, 0x86b0c\nADDLT           R5, R4, #1                                             ; +0x7e, 0x86b0e\nSTR.W           R5, [R6,#0xA0]                                         ; +0x80, 0x86b10\nLDR             R1, [R6,#0x38]                                         ; +0x84, 0x86b14\nADD.W           R0, R1, R0,ASR#6                                       ; +0x86, 0x86b16\nSTR             R0, [R6,#0x38]                                         ; +0x8a, 0x86b1a\nLDRB.W          R1, [R6,#0x24]                                         ; +0x8c, 0x86b1c\nLDRB.W          R0, [R8,#0x4CA]                                        ; +0x90, 0x86b20\nORR.W           R1, R1, #1                                             ; +0x94, 0x86b24\nSTRB.W          R1, [R6,#0x24]                                         ; +0x98, 0x86b28\nLDR.W           R1, [R6,#0x9C]                                         ; +0x9c, 0x86b2c\nADD             R0, R1                                                 ; +0xa0, 0x86b30\nCMP             R0, #0xFF                                              ; +0xa2, 0x86b32\nIT GT                                                                  ; +0xa4, 0x86b34\nSUBGT.W         R0, R0, #0x100                                         ; +0xa6, 0x86b36\nSTR.W           R0, [R6,#0x9C]                                         ; +0xaa, 0x86b3a\nMOVS            R0, #0                                                 ; +0xae, 0x86b3e\nPOP.W           {R8}                                                   ; +0xb0, 0x86b40\nPOP             {R4-R7,PC}                                             ; +0xb4, 0x86b44", "xrefs": ["sub_86DAC @ 0x87332", "sub_874A4 @ 0x879a2"], "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"}