{"type": "func", "start": 545592, "end": 545704, "name": "sub_85338", "pseudocode": "// \n// sub_85338 from 0x85338 to 0x853a8 (112 bytes)\n// \n// 1 xrefs:\n// > sub_85300 @ 0x85314\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_85338(__int64 a1, int a2)\n{\n  int v2; // w8\n  __int64 result; // x0\n  __int64 v6; // x8\n\n  v2 = *(_DWORD *)(a1 + 12);\n  if ( v2 < 0 )\n    v2 = -v2;\n  if ( v2 >= a2 || (result = sub_853D8(a1, (unsigned int)a2), !(_DWORD)result) )\n  {\n    v6 = *(int *)(a1 + 8);\n    if ( (int)v6 < a2 )\n      memset((void *)(*(_QWORD *)a1 + 16 * v6), 0, 16LL * (a2 - (int)v6));\n    *(_DWORD *)(a1 + 8) = a2;\n    return 0;\n  }\n  return result;\n}", "assembly": "; \n; sub_85338 from 0x85338 to 0x853a8 (112 bytes)\n; \n; 1 xrefs:\n; > sub_85300 @ 0x85314\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\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x85338\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x8533c\nLDR             W8, [X0,#0xC]                                          ; +0x8, 0x85340\nMOV             W19, W1                                                ; +0xc, 0x85344\nMOV             X20, X0                                                ; +0x10, 0x85348\nADD             X29, SP, #0x10                                         ; +0x14, 0x8534c\nCMP             W8, #0                                                 ; +0x18, 0x85350\nCNEG            W8, W8, MI                                             ; +0x1c, 0x85354\nCMP             W8, W1                                                 ; +0x20, 0x85358\nB.GE            loc_85370                                              ; +0x24, 0x8535c\nMOV             X0, X20                                                ; +0x28, 0x85360\nMOV             W1, W19                                                ; +0x2c, 0x85364\nBL              sub_853D8                                              ; +0x30, 0x85368\nCBNZ            W0, loc_8539C                                          ; +0x34, 0x8536c\nLDRSW           X8, [X20,#8]                                           ; +0x38, 0x85370\nCMP             W8, W19                                                ; +0x3c, 0x85374\nB.GE            loc_85394                                              ; +0x40, 0x85378\nLDR             X9, [X20]                                              ; +0x44, 0x8537c\nSUB             W10, W19, W8                                           ; +0x48, 0x85380\nSBFIZ           X2, X10, #4, #0x20 ; ' '; n                            ; +0x4c, 0x85384\nMOV             W1, WZR; c                                             ; +0x50, 0x85388\nADD             X0, X9, X8,LSL#4; s                                    ; +0x54, 0x8538c\nBL              .memset                                                ; +0x58, 0x85390\nMOV             W0, WZR                                                ; +0x5c, 0x85394\nSTR             W19, [X20,#8]                                          ; +0x60, 0x85398\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x64, 0x8539c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x68, 0x853a0\nRET                                                                    ; +0x6c, 0x853a4", "xrefs": ["sub_85300 @ 0x85314"], "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"}