{"type": "func", "start": 361728, "end": 361804, "name": "sub_58500", "pseudocode": "// \n// sub_58500 from 0x58500 to 0x5854c (76 bytes)\n// \n// 1 xrefs:\n// > FMOD::System::setDSPBufferSize @ 0xb75f0\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\nint __fastcall sub_58500(int a1, unsigned int a2, int a3)\n{\n  int v3; // r3\n\n  if ( *(_BYTE *)(a1 + 4) )\n    return 27;\n  v3 = 31;\n  if ( a2 && a3 >= 2 )\n  {\n    if ( (a3 * (unsigned __int64)a2) >> 31 )\n    {\n      return 31;\n    }\n    else\n    {\n      if ( a2 << 30 )\n        a2 = (a2 + 3) & 0xFFFFFFFC;\n      v3 = 0;\n      *(_DWORD *)(a1 + 1192) = a2;\n      *(_DWORD *)(a1 + 1196) = a3 * a2;\n    }\n  }\n  return v3;\n}", "assembly": "; \n; sub_58500 from 0x58500 to 0x5854c (76 bytes)\n; \n; 1 xrefs:\n; > FMOD::System::setDSPBufferSize @ 0xb75f0\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\nPUSH            {R4,R5,R7,LR}                                          ; +0x0, 0x58500\nADD             R7, SP, #8                                             ; +0x2, 0x58502\nLDRB            R3, [R0,#4]                                            ; +0x4, 0x58504\nCBZ             R3, loc_5850E                                          ; +0x6, 0x58506\nMOVS            R3, #0x1B                                              ; +0x8, 0x58508\nMOV             R0, R3                                                 ; +0xa, 0x5850a\nPOP             {R4,R5,R7,PC}                                          ; +0xc, 0x5850c\nMOVS            R3, #0x1F                                              ; +0xe, 0x5850e\nCMP             R1, #0                                                 ; +0x10, 0x58510\nBEQ             loc_5850A                                              ; +0x12, 0x58512\nCMP             R2, #2                                                 ; +0x14, 0x58514\nBLT             loc_5850A                                              ; +0x16, 0x58516\nUMULL           R3, R4, R2, R1                                         ; +0x18, 0x58518\nASRS            R5, R2, #0x1F                                          ; +0x1c, 0x5851c\nMLA             R4, R5, R1, R4                                         ; +0x1e, 0x5851e\nLSRS            R3, R3, #0x1F                                          ; +0x22, 0x58522\nORR.W           R3, R3, R4,LSL#1                                       ; +0x24, 0x58524\nORR.W           R3, R3, R4,LSR#31                                      ; +0x28, 0x58528\nCBZ             R3, loc_58532                                          ; +0x2c, 0x5852c\nMOVS            R3, #0x1F                                              ; +0x2e, 0x5852e\nB               loc_5850A                                              ; +0x30, 0x58530\nLSLS            R3, R1, #0x1E                                          ; +0x32, 0x58532\nADD.W           R3, R1, #3                                             ; +0x34, 0x58534\nIT NE                                                                  ; +0x38, 0x58538\nBICNE.W         R1, R3, #3                                             ; +0x3a, 0x5853a\nMULS            R2, R1                                                 ; +0x3e, 0x5853e\nMOVS            R3, #0                                                 ; +0x40, 0x58540\nSTR.W           R1, [R0,#0x4A8]                                        ; +0x42, 0x58542\nSTR.W           R2, [R0,#0x4AC]                                        ; +0x46, 0x58546\nB               loc_5850A                                              ; +0x4a, 0x5854a", "xrefs": ["FMOD::System::setDSPBufferSize @ 0xb75f0"], "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"}