{"type": "func", "start": 427116, "end": 427258, "name": "sub_6846C", "pseudocode": "// \n// sub_6846C from 0x6846c to 0x684fa (142 bytes)\n// \n// 0 xrefs:\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_6846C(int a1, int a2)\n{\n  int v4; // r4\n  int v5; // r9\n  int j; // r5\n  int v7; // r6\n  int i; // r4\n  int v9; // r0\n  int v11; // [sp+4h] [bp-24h] BYREF\n  int v12; // [sp+8h] [bp-20h] BYREF\n  char v13; // [sp+Ch] [bp-1Ch]\n\n  v12 = FMOD::DSPTransceiver::sCriticalSection[0];\n  j_FMOD_OS_CriticalSection_Enter(FMOD::DSPTransceiver::sCriticalSection[0]);\n  v13 = 1;\n  v4 = FMOD::DSPTransceiver::sCriticalSection[*(_DWORD *)(a1 + 28) + 4];\n  if ( !v4 )\n    goto LABEL_13;\n  v5 = 0;\n  if ( !a2 )\n  {\n    v7 = v4 + 56;\n    for ( i = 0; i != 2432; i += 76 )\n    {\n      if ( !*(_DWORD *)(v7 + i) )\n      {\n        v11 = 0;\n        v9 = (*(int (__fastcall **)(int, int *, _DWORD))(*(_DWORD *)(a1 + 24) + 28))(a1, &v11, 0);\n        if ( v9 )\n        {\n          v5 = v9;\n          goto LABEL_14;\n        }\n        *(_DWORD *)(v7 + i) = sub_537B4(v11);\n      }\n    }\n    goto LABEL_13;\n  }\n  if ( a2 == 1 )\n  {\n    for ( j = 0; j != 2432; j += 76 )\n      sub_67B0C(v4 + j);\nLABEL_13:\n    v5 = 0;\n  }\nLABEL_14:\n  sub_44984((int)&v12);\n  return v5;\n}", "assembly": "; \n; sub_6846C from 0x6846c to 0x684fa (142 bytes)\n; \n; 0 xrefs:\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-R7,LR}                                             ; +0x0, 0x6846c\nADD             R7, SP, #0xC                                           ; +0x2, 0x6846e\nPUSH.W          {R4-R9,R11}                                            ; +0x4, 0x68470\nLDR             R4, =(_ZN4FMOD14DSPTransceiver16sCriticalSectionE - 0x6847E); FMOD::DSPTransceiver::sCriticalSection ... ; +0x8, 0x68474\nMOV             R5, R0                                                 ; +0xa, 0x68476\nMOV             R6, R1                                                 ; +0xc, 0x68478\nADD             R4, PC; FMOD::DSPTransceiver::sCriticalSection         ; +0xe, 0x6847a\nLDR             R0, [R4]; FMOD::DSPTransceiver::sCriticalSection       ; +0x10, 0x6847c\nSTR             R0, [SP,#0x10+var_8]                                   ; +0x12, 0x6847e\nBLX             j_FMOD_OS_CriticalSection_Enter                        ; +0x14, 0x68480\nMOVS            R0, #1                                                 ; +0x18, 0x68484\nSTRB.W          R0, [SP,#0x10+var_4]                                   ; +0x1a, 0x68486\nLDR             R0, [R5,#0x1C]                                         ; +0x1e, 0x6848a\nADD.W           R0, R4, R0,LSL#2                                       ; +0x20, 0x6848c\nLDR             R4, [R0,#0x10]                                         ; +0x24, 0x68490\nCBZ             R4, loc_684E2                                          ; +0x26, 0x68492\nMOV.W           R9, #0                                                 ; +0x28, 0x68494\nCBZ             R6, loc_684B0                                          ; +0x2c, 0x68498\nCMP             R6, #1                                                 ; +0x2e, 0x6849a\nBNE             loc_684E6                                              ; +0x30, 0x6849c\nMOVS            R5, #0                                                 ; +0x32, 0x6849e\nCMP.W           R5, #0x980                                             ; +0x34, 0x684a0\nBEQ             loc_684E2                                              ; +0x38, 0x684a4\nADDS            R0, R4, R5                                             ; +0x3a, 0x684a6\nBL              sub_67B0C                                              ; +0x3c, 0x684a8\nADDS            R5, #0x4C ; 'L'                                        ; +0x40, 0x684ac\nB               loc_684A0                                              ; +0x42, 0x684ae\nADD.W           R6, R4, #0x38 ; '8'                                    ; +0x44, 0x684b0\nADD.W           R8, SP, #0x10+var_C                                    ; +0x48, 0x684b4\nMOVS            R4, #0                                                 ; +0x4c, 0x684b8\nCMP.W           R4, #0x980                                             ; +0x4e, 0x684ba\nBEQ             loc_684E2                                              ; +0x52, 0x684be\nLDR             R0, [R6,R4]                                            ; +0x54, 0x684c0\nCBNZ            R0, loc_684DE                                          ; +0x56, 0x684c2\nSTR.W           R9, [SP,#0x10+var_C]                                   ; +0x58, 0x684c4\nMOV             R1, R8                                                 ; +0x5c, 0x684c8\nLDR             R0, [R5,#0x18]                                         ; +0x5e, 0x684ca\nMOVS            R2, #0                                                 ; +0x60, 0x684cc\nLDR             R3, [R0,#0x1C]                                         ; +0x62, 0x684ce\nMOV             R0, R5                                                 ; +0x64, 0x684d0\nBLX             R3                                                     ; +0x66, 0x684d2\nCBNZ            R0, loc_684F6                                          ; +0x68, 0x684d4\nLDR             R0, [SP,#0x10+var_C]                                   ; +0x6a, 0x684d6\nBL              sub_537B4                                              ; +0x6c, 0x684d8\nSTR             R0, [R6,R4]                                            ; +0x70, 0x684dc\nADDS            R4, #0x4C ; 'L'                                        ; +0x72, 0x684de\nB               loc_684BA                                              ; +0x74, 0x684e0\nMOV.W           R9, #0                                                 ; +0x76, 0x684e2\nADD             R0, SP, #0x10+var_8                                    ; +0x7a, 0x684e6\nBL              sub_44984                                              ; +0x7c, 0x684e8\nMOV             R0, R9                                                 ; +0x80, 0x684ec\nADD             SP, SP, #0x10                                          ; +0x82, 0x684ee\nPOP.W           {R8,R9,R11}                                            ; +0x84, 0x684f0\nPOP             {R4-R7,PC}                                             ; +0x88, 0x684f4\nMOV             R9, R0                                                 ; +0x8a, 0x684f6\nB               loc_684E6                                              ; +0x8c, 0x684f8", "xrefs": [], "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"}