{"type": "func", "start": 946080, "end": 946232, "name": "FMOD_OS_CriticalSection_Create", "pseudocode": "// \n// FMOD_OS_CriticalSection_Create from 0xe6fa0 to 0xe7038 (152 bytes)\n// \n// 4 xrefs:\n// > .FMOD_OS_CriticalSection_Create @ 0x107f6c\n// > <???> @ 0x4ff0\n// > .FMOD_OS_CriticalSection_Create @ 0x107f64\n// > <???> @ 0x110878\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 FMOD_OS_CriticalSection_Create(pthread_mutex_t **a1, char a2)\n{\n  pthread_mutex_t *v3; // x20\n  __int64 v4; // x0\n  __int64 result; // x0\n  pthread_mutexattr_t attr; // [xsp+8h] [xbp-18h] BYREF\n\n  if ( (a2 & 1) != 0 )\n  {\n    v3 = (pthread_mutex_t *)&unk_155F54;\n  }\n  else\n  {\n    v4 = sub_E7334();\n    v3 = (pthread_mutex_t *)sub_E7390(v4);\n    if ( !v3 )\n      return 38;\n  }\n  if ( pthread_mutexattr_init(&attr) )\n    return 28;\n  if ( pthread_mutexattr_settype(&attr, 1) )\n    return 28;\n  if ( pthread_mutex_init(v3, &attr) )\n    return 28;\n  result = pthread_mutexattr_destroy(&attr);\n  if ( (_DWORD)result )\n    return 28;\n  *a1 = v3;\n  return result;\n}", "assembly": "; \n; FMOD_OS_CriticalSection_Create from 0xe6fa0 to 0xe7038 (152 bytes)\n; \n; 4 xrefs:\n; > .FMOD_OS_CriticalSection_Create @ 0x107f6c\n; > <???> @ 0x4ff0\n; > .FMOD_OS_CriticalSection_Create @ 0x107f64\n; > <???> @ 0x110878\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\nSUB             SP, SP, #0x30                                          ; +0x0, 0xe6fa0\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0xe6fa4\nMOV             X19, X0                                                ; +0x8, 0xe6fa8\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0xc, 0xe6fac\nADD             X29, SP, #0x20                                         ; +0x10, 0xe6fb0\nTBZ             W1, #0, loc_E6FC4                                      ; +0x14, 0xe6fb4\nADRL            X20, unk_155F54                                        ; +0x18, 0xe6fb8\nB               loc_E6FE0                                              ; +0x20, 0xe6fc0\nBL              sub_E7334                                              ; +0x24, 0xe6fc4\nMOV             W1, #0x28 ; '('                                        ; +0x28, 0xe6fc8\nLDR             X8, [X8]                                               ; +0x2c, 0xe6fcc\nMOV             W3, #0x21E                                             ; +0x30, 0xe6fd0\nBL              sub_E7390                                              ; +0x34, 0xe6fd4\nMOV             X20, X0                                                ; +0x38, 0xe6fd8\nCBZ             X0, loc_E7028                                          ; +0x3c, 0xe6fdc\nADD             X0, SP, #0x20+attr; attr                               ; +0x40, 0xe6fe0\nBL              .pthread_mutexattr_init                                ; +0x44, 0xe6fe4\nCBNZ            W0, loc_E7018                                          ; +0x48, 0xe6fe8\nADD             X0, SP, #0x20+attr; attr                               ; +0x4c, 0xe6fec\nMOV             W1, #1; kind                                           ; +0x50, 0xe6ff0\nBL              .pthread_mutexattr_settype                             ; +0x54, 0xe6ff4\nCBNZ            W0, loc_E7018                                          ; +0x58, 0xe6ff8\nADD             X1, SP, #0x20+attr; mutexattr                          ; +0x5c, 0xe6ffc\nMOV             X0, X20; mutex                                         ; +0x60, 0xe7000\nBL              .pthread_mutex_init                                    ; +0x64, 0xe7004\nCBNZ            W0, loc_E7018                                          ; +0x68, 0xe7008\nADD             X0, SP, #0x20+attr; attr                               ; +0x6c, 0xe700c\nBL              .pthread_mutexattr_destroy                             ; +0x70, 0xe7010\nCBZ             W0, loc_E7030                                          ; +0x74, 0xe7014\nMOV             W0, #0x1C                                              ; +0x78, 0xe7018\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x7c, 0xe701c\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x80, 0xe7020\nB               loc_E73E0                                              ; +0x84, 0xe7024\nMOV             W0, #0x26 ; '&'                                        ; +0x88, 0xe7028\nB               loc_E701C                                              ; +0x8c, 0xe702c\nSTR             X20, [X19]                                             ; +0x90, 0xe7030\nB               loc_E701C                                              ; +0x94, 0xe7034", "xrefs": [".FMOD_OS_CriticalSection_Create @ 0x107f6c", "<???> @ 0x4ff0", ".FMOD_OS_CriticalSection_Create @ 0x107f64", "<???> @ 0x110878"], "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"}