
/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */
/* std::Catalogs::_M_add(char const*, std::locale) */

int __thiscall std::Catalogs::_M_add(Catalogs *this,char *param_1,locale *param_3)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  char *pcVar4;
  int iVar5;
  undefined4 *puVar6;
  int *local_20 [4];
  
  puVar1 = PTR___pthread_key_create_00413ff8;
  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {
    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);
    if (iVar2 != 0) {
      __throw_concurrence_lock_error();
                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */
      iVar2 = _M_add();
      return iVar2;
    }
  }
  iVar2 = *(int *)(this + 0x18);
  if (iVar2 == 0x7fffffff) {
    iVar2 = -1;
  }
  else {
    *(int *)(this + 0x18) = iVar2 + 1;
    locale::locale((locale *)local_20,param_3);
                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */
    piVar3 = (int *)operator_new(0xc);
    *piVar3 = iVar2;
    pcVar4 = strdup(param_1);
    piVar3[1] = (int)pcVar4;
    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);
    locale::~locale((locale *)local_20);
    if (piVar3[1] == 0) {
      locale::~locale((locale *)(piVar3 + 2));
      iVar2 = -1;
      operator_delete(piVar3);
    }
    else {
      puVar6 = *(undefined4 **)(this + 0x20);
      local_20[0] = piVar3;
      if (puVar6 == *(undefined4 **)(this + 0x24)) {
                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */
        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert
                  (this + 0x1c,puVar6,(locale *)local_20);
      }
      else {
        *puVar6 = piVar3;
        *(undefined4 **)(this + 0x20) = puVar6 + 1;
      }
      iVar2 = *piVar3;
    }
  }
  if (puVar1 != (undefined *)0x0) {
    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);
    if (iVar5 != 0) {
      puVar6 = (undefined4 *)__cxa_allocate_exception(4);
      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */
      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);
    }
  }
  return iVar2;
}



/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  char *pcVar4;
  int iVar5;
  undefined4 *puVar6;
  int *local_20 [4];
  
  puVar1 = PTR___pthread_key_create_00413ff8;
  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {
    iVar2 = pthread_mutex_lock(param_1);
    if (iVar2 != 0) {
      FUN_00247d10();
                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */
      iVar2 = FUN_00037a66();
      return iVar2;
    }
  }
  iVar2 = param_1[1].__data.__lock;
  if (iVar2 == 0x7fffffff) {
    iVar2 = -1;
  }
  else {
    param_1[1].__data.__lock = iVar2 + 1;
    FUN_0024a1b0(local_20,param_3);
                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */
    piVar3 = (int *)FUN_00246670(0xc);
    *piVar3 = iVar2;
    pcVar4 = strdup(param_2);
    piVar3[1] = (int)pcVar4;
    FUN_0024a1b0(piVar3 + 2,local_20);
    FUN_0024a980(local_20);
    if (piVar3[1] == 0) {
      FUN_0024a980(piVar3 + 2);
      iVar2 = -1;
      FUN_00248220(piVar3);
    }
    else {
      puVar6 = *(undefined4 **)((int)param_1 + 0x20);
      local_20[0] = piVar3;
      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {
                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */
        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);
      }
      else {
        *puVar6 = piVar3;
        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;
      }
      iVar2 = *piVar3;
    }
  }
  if (puVar1 != (undefined *)0x0) {
    iVar5 = pthread_mutex_unlock(param_1);
    if (iVar5 != 0) {
      puVar6 = (undefined4 *)FUN_00248050(4);
      *puVar6 = &DAT_00410fbc;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */
      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);
    }
  }
  return iVar2;
}


PUSH EBP
MOV EBP,ESP
PUSH EDI
PUSH ESI
CALL 0x0004d336
ADD ESI,0x183376
PUSH EBX
SUB ESP,0x2c
MOV EAX,dword ptr [EBP + 0x8]
MOV dword ptr [EBP + -0x20],EAX
MOV EAX,dword ptr [ESI + 0xfffffff8]
MOV dword ptr [EBP + -0x30],EAX
TEST EAX,EAX
JZ 0x00290cbf
SUB ESP,0xc
PUSH dword ptr [EBP + 0x8]
MOV EBX,ESI
CALL 0x0002c6b0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00290de1
MOV EAX,dword ptr [EBP + 0x8]
MOV EAX,dword ptr [EAX + 0x18]
CMP EAX,0x7fffffff
JZ 0x00290db0
MOV EDX,dword ptr [EBP + 0x8]
MOV dword ptr [EBP + -0x34],EAX
ADD EAX,0x1
SUB ESP,0x8
MOV EBX,ESI
MOV dword ptr [EDX + 0x18],EAX
LEA EAX,[EBP + -0x1c]
PUSH dword ptr [EBP + 0x10]
PUSH EAX
MOV dword ptr [EBP + -0x2c],EAX
CALL 0x0024a1b0
MOV dword ptr [ESP],0xc
CALL 0x00246670
POP ECX
MOV ECX,dword ptr [EBP + -0x34]
MOV EDI,EAX
MOV dword ptr [EAX],ECX
PUSH dword ptr [EBP + 0xc]
CALL 0x0002c1a0
LEA EDX,[EDI + 0x8]
MOV dword ptr [EDI + 0x4],EAX
POP EAX
POP ECX
PUSH dword ptr [EBP + -0x2c]
PUSH EDX
MOV dword ptr [EBP + -0x34],EDX
CALL 0x0024a1b0
POP EAX
PUSH dword ptr [EBP + -0x2c]
CALL 0x0024a980
MOV EAX,dword ptr [EDI + 0x4]
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00290d78
MOV EAX,dword ptr [EBP + 0x8]
MOV ECX,dword ptr [EBP + 0x8]
MOV dword ptr [EBP + -0x1c],EDI
MOV EAX,dword ptr [EAX + 0x20]
CMP EAX,dword ptr [ECX + 0x24]
JZ 0x00290d98
MOV dword ptr [EAX],EDI
ADD EAX,0x4
MOV dword ptr [ECX + 0x20],EAX
MOV EDI,dword ptr [EDI]
MOV EDX,dword ptr [EBP + -0x30]
TEST EDX,EDX
JZ 0x00290d69
SUB ESP,0xc
PUSH dword ptr [EBP + -0x20]
MOV EBX,ESI
CALL 0x0002c5e0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00290db7
LEA ESP,[EBP + -0xc]
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH dword ptr [EBP + -0x34]
CALL 0x0024a980
MOV dword ptr [ESP],EDI
MOV EDI,0xffffffff
CALL 0x00248220
ADD ESP,0x10
JMP 0x00290d4e
SUB ESP,0x4
PUSH dword ptr [EBP + -0x2c]
PUSH EAX
MOV EAX,dword ptr [EBP + 0x8]
ADD EAX,0x1c
PUSH EAX
CALL 0x00290b30
ADD ESP,0x10
JMP 0x00290d4c
MOV EDI,0xffffffff
JMP 0x00290d4e
SUB ESP,0xc
PUSH 0x4
CALL 0x00248050
LEA EDX,[ESI + 0xffffcfb4]
ADD ESP,0xc
ADD EDX,0x8
MOV dword ptr [EAX],EDX
PUSH dword ptr [ESI + 0xfffffbf0]
PUSH dword ptr [ESI + 0xfffffe60]
PUSH EAX
CALL 0x00246aa0
CALL 0x00247d10
JMP 0x00037a66
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nint FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}\n\n" comment (function_definition "int FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" identifier (parameter_list "(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" ( (parameter_declaration "pthread_mutex_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int *local_20 [4];" primitive_type (pointer_declarator "*local_20 [4]" * (array_declarator "local_20 [4]" identifier [ number_literal ])) ;) (expression_statement "puVar1 = PTR___pthread_key_create_00413ff8;" (assignment_expression "puVar1 = PTR___pthread_key_create_00413ff8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_00413ff8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_00413ff8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = pthread_mutex_lock(param_1);" (assignment_expression "iVar2 = pthread_mutex_lock(param_1)" identifier = (call_expression "pthread_mutex_lock(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 != 0) {\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00247d10();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" { (expression_statement "FUN_00247d10();" (call_expression "FUN_00247d10()" identifier (argument_list "()" ( ))) ;) comment (expression_statement "iVar2 = FUN_00037a66();" (assignment_expression "iVar2 = FUN_00037a66()" identifier = (call_expression "FUN_00037a66()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) (expression_statement "iVar2 = param_1[1].__data.__lock;" (assignment_expression "iVar2 = param_1[1].__data.__lock" identifier = (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" identifier [ number_literal ]) . field_identifier) . field_identifier)) ;) (if_statement "if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" if (parenthesized_expression "(iVar2 == 0x7fffffff)" ( (binary_expression "iVar2 == 0x7fffffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = -1;\n  }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" else (compound_statement "{\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" { (expression_statement "param_1[1].__data.__lock = iVar2 + 1;" (assignment_expression "param_1[1].__data.__lock = iVar2 + 1" (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" identifier [ number_literal ]) . field_identifier) . field_identifier) = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "FUN_0024a1b0(local_20,param_3);" (call_expression "FUN_0024a1b0(local_20,param_3)" identifier (argument_list "(local_20,param_3)" ( identifier , identifier ))) ;) comment (expression_statement "piVar3 = (int *)FUN_00246670(0xc);" (assignment_expression "piVar3 = (int *)FUN_00246670(0xc)" identifier = (cast_expression "(int *)FUN_00246670(0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00246670(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "pcVar4 = strdup(param_2);" (assignment_expression "pcVar4 = strdup(param_2)" identifier = (call_expression "strdup(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "piVar3[1] = (int)pcVar4;" (assignment_expression "piVar3[1] = (int)pcVar4" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = (cast_expression "(int)pcVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "FUN_0024a1b0(piVar3 + 2,local_20);" (call_expression "FUN_0024a1b0(piVar3 + 2,local_20)" identifier (argument_list "(piVar3 + 2,local_20)" ( (binary_expression "piVar3 + 2" identifier + number_literal) , identifier ))) ;) (expression_statement "FUN_0024a980(local_20);" (call_expression "FUN_0024a980(local_20)" identifier (argument_list "(local_20)" ( identifier ))) ;) (if_statement "if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" if (parenthesized_expression "(piVar3[1] == 0)" ( (binary_expression "piVar3[1] == 0" (subscript_expression "piVar3[1]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }" { (expression_statement "FUN_0024a980(piVar3 + 2);" (call_expression "FUN_0024a980(piVar3 + 2)" identifier (argument_list "(piVar3 + 2)" ( (binary_expression "piVar3 + 2" identifier + number_literal) ))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "FUN_00248220(piVar3);" (call_expression "FUN_00248220(piVar3)" identifier (argument_list "(piVar3)" ( identifier ))) ;) }) (else_clause "else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" else (compound_statement "{\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" { (expression_statement "puVar6 = *(undefined4 **)((int)param_1 + 0x20);" (assignment_expression "puVar6 = *(undefined4 **)((int)param_1 + 0x20)" identifier = (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" * (cast_expression "(undefined4 **)((int)param_1 + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x20)" ( (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "local_20[0] = piVar3;" (assignment_expression "local_20[0] = piVar3" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" if (parenthesized_expression "(puVar6 == *(undefined4 **)((int)param_1 + 0x24))" ( (binary_expression "puVar6 == *(undefined4 **)((int)param_1 + 0x24)" identifier == (pointer_expression "*(undefined4 **)((int)param_1 + 0x24)" * (cast_expression "(undefined4 **)((int)param_1 + 0x24)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x24)" ( (binary_expression "(int)param_1 + 0x24" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) )) (compound_statement "{\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }" { comment (expression_statement "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);" (call_expression "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20)" identifier (argument_list "((int)param_1 + 0x1c,puVar6,local_20)" ( (binary_expression "(int)param_1 + 0x1c" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) , identifier , identifier ))) ;) }) (else_clause "else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" else (compound_statement "{\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" { (expression_statement "*puVar6 = piVar3;" (assignment_expression "*puVar6 = piVar3" (pointer_expression "*puVar6" * identifier) = identifier) ;) (expression_statement "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;" (assignment_expression "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1" (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" * (cast_expression "(undefined4 **)((int)param_1 + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x20)" ( (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = (binary_expression "puVar6 + 1" identifier + number_literal)) ;) }))) (expression_statement "iVar2 = *piVar3;" (assignment_expression "iVar2 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) }))) }))) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" if (parenthesized_expression "(puVar1 != (undefined *)0x0)" ( (binary_expression "puVar1 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" { (expression_statement "iVar5 = pthread_mutex_unlock(param_1);" (assignment_expression "iVar5 = pthread_mutex_unlock(param_1)" identifier = (call_expression "pthread_mutex_unlock(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" { (expression_statement "puVar6 = (undefined4 *)FUN_00248050(4);" (assignment_expression "puVar6 = (undefined4 *)FUN_00248050(4)" identifier = (cast_expression "(undefined4 *)FUN_00248050(4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00248050(4)" identifier (argument_list "(4)" ( number_literal ))))) ;) (expression_statement "*puVar6 = &DAT_00410fbc;" (assignment_expression "*puVar6 = &DAT_00410fbc" (pointer_expression "*puVar6" * identifier) = (pointer_expression "&DAT_00410fbc" & identifier)) ;) comment comment (expression_statement "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);" (call_expression "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" identifier (argument_list "(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" ( identifier , identifier , identifier ))) ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n/* std::Catalogs::_M_add(char const*, std::locale) */\n\nint __thiscall std::Catalogs::_M_add(Catalogs *this,char *param_1,locale *param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);\n    if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }\n  }\n  iVar2 = *(int *)(this + 0x18);\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }\n  }\n  return iVar2;\n}\n\n" comment comment (function_definition "int __thiscall std::Catalogs::_M_add(Catalogs *this,char *param_1,locale *param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);\n    if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }\n  }\n  iVar2 = *(int *)(this + 0x18);\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }\n  }\n  return iVar2;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::Catalogs::" identifier : : identifier : :) (function_declarator "_M_add(Catalogs *this,char *param_1,locale *param_3)" identifier (parameter_list "(Catalogs *this,char *param_1,locale *param_3)" ( (parameter_declaration "Catalogs *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "locale *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);\n    if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }\n  }\n  iVar2 = *(int *)(this + 0x18);\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }\n  }\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int *local_20 [4];" primitive_type (pointer_declarator "*local_20 [4]" * (array_declarator "local_20 [4]" identifier [ number_literal ])) ;) (expression_statement "puVar1 = PTR___pthread_key_create_00413ff8;" (assignment_expression "puVar1 = PTR___pthread_key_create_00413ff8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);\n    if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_00413ff8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_00413ff8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);\n    if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = pthread_mutex_lock((pthread_mutex_t *)this);" (assignment_expression "iVar2 = pthread_mutex_lock((pthread_mutex_t *)this)" identifier = (call_expression "pthread_mutex_lock((pthread_mutex_t *)this)" identifier (argument_list "((pthread_mutex_t *)this)" ( (cast_expression "(pthread_mutex_t *)this" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar2 != 0) {\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __throw_concurrence_lock_error();\n                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */\n      iVar2 = _M_add();\n      return iVar2;\n    }" { (expression_statement "__throw_concurrence_lock_error();" (call_expression "__throw_concurrence_lock_error()" identifier (argument_list "()" ( ))) ;) comment (expression_statement "iVar2 = _M_add();" (assignment_expression "iVar2 = _M_add()" identifier = (call_expression "_M_add()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) (expression_statement "iVar2 = *(int *)(this + 0x18);" (assignment_expression "iVar2 = *(int *)(this + 0x18)" identifier = (pointer_expression "*(int *)(this + 0x18)" * (cast_expression "(int *)(this + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) ))))) ;) (if_statement "if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" if (parenthesized_expression "(iVar2 == 0x7fffffff)" ( (binary_expression "iVar2 == 0x7fffffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = -1;\n  }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" else (compound_statement "{\n    *(int *)(this + 0x18) = iVar2 + 1;\n    locale::locale((locale *)local_20,param_3);\n                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */\n    piVar3 = (int *)operator_new(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_1);\n    piVar3[1] = (int)pcVar4;\n    locale::locale((locale *)(piVar3 + 2),(locale *)local_20);\n    locale::~locale((locale *)local_20);\n    if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" { (expression_statement "*(int *)(this + 0x18) = iVar2 + 1;" (assignment_expression "*(int *)(this + 0x18) = iVar2 + 1" (pointer_expression "*(int *)(this + 0x18)" * (cast_expression "(int *)(this + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) )))) = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (labeled_statement "locale::locale((locale *)local_20,param_3);" statement_identifier : (ERROR ":" :) (expression_statement "locale((locale *)local_20,param_3);" (call_expression "locale((locale *)local_20,param_3)" identifier (argument_list "((locale *)local_20,param_3)" ( (cast_expression "(locale *)local_20" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier ))) ;)) comment (expression_statement "piVar3 = (int *)operator_new(0xc);" (assignment_expression "piVar3 = (int *)operator_new(0xc)" identifier = (cast_expression "(int *)operator_new(0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "operator_new(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "pcVar4 = strdup(param_1);" (assignment_expression "pcVar4 = strdup(param_1)" identifier = (call_expression "strdup(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "piVar3[1] = (int)pcVar4;" (assignment_expression "piVar3[1] = (int)pcVar4" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = (cast_expression "(int)pcVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (labeled_statement "locale::locale((locale *)(piVar3 + 2),(locale *)local_20);" statement_identifier : (ERROR ":" :) (expression_statement "locale((locale *)(piVar3 + 2),(locale *)local_20);" (call_expression "locale((locale *)(piVar3 + 2),(locale *)local_20)" identifier (argument_list "((locale *)(piVar3 + 2),(locale *)local_20)" ( (cast_expression "(locale *)(piVar3 + 2)" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar3 + 2)" ( (binary_expression "piVar3 + 2" identifier + number_literal) ))) , (cast_expression "(locale *)local_20" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;)) (labeled_statement "locale::~locale((locale *)local_20);" statement_identifier : (ERROR ":" :) (expression_statement "~locale((locale *)local_20);" (unary_expression "~locale((locale *)local_20)" ~ (call_expression "locale((locale *)local_20)" identifier (argument_list "((locale *)local_20)" ( (cast_expression "(locale *)local_20" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;)) (if_statement "if (piVar3[1] == 0) {\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" if (parenthesized_expression "(piVar3[1] == 0)" ( (binary_expression "piVar3[1] == 0" (subscript_expression "piVar3[1]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      locale::~locale((locale *)(piVar3 + 2));\n      iVar2 = -1;\n      operator_delete(piVar3);\n    }" { (labeled_statement "locale::~locale((locale *)(piVar3 + 2));" statement_identifier : (ERROR ":" :) (expression_statement "~locale((locale *)(piVar3 + 2));" (unary_expression "~locale((locale *)(piVar3 + 2))" ~ (call_expression "locale((locale *)(piVar3 + 2))" identifier (argument_list "((locale *)(piVar3 + 2))" ( (cast_expression "(locale *)(piVar3 + 2)" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar3 + 2)" ( (binary_expression "piVar3 + 2" identifier + number_literal) ))) )))) ;)) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "operator_delete(piVar3);" (call_expression "operator_delete(piVar3)" identifier (argument_list "(piVar3)" ( identifier ))) ;) }) (else_clause "else {\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" else (compound_statement "{\n      puVar6 = *(undefined4 **)(this + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" { (expression_statement "puVar6 = *(undefined4 **)(this + 0x20);" (assignment_expression "puVar6 = *(undefined4 **)(this + 0x20)" identifier = (pointer_expression "*(undefined4 **)(this + 0x20)" * (cast_expression "(undefined4 **)(this + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) ))))) ;) (expression_statement "local_20[0] = piVar3;" (assignment_expression "local_20[0] = piVar3" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (puVar6 == *(undefined4 **)(this + 0x24)) {\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }" if (parenthesized_expression "(puVar6 == *(undefined4 **)(this + 0x24))" ( (binary_expression "puVar6 == *(undefined4 **)(this + 0x24)" identifier == (pointer_expression "*(undefined4 **)(this + 0x24)" * (cast_expression "(undefined4 **)(this + 0x24)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x24)" ( (binary_expression "this + 0x24" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */\n        vector<std::Catalog_info*,std::allocator<std::Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);\n      }" { comment (ERROR "vector<std::Catalog_info*,std::allocator<std::" (binary_expression "vector<std" identifier < identifier) : : (binary_expression "Catalog_info*,std" identifier * (ERROR "," ,) identifier) : : (binary_expression "allocator<std" identifier < identifier) : :) (expression_statement "Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20);" (binary_expression "Catalog_info*>>::_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20)" identifier * (ERROR ">>::" >> : :) (call_expression "_M_realloc_insert\n                  (this + 0x1c,puVar6,(locale *)local_20)" identifier (argument_list "(this + 0x1c,puVar6,(locale *)local_20)" ( (binary_expression "this + 0x1c" identifier + number_literal) , identifier , (cast_expression "(locale *)local_20" ( (type_descriptor "locale *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) }) (else_clause "else {\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }" else (compound_statement "{\n        *puVar6 = piVar3;\n        *(undefined4 **)(this + 0x20) = puVar6 + 1;\n      }" { (expression_statement "*puVar6 = piVar3;" (assignment_expression "*puVar6 = piVar3" (pointer_expression "*puVar6" * identifier) = identifier) ;) (expression_statement "*(undefined4 **)(this + 0x20) = puVar6 + 1;" (assignment_expression "*(undefined4 **)(this + 0x20) = puVar6 + 1" (pointer_expression "*(undefined4 **)(this + 0x20)" * (cast_expression "(undefined4 **)(this + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x20)" ( (binary_expression "this + 0x20" identifier + number_literal) )))) = (binary_expression "puVar6 + 1" identifier + number_literal)) ;) }))) (expression_statement "iVar2 = *piVar3;" (assignment_expression "iVar2 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) }))) }))) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }\n  }" if (parenthesized_expression "(puVar1 != (undefined *)0x0)" ( (binary_expression "puVar1 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }\n  }" { (expression_statement "iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this);" (assignment_expression "iVar5 = pthread_mutex_unlock((pthread_mutex_t *)this)" identifier = (call_expression "pthread_mutex_unlock((pthread_mutex_t *)this)" identifier (argument_list "((pthread_mutex_t *)this)" ( (cast_expression "(pthread_mutex_t *)this" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (iVar5 != 0) {\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n      puVar6 = (undefined4 *)__cxa_allocate_exception(4);\n      *puVar6 = &PTR____concurrence_unlock_error_00410fbc;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */\n      __cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);\n    }" { (expression_statement "puVar6 = (undefined4 *)__cxa_allocate_exception(4);" (assignment_expression "puVar6 = (undefined4 *)__cxa_allocate_exception(4)" identifier = (cast_expression "(undefined4 *)__cxa_allocate_exception(4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "__cxa_allocate_exception(4)" identifier (argument_list "(4)" ( number_literal ))))) ;) (expression_statement "*puVar6 = &PTR____concurrence_unlock_error_00410fbc;" (assignment_expression "*puVar6 = &PTR____concurrence_unlock_error_00410fbc" (pointer_expression "*puVar6" * identifier) = (pointer_expression "&PTR____concurrence_unlock_error_00410fbc" & identifier)) ;) comment comment (expression_statement "__cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);" (call_expression "__cxa_throw(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0)" identifier (argument_list "(puVar6,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0)" ( identifier , identifier , identifier ))) ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "int FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}\n\n" (function_definition "int FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" identifier (parameter_list "(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" ( (parameter_declaration "pthread_mutex_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "undefined4 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int *local_20 [4];" primitive_type (pointer_declarator "*local_20 [4]" * (array_declarator "local_20 [4]" identifier [ number_literal ])) ;) (expression_statement "puVar1 = PTR___pthread_key_create_00413ff8;" (assignment_expression "puVar1 = PTR___pthread_key_create_00413ff8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_00413ff8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_00413ff8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" { (expression_statement "iVar2 = pthread_mutex_lock(param_1);" (assignment_expression "iVar2 = pthread_mutex_lock(param_1)" identifier = (call_expression "pthread_mutex_lock(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" { (expression_statement "FUN_00247d10();" (call_expression "FUN_00247d10()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar2 = FUN_00037a66();" (assignment_expression "iVar2 = FUN_00037a66()" identifier = (call_expression "FUN_00037a66()" identifier (argument_list "()" ( )))) ;) (return_statement "return iVar2;" return identifier ;) })) })) (expression_statement "iVar2 = param_1[1].__data.__lock;" (assignment_expression "iVar2 = param_1[1].__data.__lock" identifier = (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" identifier [ number_literal ]) . field_identifier) . field_identifier)) ;) (if_statement "if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" if (parenthesized_expression "(iVar2 == 0x7fffffff)" ( (binary_expression "iVar2 == 0x7fffffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = -1;\n  }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) }) (else_clause "else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" else (compound_statement "{\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" { (expression_statement "param_1[1].__data.__lock = iVar2 + 1;" (assignment_expression "param_1[1].__data.__lock = iVar2 + 1" (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" identifier [ number_literal ]) . field_identifier) . field_identifier) = (binary_expression "iVar2 + 1" identifier + number_literal)) ;) (expression_statement "FUN_0024a1b0(local_20,param_3);" (call_expression "FUN_0024a1b0(local_20,param_3)" identifier (argument_list "(local_20,param_3)" ( identifier , identifier ))) ;) (expression_statement "piVar3 = (int *)FUN_00246670(0xc);" (assignment_expression "piVar3 = (int *)FUN_00246670(0xc)" identifier = (cast_expression "(int *)FUN_00246670(0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00246670(0xc)" identifier (argument_list "(0xc)" ( number_literal ))))) ;) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" * identifier) = identifier) ;) (expression_statement "pcVar4 = strdup(param_2);" (assignment_expression "pcVar4 = strdup(param_2)" identifier = (call_expression "strdup(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "piVar3[1] = (int)pcVar4;" (assignment_expression "piVar3[1] = (int)pcVar4" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = (cast_expression "(int)pcVar4" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "FUN_0024a1b0(piVar3 + 2,local_20);" (call_expression "FUN_0024a1b0(piVar3 + 2,local_20)" identifier (argument_list "(piVar3 + 2,local_20)" ( (binary_expression "piVar3 + 2" identifier + number_literal) , identifier ))) ;) (expression_statement "FUN_0024a980(local_20);" (call_expression "FUN_0024a980(local_20)" identifier (argument_list "(local_20)" ( identifier ))) ;) (if_statement "if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" if (parenthesized_expression "(piVar3[1] == 0)" ( (binary_expression "piVar3[1] == 0" (subscript_expression "piVar3[1]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }" { (expression_statement "FUN_0024a980(piVar3 + 2);" (call_expression "FUN_0024a980(piVar3 + 2)" identifier (argument_list "(piVar3 + 2)" ( (binary_expression "piVar3 + 2" identifier + number_literal) ))) ;) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) (expression_statement "FUN_00248220(piVar3);" (call_expression "FUN_00248220(piVar3)" identifier (argument_list "(piVar3)" ( identifier ))) ;) }) (else_clause "else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" else (compound_statement "{\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" { (expression_statement "puVar6 = *(undefined4 **)((int)param_1 + 0x20);" (assignment_expression "puVar6 = *(undefined4 **)((int)param_1 + 0x20)" identifier = (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" * (cast_expression "(undefined4 **)((int)param_1 + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x20)" ( (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) (expression_statement "local_20[0] = piVar3;" (assignment_expression "local_20[0] = piVar3" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" if (parenthesized_expression "(puVar6 == *(undefined4 **)((int)param_1 + 0x24))" ( (binary_expression "puVar6 == *(undefined4 **)((int)param_1 + 0x24)" identifier == (pointer_expression "*(undefined4 **)((int)param_1 + 0x24)" * (cast_expression "(undefined4 **)((int)param_1 + 0x24)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x24)" ( (binary_expression "(int)param_1 + 0x24" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) )) (compound_statement "{\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }" { (expression_statement "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);" (call_expression "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20)" identifier (argument_list "((int)param_1 + 0x1c,puVar6,local_20)" ( (binary_expression "(int)param_1 + 0x1c" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) , identifier , identifier ))) ;) }) (else_clause "else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" else (compound_statement "{\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" { (expression_statement "*puVar6 = piVar3;" (assignment_expression "*puVar6 = piVar3" (pointer_expression "*puVar6" * identifier) = identifier) ;) (expression_statement "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;" (assignment_expression "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1" (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" * (cast_expression "(undefined4 **)((int)param_1 + 0x20)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + 0x20)" ( (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) = (binary_expression "puVar6 + 1" identifier + number_literal)) ;) }))) (expression_statement "iVar2 = *piVar3;" (assignment_expression "iVar2 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) }))) }))) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" if (parenthesized_expression "(puVar1 != (undefined *)0x0)" ( (binary_expression "puVar1 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" { (expression_statement "iVar5 = pthread_mutex_unlock(param_1);" (assignment_expression "iVar5 = pthread_mutex_unlock(param_1)" identifier = (call_expression "pthread_mutex_unlock(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" if (parenthesized_expression "(iVar5 != 0)" ( (binary_expression "iVar5 != 0" identifier != number_literal) )) (compound_statement "{\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" { (expression_statement "puVar6 = (undefined4 *)FUN_00248050(4);" (assignment_expression "puVar6 = (undefined4 *)FUN_00248050(4)" identifier = (cast_expression "(undefined4 *)FUN_00248050(4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00248050(4)" identifier (argument_list "(4)" ( number_literal ))))) ;) (expression_statement "*puVar6 = &DAT_00410fbc;" (assignment_expression "*puVar6 = &DAT_00410fbc" (pointer_expression "*puVar6" * identifier) = (pointer_expression "&DAT_00410fbc" & identifier)) ;) (expression_statement "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);" (call_expression "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" identifier (argument_list "(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" ( identifier , identifier , identifier ))) ;) })) })) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * (array_declarator IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (return_statement return IDENT ;) })) })) (expression_statement (assignment_expression IDENT = (field_expression (field_expression (subscript_expression IDENT [ LIT ]) . field_identifier) . field_identifier)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (field_expression (field_expression (subscript_expression IDENT [ LIT ]) . field_identifier) . field_identifier) = (binary_expression IDENT + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) , IDENT , IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) = (binary_expression IDENT + LIT)) ;) }))) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (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 ( LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression & IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_00290c80(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" (identifier "FUN_00290c80") (parameter_list "(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)" (( "(") (parameter_declaration "pthread_mutex_t *param_1" (type_identifier "pthread_mutex_t") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  int *piVar3;\n  char *pcVar4;\n  int iVar5;\n  undefined4 *puVar6;\n  int *local_20 [4];\n  \n  puVar1 = PTR___pthread_key_create_00413ff8;\n  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }\n  iVar2 = param_1[1].__data.__lock;\n  if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }\n  return iVar2;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "undefined4 *puVar6;" (type_identifier "undefined4") (pointer_declarator "*puVar6" (* "*") (identifier "puVar6")) (; ";")) (declaration "int *local_20 [4];" (primitive_type "int") (pointer_declarator "*local_20 [4]" (* "*") (array_declarator "local_20 [4]" (identifier "local_20") ([ "[") (number_literal "4") (] "]"))) (; ";")) (expression_statement "puVar1 = PTR___pthread_key_create_00413ff8;" (assignment_expression "puVar1 = PTR___pthread_key_create_00413ff8" (identifier "puVar1") (= "=") (identifier "PTR___pthread_key_create_00413ff8")) (; ";")) (if_statement "if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" (if "if") (parenthesized_expression "(PTR___pthread_key_create_00413ff8 != (undefined *)0x0)" (( "(") (binary_expression "PTR___pthread_key_create_00413ff8 != (undefined *)0x0" (identifier "PTR___pthread_key_create_00413ff8") (!= "!=") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = pthread_mutex_lock(param_1);\n    if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }\n  }" ({ "{") (expression_statement "iVar2 = pthread_mutex_lock(param_1);" (assignment_expression "iVar2 = pthread_mutex_lock(param_1)" (identifier "iVar2") (= "=") (call_expression "pthread_mutex_lock(param_1)" (identifier "pthread_mutex_lock") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar2 != 0) {\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_00247d10();\n                    \n      iVar2 = FUN_00037a66();\n      return iVar2;\n    }" ({ "{") (expression_statement "FUN_00247d10();" (call_expression "FUN_00247d10()" (identifier "FUN_00247d10") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar2 = FUN_00037a66();" (assignment_expression "iVar2 = FUN_00037a66()" (identifier "iVar2") (= "=") (call_expression "FUN_00037a66()" (identifier "FUN_00037a66") (argument_list "()" (( "(") () ")")))) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (} "}"))) (expression_statement "iVar2 = param_1[1].__data.__lock;" (assignment_expression "iVar2 = param_1[1].__data.__lock" (identifier "iVar2") (= "=") (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (. ".") (field_identifier "__data")) (. ".") (field_identifier "__lock"))) (; ";")) (if_statement "if (iVar2 == 0x7fffffff) {\n    iVar2 = -1;\n  }\n  else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" (if "if") (parenthesized_expression "(iVar2 == 0x7fffffff)" (( "(") (binary_expression "iVar2 == 0x7fffffff" (identifier "iVar2") (== "==") (number_literal "0x7fffffff")) () ")")) (compound_statement "{\n    iVar2 = -1;\n  }" ({ "{") (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}")) (else_clause "else {\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" (else "else") (compound_statement "{\n    param_1[1].__data.__lock = iVar2 + 1;\n    FUN_0024a1b0(local_20,param_3);\n                    \n    piVar3 = (int *)FUN_00246670(0xc);\n    *piVar3 = iVar2;\n    pcVar4 = strdup(param_2);\n    piVar3[1] = (int)pcVar4;\n    FUN_0024a1b0(piVar3 + 2,local_20);\n    FUN_0024a980(local_20);\n    if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }\n  }" ({ "{") (expression_statement "param_1[1].__data.__lock = iVar2 + 1;" (assignment_expression "param_1[1].__data.__lock = iVar2 + 1" (field_expression "param_1[1].__data.__lock" (field_expression "param_1[1].__data" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (. ".") (field_identifier "__data")) (. ".") (field_identifier "__lock")) (= "=") (binary_expression "iVar2 + 1" (identifier "iVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "FUN_0024a1b0(local_20,param_3);" (call_expression "FUN_0024a1b0(local_20,param_3)" (identifier "FUN_0024a1b0") (argument_list "(local_20,param_3)" (( "(") (identifier "local_20") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "piVar3 = (int *)FUN_00246670(0xc);" (assignment_expression "piVar3 = (int *)FUN_00246670(0xc)" (identifier "piVar3") (= "=") (cast_expression "(int *)FUN_00246670(0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00246670(0xc)" (identifier "FUN_00246670") (argument_list "(0xc)" (( "(") (number_literal "0xc") () ")"))))) (; ";")) (expression_statement "*piVar3 = iVar2;" (assignment_expression "*piVar3 = iVar2" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar2")) (; ";")) (expression_statement "pcVar4 = strdup(param_2);" (assignment_expression "pcVar4 = strdup(param_2)" (identifier "pcVar4") (= "=") (call_expression "strdup(param_2)" (identifier "strdup") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "piVar3[1] = (int)pcVar4;" (assignment_expression "piVar3[1] = (int)pcVar4" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (= "=") (cast_expression "(int)pcVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pcVar4"))) (; ";")) (expression_statement "FUN_0024a1b0(piVar3 + 2,local_20);" (call_expression "FUN_0024a1b0(piVar3 + 2,local_20)" (identifier "FUN_0024a1b0") (argument_list "(piVar3 + 2,local_20)" (( "(") (binary_expression "piVar3 + 2" (identifier "piVar3") (+ "+") (number_literal "2")) (, ",") (identifier "local_20") () ")"))) (; ";")) (expression_statement "FUN_0024a980(local_20);" (call_expression "FUN_0024a980(local_20)" (identifier "FUN_0024a980") (argument_list "(local_20)" (( "(") (identifier "local_20") () ")"))) (; ";")) (if_statement "if (piVar3[1] == 0) {\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }\n    else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" (if "if") (parenthesized_expression "(piVar3[1] == 0)" (( "(") (binary_expression "piVar3[1] == 0" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0024a980(piVar3 + 2);\n      iVar2 = -1;\n      FUN_00248220(piVar3);\n    }" ({ "{") (expression_statement "FUN_0024a980(piVar3 + 2);" (call_expression "FUN_0024a980(piVar3 + 2)" (identifier "FUN_0024a980") (argument_list "(piVar3 + 2)" (( "(") (binary_expression "piVar3 + 2" (identifier "piVar3") (+ "+") (number_literal "2")) () ")"))) (; ";")) (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (expression_statement "FUN_00248220(piVar3);" (call_expression "FUN_00248220(piVar3)" (identifier "FUN_00248220") (argument_list "(piVar3)" (( "(") (identifier "piVar3") () ")"))) (; ";")) (} "}")) (else_clause "else {\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" (else "else") (compound_statement "{\n      puVar6 = *(undefined4 **)((int)param_1 + 0x20);\n      local_20[0] = piVar3;\n      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }\n      iVar2 = *piVar3;\n    }" ({ "{") (expression_statement "puVar6 = *(undefined4 **)((int)param_1 + 0x20);" (assignment_expression "puVar6 = *(undefined4 **)((int)param_1 + 0x20)" (identifier "puVar6") (= "=") (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" (* "*") (cast_expression "(undefined4 **)((int)param_1 + 0x20)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)param_1 + 0x20)" (( "(") (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (number_literal "0x20")) () ")"))))) (; ";")) (expression_statement "local_20[0] = piVar3;" (assignment_expression "local_20[0] = piVar3" (subscript_expression "local_20[0]" (identifier "local_20") ([ "[") (number_literal "0") (] "]")) (= "=") (identifier "piVar3")) (; ";")) (if_statement "if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }\n      else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" (if "if") (parenthesized_expression "(puVar6 == *(undefined4 **)((int)param_1 + 0x24))" (( "(") (binary_expression "puVar6 == *(undefined4 **)((int)param_1 + 0x24)" (identifier "puVar6") (== "==") (pointer_expression "*(undefined4 **)((int)param_1 + 0x24)" (* "*") (cast_expression "(undefined4 **)((int)param_1 + 0x24)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)param_1 + 0x24)" (( "(") (binary_expression "(int)param_1 + 0x24" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (number_literal "0x24")) () ")"))))) () ")")) (compound_statement "{\n                    \n        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);\n      }" ({ "{") (expression_statement "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);" (call_expression "FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20)" (identifier "FUN_00290b30") (argument_list "((int)param_1 + 0x1c,puVar6,local_20)" (( "(") (binary_expression "(int)param_1 + 0x1c" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (number_literal "0x1c")) (, ",") (identifier "puVar6") (, ",") (identifier "local_20") () ")"))) (; ";")) (} "}")) (else_clause "else {\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" (else "else") (compound_statement "{\n        *puVar6 = piVar3;\n        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;\n      }" ({ "{") (expression_statement "*puVar6 = piVar3;" (assignment_expression "*puVar6 = piVar3" (pointer_expression "*puVar6" (* "*") (identifier "puVar6")) (= "=") (identifier "piVar3")) (; ";")) (expression_statement "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;" (assignment_expression "*(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1" (pointer_expression "*(undefined4 **)((int)param_1 + 0x20)" (* "*") (cast_expression "(undefined4 **)((int)param_1 + 0x20)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)param_1 + 0x20)" (( "(") (binary_expression "(int)param_1 + 0x20" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (number_literal "0x20")) () ")")))) (= "=") (binary_expression "puVar6 + 1" (identifier "puVar6") (+ "+") (number_literal "1"))) (; ";")) (} "}")))) (expression_statement "iVar2 = *piVar3;" (assignment_expression "iVar2 = *piVar3" (identifier "iVar2") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (} "}")))) (} "}")))) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" (if "if") (parenthesized_expression "(puVar1 != (undefined *)0x0)" (( "(") (binary_expression "puVar1 != (undefined *)0x0" (identifier "puVar1") (!= "!=") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar5 = pthread_mutex_unlock(param_1);\n    if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }\n  }" ({ "{") (expression_statement "iVar5 = pthread_mutex_unlock(param_1);" (assignment_expression "iVar5 = pthread_mutex_unlock(param_1)" (identifier "iVar5") (= "=") (call_expression "pthread_mutex_unlock(param_1)" (identifier "pthread_mutex_unlock") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar5 != 0) {\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" (if "if") (parenthesized_expression "(iVar5 != 0)" (( "(") (binary_expression "iVar5 != 0" (identifier "iVar5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      puVar6 = (undefined4 *)FUN_00248050(4);\n      *puVar6 = &DAT_00410fbc;\n                    \n                    \n      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);\n    }" ({ "{") (expression_statement "puVar6 = (undefined4 *)FUN_00248050(4);" (assignment_expression "puVar6 = (undefined4 *)FUN_00248050(4)" (identifier "puVar6") (= "=") (cast_expression "(undefined4 *)FUN_00248050(4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00248050(4)" (identifier "FUN_00248050") (argument_list "(4)" (( "(") (number_literal "4") () ")"))))) (; ";")) (expression_statement "*puVar6 = &DAT_00410fbc;" (assignment_expression "*puVar6 = &DAT_00410fbc" (pointer_expression "*puVar6" (* "*") (identifier "puVar6")) (= "=") (pointer_expression "&DAT_00410fbc" (& "&") (identifier "DAT_00410fbc"))) (; ";")) (expression_statement "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);" (call_expression "FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" (identifier "FUN_00246aa0") (argument_list "(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0)" (( "(") (identifier "puVar6") (, ",") (identifier "PTR_PTR_00413e60") (, ",") (identifier "PTR_FUN_00413bf0") () ")"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */
/* std::Catalogs::_M_add(char const*, std::locale) */

int __thiscall std::type_1::function_1(type_1 *var_5,char *param_1,type_2 *param_3)

{
  type_3 *var_13;
  int var_3;
  int *var_8;
  char *pcVar4;
  int var_15;
  type_4 *var_10;
  int *local_20 [4];
  
  var_13 = var_1;
  if (var_1 != (type_3 *)0x0) {
    var_3 = var_2((type_5 *)var_5);
    if (var_3 != 0) {
      var_4();
                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */
      var_3 = function_1();
      return var_3;
    }
  }
  var_3 = *(int *)(var_5 + 0x18);
  if (var_3 == 0x7fffffff) {
    var_3 = -1;
  }
  else {
    *(int *)(var_5 + 0x18) = var_3 + 1;
    locale::type_2((type_2 *)local_20,param_3);
                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */
    var_8 = (int *)var_6(0xc);
    *var_8 = var_3;
    pcVar4 = var_7(param_1);
    var_8[1] = (int)pcVar4;
    locale::type_2((type_2 *)(var_8 + 2),(type_2 *)local_20);
    locale::~type_2((type_2 *)local_20);
    if (var_8[1] == 0) {
      locale::~type_2((type_2 *)(var_8 + 2));
      var_3 = -1;
      var_9(var_8);
    }
    else {
      var_10 = *(type_4 **)(var_5 + 0x20);
      local_20[0] = var_8;
      if (var_10 == *(type_4 **)(var_5 + 0x24)) {
                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */
        vector<std::var_11*,std::allocator<std::var_11*>>::var_12
                  (var_5 + 0x1c,var_10,(type_2 *)local_20);
      }
      else {
        *var_10 = var_8;
        *(type_4 **)(var_5 + 0x20) = var_10 + 1;
      }
      var_3 = *var_8;
    }
  }
  if (var_13 != (type_3 *)0x0) {
    var_15 = var_14((type_5 *)var_5);
    if (var_15 != 0) {
      var_10 = (type_4 *)var_16(4);
      *var_10 = &PTR____concurrence_unlock_error_00410fbc;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */
      var_17(var_10,PTR_PTR_00413e60,PTR____concurrence_unlock_error_00413bf0);
    }
  }
  return var_3;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (array_declarator declarator: (identifier) size: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (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: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (return_statement (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (field_expression argument: (field_expression argument: (subscript_expression argument: (identifier) index: (number_literal)) field: (field_identifier)) field: (field_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (field_expression argument: (subscript_expression argument: (identifier) index: (number_literal)) field: (field_identifier)) field: (field_identifier)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)) (identifier) (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))))))))) (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: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (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 (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))))) (return_statement (identifier)))))

/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int MASKED(pthread_mutex_t *param_1,char *param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  int *piVar3;
  char *pcVar4;
  int iVar5;
  undefined4 *puVar6;
  int *local_20 [4];
  
  puVar1 = PTR___pthread_key_create_00413ff8;
  if (PTR___pthread_key_create_00413ff8 != (undefined *)0x0) {
    iVar2 = pthread_mutex_lock(param_1);
    if (iVar2 != 0) {
      FUN_00247d10();
                    /* catch() { ... } // from try @ 00290ddc with catch @ 00290de6 */
      iVar2 = FUN_00037a66();
      return iVar2;
    }
  }
  iVar2 = param_1[1].__data.__lock;
  if (iVar2 == 0x7fffffff) {
    iVar2 = -1;
  }
  else {
    param_1[1].__data.__lock = iVar2 + 1;
    FUN_0024a1b0(local_20,param_3);
                    /* try { // try from 00290cf7 to 00290cfb has its CatchHandler @ 00290df3 */
    piVar3 = (int *)FUN_00246670(0xc);
    *piVar3 = iVar2;
    pcVar4 = strdup(param_2);
    piVar3[1] = (int)pcVar4;
    FUN_0024a1b0(piVar3 + 2,local_20);
    FUN_0024a980(local_20);
    if (piVar3[1] == 0) {
      FUN_0024a980(piVar3 + 2);
      iVar2 = -1;
      FUN_00248220(piVar3);
    }
    else {
      puVar6 = *(undefined4 **)((int)param_1 + 0x20);
      local_20[0] = piVar3;
      if (puVar6 == *(undefined4 **)((int)param_1 + 0x24)) {
                    /* try { // try from 00290da6 to 00290daa has its CatchHandler @ 00290deb */
        FUN_00290b30((int)param_1 + 0x1c,puVar6,local_20);
      }
      else {
        *puVar6 = piVar3;
        *(undefined4 **)((int)param_1 + 0x20) = puVar6 + 1;
      }
      iVar2 = *piVar3;
    }
  }
  if (puVar1 != (undefined *)0x0) {
    iVar5 = pthread_mutex_unlock(param_1);
    if (iVar5 != 0) {
      puVar6 = (undefined4 *)FUN_00248050(4);
      *puVar6 = &DAT_00410fbc;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 00290ddc to 00290de0 has its CatchHandler @ 00290de6 */
      FUN_00246aa0(puVar6,PTR_PTR_00413e60,PTR_FUN_00413bf0);
    }
  }
  return iVar2;
}

