{"type": "func", "start": 542886, "end": 543028, "name": "sub_848A6", "pseudocode": "// \n// sub_848A6 from 0x848a6 to 0x84934 (142 bytes)\n// \n// 1 xrefs:\n// > sub_82958 @ 0x82958\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:19 +0000\n// \n\nint __fastcall sub_848A6(int a1, int a2, unsigned int a3, int a4)\n{\n  unsigned int v6; // r0\n  int v8; // r6\n  __int16 v9; // r5\n\n  if ( a4 == 2 )\n  {\n    v6 = *(_DWORD *)(a1 + 1516);\n    if ( v6 != a3 )\n    {\n      if ( v6 > a3 )\n      {\n        sub_4F22C(a1, 0);\n        v8 = 1;\n      }\n      else\n      {\n        v8 = 0;\n      }\n      while ( *(_DWORD *)(a1 + 1516) < a3 )\n        sub_82996(a1, 1);\n      if ( v8 )\n      {\n        v9 = *(_WORD *)(a1 + 2420);\n        sub_4F378(a1);\n        *(_WORD *)(a1 + 2420) = v9;\n      }\n    }\n  }\n  else\n  {\n    if ( a4 != 256 )\n      return 19;\n    sub_4F22C(a1, 0);\n    if ( (*(_BYTE *)(a1 + 209) & 0x40) != 0 )\n    {\n      while ( *(_DWORD *)(a1 + 2440) < (signed int)a3 && !*(_BYTE *)(a1 + 2421) )\n        sub_82996(a1, 1);\n    }\n    else\n    {\n      *(_DWORD *)(a1 + 2456) = a3;\n      *(_DWORD *)(a1 + 2440) = a3;\n    }\n  }\n  return 0;\n}", "assembly": "; \n; sub_848A6 from 0x848a6 to 0x84934 (142 bytes)\n; \n; 1 xrefs:\n; > sub_82958 @ 0x82958\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:19 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x848a6\nADD             R7, SP, #0xC                                           ; +0x2, 0x848a8\nPUSH.W          {R11}                                                  ; +0x4, 0x848aa\nMOV             R5, R2                                                 ; +0x8, 0x848ae\nMOV             R4, R0                                                 ; +0xa, 0x848b0\nCMP             R3, #2                                                 ; +0xc, 0x848b2\nBEQ             loc_848EE                                              ; +0xe, 0x848b4\nCMP.W           R3, #0x100                                             ; +0x10, 0x848b6\nBNE             loc_84904                                              ; +0x14, 0x848ba\nMOV             R0, R4                                                 ; +0x16, 0x848bc\nMOVS            R1, #0                                                 ; +0x18, 0x848be\nBL              sub_4F22C                                              ; +0x1a, 0x848c0\nLDRB.W          R0, [R4,#0xD1]                                         ; +0x1e, 0x848c4\nLSLS            R0, R0, #0x19                                          ; +0x22, 0x848c8\nBMI             loc_848D6                                              ; +0x24, 0x848ca\nSTR.W           R5, [R4,#0x998]                                        ; +0x26, 0x848cc\nSTR.W           R5, [R4,#0x988]                                        ; +0x2a, 0x848d0\nB               loc_8492C                                              ; +0x2e, 0x848d4\nLDR.W           R0, [R4,#0x988]                                        ; +0x30, 0x848d6\nCMP             R0, R5                                                 ; +0x34, 0x848da\nBGE             loc_8492C                                              ; +0x36, 0x848dc\nLDRB.W          R0, [R4,#0x975]                                        ; +0x38, 0x848de\nCBNZ            R0, loc_8492C                                          ; +0x3c, 0x848e2\nMOV             R0, R4                                                 ; +0x3e, 0x848e4\nMOVS            R1, #1                                                 ; +0x40, 0x848e6\nBL              sub_82996                                              ; +0x42, 0x848e8\nB               loc_848D6                                              ; +0x46, 0x848ec\nLDR.W           R0, [R4,#0x5EC]                                        ; +0x48, 0x848ee\nCMP             R0, R5                                                 ; +0x4c, 0x848f2\nBEQ             loc_8492C                                              ; +0x4e, 0x848f4\nBLS             loc_84908                                              ; +0x50, 0x848f6\nMOV             R0, R4                                                 ; +0x52, 0x848f8\nMOVS            R1, #0                                                 ; +0x54, 0x848fa\nBL              sub_4F22C                                              ; +0x56, 0x848fc\nMOVS            R6, #1                                                 ; +0x5a, 0x84900\nB               loc_84914                                              ; +0x5c, 0x84902\nMOVS            R0, #0x13                                              ; +0x5e, 0x84904\nB               loc_8492E                                              ; +0x60, 0x84906\nMOVS            R6, #0                                                 ; +0x62, 0x84908\nB               loc_84914                                              ; +0x64, 0x8490a\nMOV             R0, R4                                                 ; +0x66, 0x8490c\nMOVS            R1, #1                                                 ; +0x68, 0x8490e\nBL              sub_82996                                              ; +0x6a, 0x84910\nLDR.W           R0, [R4,#0x5EC]                                        ; +0x6e, 0x84914\nCMP             R0, R5                                                 ; +0x72, 0x84918\nBCC             loc_8490C                                              ; +0x74, 0x8491a\nCBZ             R6, loc_8492C                                          ; +0x76, 0x8491c\nMOV             R0, R4                                                 ; +0x78, 0x8491e\nLDRH.W          R5, [R4,#0x974]                                        ; +0x7a, 0x84920\nBL              sub_4F378                                              ; +0x7e, 0x84924\nSTRH.W          R5, [R4,#0x974]                                        ; +0x82, 0x84928\nMOVS            R0, #0                                                 ; +0x86, 0x8492c\nPOP.W           {R11}                                                  ; +0x88, 0x8492e\nPOP             {R4-R7,PC}                                             ; +0x8c, 0x84932", "xrefs": ["sub_82958 @ 0x82958"], "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"}