{"type": "func", "start": 787660, "end": 787766, "name": "FMOD_OS_CriticalSection_Create", "pseudocode": "// \n// FMOD_OS_CriticalSection_Create from 0xc04cc to 0xc0536 (106 bytes)\n// \n// 1 xrefs:\n// > j_FMOD_OS_CriticalSection_Create @ 0xe12b8\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 FMOD_OS_CriticalSection_Create(unsigned __int64 **a1, int a2, int a3, pthread_mutexattr_t a4)\n{\n  unsigned __int64 *v5; // r5\n  pthread_mutexattr_t attr; // [sp+Ch] [bp-Ch] BYREF\n\n  attr = a4;\n  if ( a2 )\n  {\n    v5 = (unsigned __int64 *)&unk_1261C8;\n  }\n  else\n  {\n    v5 = sub_BD410(\n           *(int *)((char *)&dword_14C + (_DWORD)off_E8000),\n           4u,\n           \"../android/src/fmod_os_misc.cpp\",\n           0x21Eu,\n           0,\n           0);\n    if ( !v5 )\n      return 38;\n  }\n  if ( pthread_mutexattr_init(&attr)\n    || pthread_mutexattr_settype(&attr, 1)\n    || pthread_mutex_init((pthread_mutex_t *)v5, &attr)\n    || pthread_mutexattr_destroy(&attr) )\n  {\n    return 28;\n  }\n  *a1 = v5;\n  return 0;\n}", "assembly": "; \n; FMOD_OS_CriticalSection_Create from 0xc04cc to 0xc0536 (106 bytes)\n; \n; 1 xrefs:\n; > j_FMOD_OS_CriticalSection_Create @ 0xe12b8\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            {R0-R5,R7,LR}                                          ; +0x0, 0xc04cc\nADD             R7, SP, #0x18                                          ; +0x2, 0xc04ce\nMOV             R4, R0                                                 ; +0x4, 0xc04d0\nCBZ             R1, loc_C04DA                                          ; +0x6, 0xc04d2\nLDR             R5, =(unk_1261C8 - 0xC04DA)                            ; +0x8, 0xc04d4\nADD             R5, PC; unk_1261C8                                     ; +0xa, 0xc04d6\nB               loc_C0502                                              ; +0xc, 0xc04d8\nLDR             R0, =(off_E6144 - 0xC04E8)                             ; +0xe, 0xc04da\nMOVS            R1, #1                                                 ; +0x10, 0xc04dc\nMOVS            R2, #0                                                 ; +0x12, 0xc04de\nMOVW            R3, #0x21E                                             ; +0x14, 0xc04e0\nADD             R0, PC; off_E6144                                      ; +0x18, 0xc04e4\nLDR             R0, [R0]; off_E8000                                    ; +0x1a, 0xc04e6\nLDR             R0, [R0]; dword_F2488                                  ; +0x1c, 0xc04e8\nLDR.W           R0, [R0,#(dword_F25D4 - 0xF2488)]                      ; +0x1e, 0xc04ea\nSTRD.W          R2, R2, [SP,#0x10+var_10]                              ; +0x22, 0xc04ee\nSTR             R1, [SP,#0x10+var_8]                                   ; +0x26, 0xc04f2\nMOVS            R1, #4                                                 ; +0x28, 0xc04f4\nLDR             R2, =(aAndroidSrcFmod - 0xC04FC); \"../android/src/fmod_os_misc.cpp\" ... ; +0x2a, 0xc04f6\nADD             R2, PC; \"../android/src/fmod_os_misc.cpp\"              ; +0x2c, 0xc04f8\nBL              sub_BD410                                              ; +0x2e, 0xc04fa\nMOV             R5, R0                                                 ; +0x32, 0xc04fe\nCBZ             R0, loc_C052C                                          ; +0x34, 0xc0500\nADD             R0, SP, #0x10+attr; attr                               ; +0x36, 0xc0502\nBLX             pthread_mutexattr_init                                 ; +0x38, 0xc0504\nCBNZ            R0, loc_C0526                                          ; +0x3c, 0xc0508\nADD             R0, SP, #0x10+attr                                     ; +0x3e, 0xc050a\nMOVS            R1, #1                                                 ; +0x40, 0xc050c\nBLX             pthread_mutexattr_settype                              ; +0x42, 0xc050e\nCBNZ            R0, loc_C0526                                          ; +0x46, 0xc0512\nADD             R1, SP, #0x10+attr; mutexattr                          ; +0x48, 0xc0514\nMOV             R0, R5; mutex                                          ; +0x4a, 0xc0516\nBLX             pthread_mutex_init                                     ; +0x4c, 0xc0518\nCBNZ            R0, loc_C0526                                          ; +0x50, 0xc051c\nADD             R0, SP, #0x10+attr; attr                               ; +0x52, 0xc051e\nBLX             pthread_mutexattr_destroy                              ; +0x54, 0xc0520\nCBZ             R0, loc_C0530                                          ; +0x58, 0xc0524\nMOVS            R0, #0x1C                                              ; +0x5a, 0xc0526\nADD             SP, SP, #0x10                                          ; +0x5c, 0xc0528\nPOP             {R4,R5,R7,PC}                                          ; +0x5e, 0xc052a\nMOVS            R0, #0x26 ; '&'                                        ; +0x60, 0xc052c\nB               loc_C0528                                              ; +0x62, 0xc052e\nMOVS            R0, #0                                                 ; +0x64, 0xc0530\nSTR             R5, [R4]                                               ; +0x66, 0xc0532\nB               loc_C0528                                              ; +0x68, 0xc0534", "xrefs": ["j_FMOD_OS_CriticalSection_Create @ 0xe12b8"], "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"}