
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

sqlite3_mutex * pthreadMutexAlloc(int iType)

{
  pthread_mutex_t *__mutex;
  uint uVar1;
  uint uVar2;
  int in_GS_OFFSET;
  u64 in_stack_ffffffe4;
  pthread_mutexattr_t recursiveAttr;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (iType == 0) {
    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);
    }
  }
  else if (iType == 1) {
    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);
      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);
      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);
      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);
    }
  }
  else {
    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (sqlite3_mutex *)__mutex;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

pthread_mutex_t * FUN_0005a090(int param_1)

{
  pthread_mutex_t *__mutex;
  uint uVar1;
  uint uVar2;
  int in_GS_OFFSET;
  pthread_mutexattr_t local_14;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 == 0) {
    __mutex = (pthread_mutex_t *)FUN_00055780();
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);
    }
  }
  else if (param_1 == 1) {
    __mutex = (pthread_mutex_t *)FUN_00055780();
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutexattr_init(&local_14);
      pthread_mutexattr_settype(&local_14,1);
      pthread_mutex_init(__mutex,&local_14);
      pthread_mutexattr_destroy(&local_14);
    }
  }
  else {
    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return __mutex;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00153870();
}


PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000172e0
ADD EBX,0x160d90
SUB ESP,0x10
MOV EDI,dword ptr GS:[0x14]
MOV dword ptr [ESP + 0xc],EDI
XOR EDI,EDI
MOV EAX,dword ptr [ESP + 0x20]
TEST EAX,EAX
JZ 0x0005a150
CMP EAX,0x1
JNZ 0x0005a1a0
MOV EAX,0x18
XOR EDX,EDX
CALL 0x00055780
MOV ESI,EAX
TEST EAX,EAX
JZ 0x0005a130
LEA ECX,[EAX + 0x4]
MOV EDX,EAX
MOV dword ptr [EAX],0x0
AND ECX,0xfffffffc
MOV dword ptr [EAX + 0x14],0x0
XOR EAX,EAX
SUB EDX,ECX
ADD EDX,0x18
AND EDX,0xfffffffc
MOV dword ptr [ECX + EAX*0x1],EDI
ADD EAX,0x4
CMP EAX,EDX
JC 0x0005a0f4
SUB ESP,0xc
LEA EDI,[ESP + 0x14]
PUSH EDI
CALL 0x00015080
POP EAX
POP EDX
PUSH 0x1
PUSH EDI
CALL 0x00015680
POP ECX
POP EAX
PUSH EDI
PUSH ESI
CALL 0x00015160
MOV dword ptr [ESP],EDI
CALL 0x00015640
ADD ESP,0x10
LEA ESI,[ESI]
MOV ECX,dword ptr [ESP + 0xc]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x0005a1ad
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
MOV EAX,0x18
XOR EDX,EDX
CALL 0x00055780
MOV ESI,EAX
TEST EAX,EAX
JZ 0x0005a130
LEA ECX,[EAX + 0x4]
MOV EDX,EAX
MOV dword ptr [EAX],0x0
XOR EDI,EDI
AND ECX,0xfffffffc
MOV dword ptr [EAX + 0x14],0x0
XOR EAX,EAX
SUB EDX,ECX
ADD EDX,0x18
AND EDX,0xfffffffc
MOV dword ptr [ECX + EAX*0x1],EDI
ADD EAX,0x4
CMP EAX,EDX
JC 0x0005a183
SUB ESP,0x8
PUSH 0x0
PUSH ESI
CALL 0x00015160
ADD ESP,0x10
JMP 0x0005a130
LEA EAX,[EAX + EAX*0x2 + -0x6]
LEA ESI,[EBX + EAX*0x8 + 0x1bb8]
JMP 0x0005a130
CALL 0x00153870
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\npthread_mutex_t * FUN_0005a090(int param_1)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00153870();\n}\n\n" comment (function_definition "pthread_mutex_t * FUN_0005a090(int param_1)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00153870();\n}" type_identifier (pointer_declarator "* FUN_0005a090(int param_1)" * (function_declarator "FUN_0005a090(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) )))) (compound_statement "{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00153870();\n}" { (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pthread_mutexattr_t local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" identifier = (cast_expression "(pthread_mutex_t *)FUN_00055780()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00055780()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);" (call_expression "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0)" identifier (argument_list "(__mutex,(pthread_mutexattr_t *)0x0)" ( identifier , (cast_expression "(pthread_mutexattr_t *)0x0" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) })) }) (else_clause "else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" else (if_statement "if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" if (parenthesized_expression "(param_1 == 1)" ( (binary_expression "param_1 == 1" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" identifier = (cast_expression "(pthread_mutex_t *)FUN_00055780()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00055780()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutexattr_init(&local_14);" (call_expression "pthread_mutexattr_init(&local_14)" identifier (argument_list "(&local_14)" ( (pointer_expression "&local_14" & identifier) ))) ;) (expression_statement "pthread_mutexattr_settype(&local_14,1);" (call_expression "pthread_mutexattr_settype(&local_14,1)" identifier (argument_list "(&local_14,1)" ( (pointer_expression "&local_14" & identifier) , number_literal ))) ;) (expression_statement "pthread_mutex_init(__mutex,&local_14);" (call_expression "pthread_mutex_init(__mutex,&local_14)" identifier (argument_list "(__mutex,&local_14)" ( identifier , (pointer_expression "&local_14" & identifier) ))) ;) (expression_statement "pthread_mutexattr_destroy(&local_14);" (call_expression "pthread_mutexattr_destroy(&local_14)" identifier (argument_list "(&local_14)" ( (pointer_expression "&local_14" & identifier) ))) ;) })) }) (else_clause "else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" else (compound_statement "{\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);" (assignment_expression "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" identifier = (cast_expression "(pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((param_1 * 3 + -6) * 8 + 0x1bc9e0)" ( (binary_expression "(param_1 * 3 + -6) * 8 + 0x1bc9e0" (binary_expression "(param_1 * 3 + -6) * 8" (parenthesized_expression "(param_1 * 3 + -6)" ( (binary_expression "param_1 * 3 + -6" (binary_expression "param_1 * 3" identifier * number_literal) + number_literal) )) * number_literal) + number_literal) )))) ;) }))))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return __mutex;\n  }" { (return_statement "return __mutex;" return identifier ;) })) comment (expression_statement "FUN_00153870();" (call_expression "FUN_00153870()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsqlite3_mutex * pthreadMutexAlloc(int iType)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  u64 in_stack_ffffffe4;\n  pthread_mutexattr_t recursiveAttr;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (iType == 0) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (sqlite3_mutex *)__mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "sqlite3_mutex * pthreadMutexAlloc(int iType)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  u64 in_stack_ffffffe4;\n  pthread_mutexattr_t recursiveAttr;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (iType == 0) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (sqlite3_mutex *)__mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" type_identifier (pointer_declarator "* pthreadMutexAlloc(int iType)" * (function_declarator "pthreadMutexAlloc(int iType)" identifier (parameter_list "(int iType)" ( (parameter_declaration "int iType" primitive_type identifier) )))) (compound_statement "{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  u64 in_stack_ffffffe4;\n  pthread_mutexattr_t recursiveAttr;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (iType == 0) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (sqlite3_mutex *)__mutex;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "u64 in_stack_ffffffe4;" type_identifier identifier ;) (declaration "pthread_mutexattr_t recursiveAttr;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (iType == 0) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }" if (parenthesized_expression "(iType == 0)" ( (binary_expression "iType == 0" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);" (assignment_expression "__mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4)" identifier = (cast_expression "(pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4)" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3Malloc(in_stack_ffffffe4)" identifier (argument_list "(in_stack_ffffffe4)" ( identifier ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);" (call_expression "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0)" identifier (argument_list "(__mutex,(pthread_mutexattr_t *)0x0)" ( identifier , (cast_expression "(pthread_mutexattr_t *)0x0" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) })) }) (else_clause "else if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }" else (if_statement "if (iType == 1) {\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }" if (parenthesized_expression "(iType == 1)" ( (binary_expression "iType == 1" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4);" (assignment_expression "__mutex = (pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4)" identifier = (cast_expression "(pthread_mutex_t *)sqlite3Malloc(in_stack_ffffffe4)" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3Malloc(in_stack_ffffffe4)" identifier (argument_list "(in_stack_ffffffe4)" ( identifier ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);\n      pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr);" (call_expression "pthread_mutexattr_init((pthread_mutexattr_t *)&recursiveAttr)" identifier (argument_list "((pthread_mutexattr_t *)&recursiveAttr)" ( (cast_expression "(pthread_mutexattr_t *)&recursiveAttr" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&recursiveAttr" & identifier)) ))) ;) (expression_statement "pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1);" (call_expression "pthread_mutexattr_settype((pthread_mutexattr_t *)&recursiveAttr,1)" identifier (argument_list "((pthread_mutexattr_t *)&recursiveAttr,1)" ( (cast_expression "(pthread_mutexattr_t *)&recursiveAttr" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&recursiveAttr" & identifier)) , number_literal ))) ;) (expression_statement "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr);" (call_expression "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)&recursiveAttr)" identifier (argument_list "(__mutex,(pthread_mutexattr_t *)&recursiveAttr)" ( identifier , (cast_expression "(pthread_mutexattr_t *)&recursiveAttr" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&recursiveAttr" & identifier)) ))) ;) (expression_statement "pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr);" (call_expression "pthread_mutexattr_destroy((pthread_mutexattr_t *)&recursiveAttr)" identifier (argument_list "((pthread_mutexattr_t *)&recursiveAttr)" ( (cast_expression "(pthread_mutexattr_t *)&recursiveAttr" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&recursiveAttr" & identifier)) ))) ;) })) }) (else_clause "else {\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }" else (compound_statement "{\n    __mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8);" (assignment_expression "__mutex = (pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8)" identifier = (cast_expression "(pthread_mutex_t *)(staticMutexes_10765 + (iType * 3 + -6) * 8)" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(staticMutexes_10765 + (iType * 3 + -6) * 8)" ( (binary_expression "staticMutexes_10765 + (iType * 3 + -6) * 8" identifier + (binary_expression "(iType * 3 + -6) * 8" (parenthesized_expression "(iType * 3 + -6)" ( (binary_expression "iType * 3 + -6" (binary_expression "iType * 3" identifier * number_literal) + number_literal) )) * number_literal)) )))) ;) }))))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (sqlite3_mutex *)__mutex;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return (sqlite3_mutex *)__mutex;\n  }" { (return_statement "return (sqlite3_mutex *)__mutex;" return (cast_expression "(sqlite3_mutex *)__mutex" ( (type_descriptor "sqlite3_mutex *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "pthread_mutex_t * FUN_0005a090(int param_1)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    \n  FUN_00153870();\n}\n\n" (function_definition "pthread_mutex_t * FUN_0005a090(int param_1)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    \n  FUN_00153870();\n}" type_identifier (pointer_declarator "* FUN_0005a090(int param_1)" * (function_declarator "FUN_0005a090(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) )))) (compound_statement "{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    \n  FUN_00153870();\n}" { (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pthread_mutexattr_t local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" identifier = (cast_expression "(pthread_mutex_t *)FUN_00055780()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00055780()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);" (call_expression "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0)" identifier (argument_list "(__mutex,(pthread_mutexattr_t *)0x0)" ( identifier , (cast_expression "(pthread_mutexattr_t *)0x0" ( (type_descriptor "pthread_mutexattr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) })) }) (else_clause "else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" else (if_statement "if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" if (parenthesized_expression "(param_1 == 1)" ( (binary_expression "param_1 == 1" identifier == number_literal) )) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" identifier = (cast_expression "(pthread_mutex_t *)FUN_00055780()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00055780()" identifier (argument_list "()" ( ))))) ;) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" if (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" ( (binary_expression "__mutex != (pthread_mutex_t *)0x0" identifier != (cast_expression "(pthread_mutex_t *)0x0" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" { (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" identifier = (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" ( identifier )) & (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier)) & number_literal)) ;) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" ( (field_expression "__mutex->__data" identifier -> field_identifier) )) . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" do (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" { (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" * (cast_expression "(undefined4 *)(uVar2 + uVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(uVar2 + uVar1)" ( (binary_expression "uVar2 + uVar1" identifier + identifier) )))) = number_literal) ;) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" identifier = (binary_expression "uVar1 + 4" identifier + number_literal)) ;) }) while (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" ( (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" identifier < (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" ( (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(0x18 - uVar2)" ( (binary_expression "0x18 - uVar2" number_literal - identifier) ))) & number_literal) ))) )) ;) (expression_statement "pthread_mutexattr_init(&local_14);" (call_expression "pthread_mutexattr_init(&local_14)" identifier (argument_list "(&local_14)" ( (pointer_expression "&local_14" & identifier) ))) ;) (expression_statement "pthread_mutexattr_settype(&local_14,1);" (call_expression "pthread_mutexattr_settype(&local_14,1)" identifier (argument_list "(&local_14,1)" ( (pointer_expression "&local_14" & identifier) , number_literal ))) ;) (expression_statement "pthread_mutex_init(__mutex,&local_14);" (call_expression "pthread_mutex_init(__mutex,&local_14)" identifier (argument_list "(__mutex,&local_14)" ( identifier , (pointer_expression "&local_14" & identifier) ))) ;) (expression_statement "pthread_mutexattr_destroy(&local_14);" (call_expression "pthread_mutexattr_destroy(&local_14)" identifier (argument_list "(&local_14)" ( (pointer_expression "&local_14" & identifier) ))) ;) })) }) (else_clause "else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" else (compound_statement "{\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" { (expression_statement "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);" (assignment_expression "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" identifier = (cast_expression "(pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((param_1 * 3 + -6) * 8 + 0x1bc9e0)" ( (binary_expression "(param_1 * 3 + -6) * 8 + 0x1bc9e0" (binary_expression "(param_1 * 3 + -6) * 8" (parenthesized_expression "(param_1 * 3 + -6)" ( (binary_expression "param_1 * 3 + -6" (binary_expression "param_1 * 3" identifier * number_literal) + number_literal) )) * number_literal) + number_literal) )))) ;) }))))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return __mutex;\n  }" { (return_statement "return __mutex;" return identifier ;) })) (expression_statement "FUN_00153870();" (call_expression "FUN_00153870()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (parenthesized_expression ( IDENT )) & (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier)) & LIT)) ;) (expression_statement (assignment_expression (field_expression (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - IDENT) ))) & LIT) ))) )) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ))) ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (parenthesized_expression ( IDENT )) & (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier)) & LIT)) ;) (expression_statement (assignment_expression (field_expression (field_expression (parenthesized_expression ( (field_expression IDENT -> field_identifier) )) . field_identifier) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - IDENT) ))) & LIT) ))) )) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) ))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , LIT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) ))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) ))) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT * LIT) + LIT) )) * LIT) + LIT) )))) ;) }))))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "pthread_mutex_t * FUN_0005a090(int param_1)\n\n{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    \n  FUN_00153870();\n}" (type_identifier "pthread_mutex_t") (pointer_declarator "* FUN_0005a090(int param_1)" (* "*") (function_declarator "FUN_0005a090(int param_1)" (identifier "FUN_0005a090") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")")))) (compound_statement "{\n  pthread_mutex_t *__mutex;\n  uint uVar1;\n  uint uVar2;\n  int in_GS_OFFSET;\n  pthread_mutexattr_t local_14;\n  int local_10;\n  \n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }\n                    \n  FUN_00153870();\n}" ({ "{") (declaration "pthread_mutex_t *__mutex;" (type_identifier "pthread_mutex_t") (pointer_declarator "*__mutex" (* "*") (identifier "__mutex")) (; ";")) (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "pthread_mutexattr_t local_14;" (type_identifier "pthread_mutexattr_t") (identifier "local_14") (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (param_1 == 0) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }\n  else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }\n  }" ({ "{") (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" (identifier "__mutex") (= "=") (cast_expression "(pthread_mutex_t *)FUN_00055780()" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00055780()" (identifier "FUN_00055780") (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" (if "if") (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" (( "(") (binary_expression "__mutex != (pthread_mutex_t *)0x0" (identifier "__mutex") (!= "!=") (cast_expression "(pthread_mutex_t *)0x0" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);\n    }" ({ "{") (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "__lock")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" (identifier "uVar2") (= "=") (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (& "&") (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "__count"))) (& "&") (number_literal "0xfffffffc"))) (; ";")) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "field5_0x14")) (. ".") (field_identifier "__spins")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" (do "do") (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" ({ "{") (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" (* "*") (cast_expression "(undefined4 *)(uVar2 + uVar1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar2 + uVar1)" (( "(") (binary_expression "uVar2 + uVar1" (identifier "uVar2") (+ "+") (identifier "uVar1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" (identifier "uVar1") (= "=") (binary_expression "uVar1 + 4" (identifier "uVar1") (+ "+") (number_literal "4"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" (( "(") (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" (identifier "uVar1") (< "<") (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" (( "(") (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__mutex")) (+ "+") (parenthesized_expression "(0x18 - uVar2)" (( "(") (binary_expression "0x18 - uVar2" (number_literal "0x18") (- "-") (identifier "uVar2")) () ")"))) (& "&") (number_literal "0xfffffffc")) () ")"))) () ")")) (; ";")) (expression_statement "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);" (call_expression "pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0)" (identifier "pthread_mutex_init") (argument_list "(__mutex,(pthread_mutexattr_t *)0x0)" (( "(") (identifier "__mutex") (, ",") (cast_expression "(pthread_mutexattr_t *)0x0" (( "(") (type_descriptor "pthread_mutexattr_t *" (type_identifier "pthread_mutexattr_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" (else "else") (if_statement "if (param_1 == 1) {\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }\n  else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" (if "if") (parenthesized_expression "(param_1 == 1)" (( "(") (binary_expression "param_1 == 1" (identifier "param_1") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    __mutex = (pthread_mutex_t *)FUN_00055780();\n    if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }\n  }" ({ "{") (expression_statement "__mutex = (pthread_mutex_t *)FUN_00055780();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_00055780()" (identifier "__mutex") (= "=") (cast_expression "(pthread_mutex_t *)FUN_00055780()" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00055780()" (identifier "FUN_00055780") (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if (__mutex != (pthread_mutex_t *)0x0) {\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" (if "if") (parenthesized_expression "(__mutex != (pthread_mutex_t *)0x0)" (( "(") (binary_expression "__mutex != (pthread_mutex_t *)0x0" (identifier "__mutex") (!= "!=") (cast_expression "(pthread_mutex_t *)0x0" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      (__mutex->__data).__lock = 0;\n      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;\n      (__mutex->__data).field5_0x14.__spins = 0;\n      uVar1 = 0;\n      do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));\n      pthread_mutexattr_init(&local_14);\n      pthread_mutexattr_settype(&local_14,1);\n      pthread_mutex_init(__mutex,&local_14);\n      pthread_mutexattr_destroy(&local_14);\n    }" ({ "{") (expression_statement "(__mutex->__data).__lock = 0;" (assignment_expression "(__mutex->__data).__lock = 0" (field_expression "(__mutex->__data).__lock" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "__lock")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;" (assignment_expression "uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc" (identifier "uVar2") (= "=") (binary_expression "(uint)&(__mutex->__data).__count & 0xfffffffc" (binary_expression "(uint)&(__mutex->__data).__count" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (& "&") (field_expression "(__mutex->__data).__count" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "__count"))) (& "&") (number_literal "0xfffffffc"))) (; ";")) (expression_statement "(__mutex->__data).field5_0x14.__spins = 0;" (assignment_expression "(__mutex->__data).field5_0x14.__spins = 0" (field_expression "(__mutex->__data).field5_0x14.__spins" (field_expression "(__mutex->__data).field5_0x14" (parenthesized_expression "(__mutex->__data)" (( "(") (field_expression "__mutex->__data" (identifier "__mutex") (-> "->") (field_identifier "__data")) () ")")) (. ".") (field_identifier "field5_0x14")) (. ".") (field_identifier "__spins")) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));" (do "do") (compound_statement "{\n        *(undefined4 *)(uVar2 + uVar1) = 0;\n        uVar1 = uVar1 + 4;\n      }" ({ "{") (expression_statement "*(undefined4 *)(uVar2 + uVar1) = 0;" (assignment_expression "*(undefined4 *)(uVar2 + uVar1) = 0" (pointer_expression "*(undefined4 *)(uVar2 + uVar1)" (* "*") (cast_expression "(undefined4 *)(uVar2 + uVar1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(uVar2 + uVar1)" (( "(") (binary_expression "uVar2 + uVar1" (identifier "uVar2") (+ "+") (identifier "uVar1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar1 = uVar1 + 4;" (assignment_expression "uVar1 = uVar1 + 4" (identifier "uVar1") (= "=") (binary_expression "uVar1 + 4" (identifier "uVar1") (+ "+") (number_literal "4"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc))" (( "(") (binary_expression "uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" (identifier "uVar1") (< "<") (parenthesized_expression "((int)__mutex + (0x18 - uVar2) & 0xfffffffc)" (( "(") (binary_expression "(int)__mutex + (0x18 - uVar2) & 0xfffffffc" (binary_expression "(int)__mutex + (0x18 - uVar2)" (cast_expression "(int)__mutex" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__mutex")) (+ "+") (parenthesized_expression "(0x18 - uVar2)" (( "(") (binary_expression "0x18 - uVar2" (number_literal "0x18") (- "-") (identifier "uVar2")) () ")"))) (& "&") (number_literal "0xfffffffc")) () ")"))) () ")")) (; ";")) (expression_statement "pthread_mutexattr_init(&local_14);" (call_expression "pthread_mutexattr_init(&local_14)" (identifier "pthread_mutexattr_init") (argument_list "(&local_14)" (( "(") (pointer_expression "&local_14" (& "&") (identifier "local_14")) () ")"))) (; ";")) (expression_statement "pthread_mutexattr_settype(&local_14,1);" (call_expression "pthread_mutexattr_settype(&local_14,1)" (identifier "pthread_mutexattr_settype") (argument_list "(&local_14,1)" (( "(") (pointer_expression "&local_14" (& "&") (identifier "local_14")) (, ",") (number_literal "1") () ")"))) (; ";")) (expression_statement "pthread_mutex_init(__mutex,&local_14);" (call_expression "pthread_mutex_init(__mutex,&local_14)" (identifier "pthread_mutex_init") (argument_list "(__mutex,&local_14)" (( "(") (identifier "__mutex") (, ",") (pointer_expression "&local_14" (& "&") (identifier "local_14")) () ")"))) (; ";")) (expression_statement "pthread_mutexattr_destroy(&local_14);" (call_expression "pthread_mutexattr_destroy(&local_14)" (identifier "pthread_mutexattr_destroy") (argument_list "(&local_14)" (( "(") (pointer_expression "&local_14" (& "&") (identifier "local_14")) () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" (else "else") (compound_statement "{\n    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);\n  }" ({ "{") (expression_statement "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);" (assignment_expression "__mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" (identifier "__mutex") (= "=") (cast_expression "(pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0)" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((param_1 * 3 + -6) * 8 + 0x1bc9e0)" (( "(") (binary_expression "(param_1 * 3 + -6) * 8 + 0x1bc9e0" (binary_expression "(param_1 * 3 + -6) * 8" (parenthesized_expression "(param_1 * 3 + -6)" (( "(") (binary_expression "param_1 * 3 + -6" (binary_expression "param_1 * 3" (identifier "param_1") (* "*") (number_literal "3")) (+ "+") (number_literal "-6")) () ")")) (* "*") (number_literal "8")) (+ "+") (number_literal "0x1bc9e0")) () ")")))) (; ";")) (} "}")))))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return __mutex;\n  }" (if "if") (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return __mutex;\n  }" ({ "{") (return_statement "return __mutex;" (return "return") (identifier "__mutex") (; ";")) (} "}"))) (expression_statement "FUN_00153870();" (call_expression "FUN_00153870()" (identifier "FUN_00153870") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

type_1 * function_1(int var_2)

{
  type_2 *var_4;
  type_3 var_6;
  type_3 var_5;
  int var_1;
  type_4 in_stack_ffffffe4;
  type_5 recursiveAttr;
  int var_12;
  
  var_12 = *(int *)(var_1 + 0x14);
  if (var_2 == 0) {
    var_4 = (type_2 *)var_3(in_stack_ffffffe4);
    if (var_4 != (type_2 *)0x0) {
      (var_4->__data).__lock = 0;
      var_5 = (type_3)&(var_4->__data).__count & 0xfffffffc;
      (var_4->__data).field5_0x14.__spins = 0;
      var_6 = 0;
      do {
        *(type_6 *)(var_5 + var_6) = 0;
        var_6 = var_6 + 4;
      } while (var_6 < ((int)var_4 + (0x18 - var_5) & 0xfffffffc));
      var_7(var_4,(type_5 *)0x0);
    }
  }
  else if (var_2 == 1) {
    var_4 = (type_2 *)var_3(in_stack_ffffffe4);
    if (var_4 != (type_2 *)0x0) {
      (var_4->__data).__lock = 0;
      var_5 = (type_3)&(var_4->__data).__count & 0xfffffffc;
      (var_4->__data).field5_0x14.__spins = 0;
      var_6 = 0;
      do {
        *(type_6 *)(var_5 + var_6) = 0;
        var_6 = var_6 + 4;
      } while (var_6 < ((int)var_4 + (0x18 - var_5) & 0xfffffffc));
      var_8((type_5 *)&recursiveAttr);
      var_9((type_5 *)&recursiveAttr,1);
      var_7(var_4,(type_5 *)&recursiveAttr);
      var_10((type_5 *)&recursiveAttr);
    }
  }
  else {
    var_4 = (type_2 *)(var_11 + (var_2 * 3 + -6) * 8);
  }
  if (var_12 == *(int *)(var_1 + 0x14)) {
    return (type_1 *)var_4;
  }
                    /* WARNING: Subroutine does not return */
  var_13();
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier))) right: (number_literal)))) (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier)) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier)))) right: (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier))) right: (number_literal)))) (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (parenthesized_expression (field_expression argument: (identifier) field: (field_identifier))) field: (field_identifier)) field: (field_identifier)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier)))) right: (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) right: (number_literal)) right: (number_literal))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

pthread_mutex_t * MASKED(int param_1)

{
  pthread_mutex_t *__mutex;
  uint uVar1;
  uint uVar2;
  int in_GS_OFFSET;
  pthread_mutexattr_t local_14;
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 == 0) {
    __mutex = (pthread_mutex_t *)FUN_00055780();
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutex_init(__mutex,(pthread_mutexattr_t *)0x0);
    }
  }
  else if (param_1 == 1) {
    __mutex = (pthread_mutex_t *)FUN_00055780();
    if (__mutex != (pthread_mutex_t *)0x0) {
      (__mutex->__data).__lock = 0;
      uVar2 = (uint)&(__mutex->__data).__count & 0xfffffffc;
      (__mutex->__data).field5_0x14.__spins = 0;
      uVar1 = 0;
      do {
        *(undefined4 *)(uVar2 + uVar1) = 0;
        uVar1 = uVar1 + 4;
      } while (uVar1 < ((int)__mutex + (0x18 - uVar2) & 0xfffffffc));
      pthread_mutexattr_init(&local_14);
      pthread_mutexattr_settype(&local_14,1);
      pthread_mutex_init(__mutex,&local_14);
      pthread_mutexattr_destroy(&local_14);
    }
  }
  else {
    __mutex = (pthread_mutex_t *)((param_1 * 3 + -6) * 8 + 0x1bc9e0);
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return __mutex;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00153870();
}

