
/* std::locale::global(std::locale const&) */

locale * __thiscall std::locale::global(locale *this,locale *param_1)

{
  undefined *puVar1;
  _Impl *p_Var2;
  int iVar3;
  pthread_mutex_t *__mutex;
  undefined8 *puVar4;
  char *local_48 [2];
  char acStack_38 [16];
  
  _S_initialize();
  __mutex = (pthread_mutex_t *)::(anonymous_namespace)::get_locale_mutex();
  puVar1 = PTR___pthread_key_create_0067bee8;
  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {
    iVar3 = pthread_mutex_lock(__mutex);
    if (iVar3 != 0) {
      __throw_concurrence_lock_error();
      goto LAB_004e7cee;
    }
  }
  p_Var2 = _S_global;
  _S_global = *(_Impl **)param_1;
  if (puVar1 == (undefined *)0x0) {
    *(int *)_S_global = *(int *)_S_global + 1;
  }
  else {
    LOCK();
    *(int *)_S_global = *(int *)_S_global + 1;
    UNLOCK();
    _S_global = *(_Impl **)param_1;
  }
                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */
  name_abi_cxx11_();
  iVar3 = std::string::compare((string *)local_48,"*");
  if (iVar3 != 0) {
    setlocale(6,local_48[0]);
  }
  if (local_48[0] != acStack_38) {
    operator_delete(local_48[0]);
  }
  if (puVar1 != (undefined *)0x0) {
    iVar3 = pthread_mutex_unlock(__mutex);
    if (iVar3 != 0) {
LAB_004e7cee:
      puVar4 = (undefined8 *)__cxa_allocate_exception(8);
      *puVar4 = &PTR____concurrence_unlock_error_006764c0;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */
      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,
                  __concurrence_unlock_error::~__concurrence_unlock_error);
    }
  }
  locale(this,p_Var2);
  return this;
}



undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  pthread_mutex_t *__mutex;
  undefined8 *puVar4;
  char *local_48 [2];
  char acStack_38 [16];
  
  FUN_004e7a60();
  __mutex = (pthread_mutex_t *)FUN_004e6960();
  puVar1 = PTR___pthread_key_create_0067bee8;
  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {
    iVar3 = pthread_mutex_lock(__mutex);
    if (iVar3 != 0) {
      FUN_0049deb0();
      goto LAB_004e7cee;
    }
  }
  piVar2 = DAT_00688b18;
  DAT_00688b18 = (int *)*param_2;
  if (puVar1 == (undefined *)0x0) {
    *DAT_00688b18 = *DAT_00688b18 + 1;
  }
  else {
    LOCK();
    *DAT_00688b18 = *DAT_00688b18 + 1;
    UNLOCK();
    DAT_00688b18 = (int *)*param_2;
  }
                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */
  FUN_004a0170(local_48,param_2);
  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);
  if (iVar3 != 0) {
    setlocale(6,local_48[0]);
  }
  if (local_48[0] != acStack_38) {
    FUN_0049e340();
  }
  if (puVar1 != (undefined *)0x0) {
    iVar3 = pthread_mutex_unlock(__mutex);
    if (iVar3 != 0) {
LAB_004e7cee:
      puVar4 = (undefined8 *)FUN_0049e1d0(8);
      *puVar4 = &PTR_FUN_006764c0;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */
      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);
    }
  }
  FUN_004a0160(param_1,piVar2);
  return param_1;
}


PUSH R14
MOV R14,RSI
PUSH R13
PUSH R12
MOV R12,RDI
PUSH RBP
PUSH RBX
SUB RSP,0x30
CALL 0x004e7a60
CALL 0x004e6960
MOV RBP,qword ptr [0x0067bee8]
MOV qword ptr [RSP + 0x8],RAX
TEST RBP,RBP
JZ 0x004e7c4d
MOV RDI,RAX
CALL 0x001779b0
TEST EAX,EAX
JNZ 0x004e7ce9
LEA RDX,[0x688b18]
MOV RAX,qword ptr [R14]
MOV R13,qword ptr [RDX]
TEST RBP,RBP
JZ 0x004e7cd0
ADD.LOCK dword ptr [RAX],0x1
MOV RAX,qword ptr [R14]
LEA RBX,[RSP + 0x10]
MOV RSI,R14
MOV qword ptr [RDX],RAX
MOV RDI,RBX
CALL 0x004a0170
LEA RSI,[0x5882bd]
MOV RDI,RBX
CALL 0x004a7120
TEST EAX,EAX
JNZ 0x004e7cd8
MOV RDI,qword ptr [RSP + 0x10]
ADD RBX,0x10
CMP RDI,RBX
JZ 0x004e7c9f
CALL 0x0049e340
TEST RBP,RBP
JZ 0x004e7cb2
MOV RDI,qword ptr [RSP + 0x8]
CALL 0x00177a80
TEST EAX,EAX
JNZ 0x004e7cee
MOV RSI,R13
MOV RDI,R12
CALL 0x004a0160
ADD RSP,0x30
MOV RAX,R12
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
ADD dword ptr [RAX],0x1
JMP 0x004e7c66
MOV RSI,qword ptr [RSP + 0x10]
MOV EDI,0x6
CALL 0x001779e0
JMP 0x004e7c8c
CALL 0x0049deb0
MOV EDI,0x8
CALL 0x0049e1d0
LEA RDX,[0x6764b0]
LEA RSI,[0x676470]
MOV RDI,RAX
ADD RDX,0x10
MOV qword ptr [RAX],RDX
LEA RDX,[0x49de30]
CALL 0x0049cef0
(translation_unit "undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */\n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}\n\n" (function_definition "undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */\n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" type_identifier (function_declarator "FUN_004e7c10(undefined8 param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */\n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "char *local_48 [2];" primitive_type (pointer_declarator "*local_48 [2]" * (array_declarator "local_48 [2]" identifier [ number_literal ])) ;) (declaration "char acStack_38 [16];" primitive_type (array_declarator "acStack_38 [16]" identifier [ number_literal ]) ;) (expression_statement "FUN_004e7a60();" (call_expression "FUN_004e7a60()" identifier (argument_list "()" ( ))) ;) (expression_statement "__mutex = (pthread_mutex_t *)FUN_004e6960();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_004e6960()" identifier = (cast_expression "(pthread_mutex_t *)FUN_004e6960()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_004e6960()" identifier (argument_list "()" ( ))))) ;) (expression_statement "puVar1 = PTR___pthread_key_create_0067bee8;" (assignment_expression "puVar1 = PTR___pthread_key_create_0067bee8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_0067bee8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0067bee8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_lock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_lock(__mutex)" identifier = (call_expression "pthread_mutex_lock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" { (expression_statement "FUN_0049deb0();" (call_expression "FUN_0049deb0()" identifier (argument_list "()" ( ))) ;) (goto_statement "goto LAB_004e7cee;" goto statement_identifier ;) })) })) (expression_statement "piVar2 = DAT_00688b18;" (assignment_expression "piVar2 = DAT_00688b18" identifier = identifier) ;) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" identifier = (cast_expression "(int *)*param_2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (if_statement "if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\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    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }" { (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) = (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" else (compound_statement "{\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) = (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" identifier = (cast_expression "(int *)*param_2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) }))) comment (expression_statement "FUN_004a0170(local_48,param_2);" (call_expression "FUN_004a0170(local_48,param_2)" identifier (argument_list "(local_48,param_2)" ( identifier , identifier ))) ;) (expression_statement "iVar3 = FUN_004a7120(local_48,&DAT_005882bd);" (assignment_expression "iVar3 = FUN_004a7120(local_48,&DAT_005882bd)" identifier = (call_expression "FUN_004a7120(local_48,&DAT_005882bd)" identifier (argument_list "(local_48,&DAT_005882bd)" ( identifier , (pointer_expression "&DAT_005882bd" & identifier) )))) ;) (if_statement "if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    setlocale(6,local_48[0]);\n  }" { (expression_statement "setlocale(6,local_48[0]);" (call_expression "setlocale(6,local_48[0])" identifier (argument_list "(6,local_48[0])" ( number_literal , (subscript_expression "local_48[0]" identifier [ number_literal ]) ))) ;) })) (if_statement "if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }" if (parenthesized_expression "(local_48[0] != acStack_38)" ( (binary_expression "local_48[0] != acStack_38" (subscript_expression "local_48[0]" identifier [ number_literal ]) != identifier) )) (compound_statement "{\n    FUN_0049e340();\n  }" { (expression_statement "FUN_0049e340();" (call_expression "FUN_0049e340()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\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    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_unlock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_unlock(__mutex)" identifier = (call_expression "pthread_mutex_unlock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" { (labeled_statement "LAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);" statement_identifier : (expression_statement "puVar4 = (undefined8 *)FUN_0049e1d0(8);" (assignment_expression "puVar4 = (undefined8 *)FUN_0049e1d0(8)" identifier = (cast_expression "(undefined8 *)FUN_0049e1d0(8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0049e1d0(8)" identifier (argument_list "(8)" ( number_literal ))))) ;)) (expression_statement "*puVar4 = &PTR_FUN_006764c0;" (assignment_expression "*puVar4 = &PTR_FUN_006764c0" (pointer_expression "*puVar4" * identifier) = (pointer_expression "&PTR_FUN_006764c0" & identifier)) ;) comment comment (expression_statement "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);" (call_expression "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" identifier (argument_list "(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" ( identifier , (pointer_expression "&PTR_PTR_FUN_00676470" & identifier) , identifier ))) ;) })) })) (expression_statement "FUN_004a0160(param_1,piVar2);" (call_expression "FUN_004a0160(param_1,piVar2)" identifier (argument_list "(param_1,piVar2)" ( identifier , identifier ))) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* std::locale::global(std::locale const&) */\n\nlocale * __thiscall std::locale::global(locale *this,locale *param_1)\n\n{\n  undefined *puVar1;\n  _Impl *p_Var2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  _S_initialize();\n  __mutex = (pthread_mutex_t *)::(anonymous_namespace)::get_locale_mutex();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }\n  }\n  p_Var2 = _S_global;\n  _S_global = *(_Impl **)param_1;\n  if (puVar1 == (undefined *)0x0) {\n    *(int *)_S_global = *(int *)_S_global + 1;\n  }\n  else {\n    LOCK();\n    *(int *)_S_global = *(int *)_S_global + 1;\n    UNLOCK();\n    _S_global = *(_Impl **)param_1;\n  }\n                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */\n  name_abi_cxx11_();\n  iVar3 = std::string::compare((string *)local_48,"*");\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    operator_delete(local_48[0]);\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\n    }\n  }\n  locale(this,p_Var2);\n  return this;\n}\n\n" comment (ERROR "locale * __thiscall std::locale::global(locale *this,locale *param_1)" (binary_expression "locale * __thiscall std::locale::global(locale *this,locale *param_1" (binary_expression "locale * __thiscall std::locale::global(locale *this" (binary_expression "locale * __thiscall" identifier * identifier) (ERROR "std::locale::global(locale" identifier : : identifier : : identifier ( identifier) * identifier) (ERROR ",locale" , identifier) * identifier) )) (compound_statement "{\n  undefined *puVar1;\n  _Impl *p_Var2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  _S_initialize();\n  __mutex = (pthread_mutex_t *)::(anonymous_namespace)::get_locale_mutex();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }\n  }\n  p_Var2 = _S_global;\n  _S_global = *(_Impl **)param_1;\n  if (puVar1 == (undefined *)0x0) {\n    *(int *)_S_global = *(int *)_S_global + 1;\n  }\n  else {\n    LOCK();\n    *(int *)_S_global = *(int *)_S_global + 1;\n    UNLOCK();\n    _S_global = *(_Impl **)param_1;\n  }\n                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */\n  name_abi_cxx11_();\n  iVar3 = std::string::compare((string *)local_48,"*");\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    operator_delete(local_48[0]);\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\n    }\n  }\n  locale(this,p_Var2);\n  return this;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "_Impl *p_Var2;" type_identifier (pointer_declarator "*p_Var2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "char *local_48 [2];" primitive_type (pointer_declarator "*local_48 [2]" * (array_declarator "local_48 [2]" identifier [ number_literal ])) ;) (declaration "char acStack_38 [16];" primitive_type (array_declarator "acStack_38 [16]" identifier [ number_literal ]) ;) (expression_statement "_S_initialize();" (call_expression "_S_initialize()" identifier (argument_list "()" ( ))) ;) (labeled_statement "__mutex = (pthread_mutex_t *)::(anonymous_namespace)::get_locale_mutex();" statement_identifier (ERROR "= (pthread_mutex_t *)::(anonymous_namespace):" = ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) : : (parenthesized_expression "(anonymous_namespace)" ( identifier )) :) : (expression_statement "get_locale_mutex();" (call_expression "get_locale_mutex()" identifier (argument_list "()" ( ))) ;)) (expression_statement "puVar1 = PTR___pthread_key_create_0067bee8;" (assignment_expression "puVar1 = PTR___pthread_key_create_0067bee8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_0067bee8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0067bee8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_lock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_lock(__mutex)" identifier = (call_expression "pthread_mutex_lock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      __throw_concurrence_lock_error();\n      goto LAB_004e7cee;\n    }" { (expression_statement "__throw_concurrence_lock_error();" (call_expression "__throw_concurrence_lock_error()" identifier (argument_list "()" ( ))) ;) (goto_statement "goto LAB_004e7cee;" goto statement_identifier ;) })) })) (expression_statement "p_Var2 = _S_global;" (assignment_expression "p_Var2 = _S_global" identifier = identifier) ;) (expression_statement "_S_global = *(_Impl **)param_1;" (assignment_expression "_S_global = *(_Impl **)param_1" identifier = (pointer_expression "*(_Impl **)param_1" * (cast_expression "(_Impl **)param_1" ( (type_descriptor "_Impl **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (puVar1 == (undefined *)0x0) {\n    *(int *)_S_global = *(int *)_S_global + 1;\n  }\n  else {\n    LOCK();\n    *(int *)_S_global = *(int *)_S_global + 1;\n    UNLOCK();\n    _S_global = *(_Impl **)param_1;\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    *(int *)_S_global = *(int *)_S_global + 1;\n  }" { (expression_statement "*(int *)_S_global = *(int *)_S_global + 1;" (assignment_expression "*(int *)_S_global = *(int *)_S_global + 1" (pointer_expression "*(int *)_S_global" * (cast_expression "(int *)_S_global" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = (binary_expression "*(int *)_S_global + 1" (pointer_expression "*(int *)_S_global" * (cast_expression "(int *)_S_global" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    *(int *)_S_global = *(int *)_S_global + 1;\n    UNLOCK();\n    _S_global = *(_Impl **)param_1;\n  }" else (compound_statement "{\n    LOCK();\n    *(int *)_S_global = *(int *)_S_global + 1;\n    UNLOCK();\n    _S_global = *(_Impl **)param_1;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "*(int *)_S_global = *(int *)_S_global + 1;" (assignment_expression "*(int *)_S_global = *(int *)_S_global + 1" (pointer_expression "*(int *)_S_global" * (cast_expression "(int *)_S_global" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = (binary_expression "*(int *)_S_global + 1" (pointer_expression "*(int *)_S_global" * (cast_expression "(int *)_S_global" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "_S_global = *(_Impl **)param_1;" (assignment_expression "_S_global = *(_Impl **)param_1" identifier = (pointer_expression "*(_Impl **)param_1" * (cast_expression "(_Impl **)param_1" ( (type_descriptor "_Impl **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) comment (expression_statement "name_abi_cxx11_();" (call_expression "name_abi_cxx11_()" identifier (argument_list "()" ( ))) ;) (ERROR "iVar3 = std::" (assignment_expression "iVar3 = std" identifier = identifier) : :) (labeled_statement "string::compare((string *)local_48,"*");" statement_identifier : (ERROR ":" :) (expression_statement "compare((string *)local_48,"*");" (call_expression "compare((string *)local_48,"*")" identifier (argument_list "((string *)local_48,"*")" ( (cast_expression "(string *)local_48" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (string_literal ""*"" " string_content ") ))) ;)) (if_statement "if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    setlocale(6,local_48[0]);\n  }" { (expression_statement "setlocale(6,local_48[0]);" (call_expression "setlocale(6,local_48[0])" identifier (argument_list "(6,local_48[0])" ( number_literal , (subscript_expression "local_48[0]" identifier [ number_literal ]) ))) ;) })) (if_statement "if (local_48[0] != acStack_38) {\n    operator_delete(local_48[0]);\n  }" if (parenthesized_expression "(local_48[0] != acStack_38)" ( (binary_expression "local_48[0] != acStack_38" (subscript_expression "local_48[0]" identifier [ number_literal ]) != identifier) )) (compound_statement "{\n    operator_delete(local_48[0]);\n  }" { (expression_statement "operator_delete(local_48[0]);" (call_expression "operator_delete(local_48[0])" identifier (argument_list "(local_48[0])" ( (subscript_expression "local_48[0]" identifier [ number_literal ]) ))) ;) })) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\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    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_unlock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_unlock(__mutex)" identifier = (call_expression "pthread_mutex_unlock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);\n      *puVar4 = &PTR____concurrence_unlock_error_006764c0;\n                    /* WARNING: Subroutine does not return */\n                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */\n      __cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);\n    }" { (labeled_statement "LAB_004e7cee:\n      puVar4 = (undefined8 *)__cxa_allocate_exception(8);" statement_identifier : (expression_statement "puVar4 = (undefined8 *)__cxa_allocate_exception(8);" (assignment_expression "puVar4 = (undefined8 *)__cxa_allocate_exception(8)" identifier = (cast_expression "(undefined8 *)__cxa_allocate_exception(8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "__cxa_allocate_exception(8)" identifier (argument_list "(8)" ( number_literal ))))) ;)) (expression_statement "*puVar4 = &PTR____concurrence_unlock_error_006764c0;" (assignment_expression "*puVar4 = &PTR____concurrence_unlock_error_006764c0" (pointer_expression "*puVar4" * identifier) = (pointer_expression "&PTR____concurrence_unlock_error_006764c0" & identifier)) ;) comment comment (expression_statement "__cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error);" (call_expression "__cxa_throw(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error)" identifier (argument_list "(puVar4,&__concurrence_unlock_error::typeinfo,\n                  __concurrence_unlock_error::~__concurrence_unlock_error)" ( identifier , (pointer_expression "&__concurrence_unlock_error" & identifier) (ERROR "::typeinfo" : : identifier) , (ERROR "__concurrence_unlock_error::" identifier : :) (unary_expression "~__concurrence_unlock_error" ~ identifier) ))) ;) })) })) (expression_statement "locale(this,p_Var2);" (call_expression "locale(this,p_Var2)" identifier (argument_list "(this,p_Var2)" ( identifier , identifier ))) ;) (return_statement "return this;" return identifier ;) }))
(translation_unit "undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    \n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}\n\n" (function_definition "undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    \n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" type_identifier (function_declarator "FUN_004e7c10(undefined8 param_1,undefined8 *param_2)" identifier (parameter_list "(undefined8 param_1,undefined8 *param_2)" ( (parameter_declaration "undefined8 param_1" type_identifier identifier) , (parameter_declaration "undefined8 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    \n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "pthread_mutex_t *__mutex;" type_identifier (pointer_declarator "*__mutex" * identifier) ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "char *local_48 [2];" primitive_type (pointer_declarator "*local_48 [2]" * (array_declarator "local_48 [2]" identifier [ number_literal ])) ;) (declaration "char acStack_38 [16];" primitive_type (array_declarator "acStack_38 [16]" identifier [ number_literal ]) ;) (expression_statement "FUN_004e7a60();" (call_expression "FUN_004e7a60()" identifier (argument_list "()" ( ))) ;) (expression_statement "__mutex = (pthread_mutex_t *)FUN_004e6960();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_004e6960()" identifier = (cast_expression "(pthread_mutex_t *)FUN_004e6960()" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_004e6960()" identifier (argument_list "()" ( ))))) ;) (expression_statement "puVar1 = PTR___pthread_key_create_0067bee8;" (assignment_expression "puVar1 = PTR___pthread_key_create_0067bee8" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" if (parenthesized_expression "(PTR___pthread_key_create_0067bee8 != (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0067bee8 != (undefined *)0x0" identifier != (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_lock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_lock(__mutex)" identifier = (call_expression "pthread_mutex_lock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" { (expression_statement "FUN_0049deb0();" (call_expression "FUN_0049deb0()" identifier (argument_list "()" ( ))) ;) (goto_statement "goto LAB_004e7cee;" goto statement_identifier ;) })) })) (expression_statement "piVar2 = DAT_00688b18;" (assignment_expression "piVar2 = DAT_00688b18" identifier = identifier) ;) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" identifier = (cast_expression "(int *)*param_2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) (if_statement "if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\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    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }" { (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) = (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" else (compound_statement "{\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) = (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" identifier = (cast_expression "(int *)*param_2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_2" * identifier))) ;) }))) (expression_statement "FUN_004a0170(local_48,param_2);" (call_expression "FUN_004a0170(local_48,param_2)" identifier (argument_list "(local_48,param_2)" ( identifier , identifier ))) ;) (expression_statement "iVar3 = FUN_004a7120(local_48,&DAT_005882bd);" (assignment_expression "iVar3 = FUN_004a7120(local_48,&DAT_005882bd)" identifier = (call_expression "FUN_004a7120(local_48,&DAT_005882bd)" identifier (argument_list "(local_48,&DAT_005882bd)" ( identifier , (pointer_expression "&DAT_005882bd" & identifier) )))) ;) (if_statement "if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\n    setlocale(6,local_48[0]);\n  }" { (expression_statement "setlocale(6,local_48[0]);" (call_expression "setlocale(6,local_48[0])" identifier (argument_list "(6,local_48[0])" ( number_literal , (subscript_expression "local_48[0]" identifier [ number_literal ]) ))) ;) })) (if_statement "if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }" if (parenthesized_expression "(local_48[0] != acStack_38)" ( (binary_expression "local_48[0] != acStack_38" (subscript_expression "local_48[0]" identifier [ number_literal ]) != identifier) )) (compound_statement "{\n    FUN_0049e340();\n  }" { (expression_statement "FUN_0049e340();" (call_expression "FUN_0049e340()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\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    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }" { (expression_statement "iVar3 = pthread_mutex_unlock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_unlock(__mutex)" identifier = (call_expression "pthread_mutex_unlock(__mutex)" identifier (argument_list "(__mutex)" ( identifier )))) ;) (if_statement "if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" if (parenthesized_expression "(iVar3 != 0)" ( (binary_expression "iVar3 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" { (labeled_statement "LAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);" statement_identifier : (expression_statement "puVar4 = (undefined8 *)FUN_0049e1d0(8);" (assignment_expression "puVar4 = (undefined8 *)FUN_0049e1d0(8)" identifier = (cast_expression "(undefined8 *)FUN_0049e1d0(8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0049e1d0(8)" identifier (argument_list "(8)" ( number_literal ))))) ;)) (expression_statement "*puVar4 = &PTR_FUN_006764c0;" (assignment_expression "*puVar4 = &PTR_FUN_006764c0" (pointer_expression "*puVar4" * identifier) = (pointer_expression "&PTR_FUN_006764c0" & identifier)) ;) (expression_statement "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);" (call_expression "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" identifier (argument_list "(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" ( identifier , (pointer_expression "&PTR_PTR_FUN_00676470" & identifier) , identifier ))) ;) })) })) (expression_statement "FUN_004a0160(param_1,piVar2);" (call_expression "FUN_004a0160(param_1,piVar2)" identifier (argument_list "(param_1,piVar2)" ( identifier , identifier ))) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * (array_declarator IDENT [ LIT ])) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) (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 ( ))) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (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 (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT , (subscript_expression IDENT [ LIT ]) ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (labeled_statement statement_identifier : (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 , (pointer_expression & IDENT) , IDENT ))) ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (return_statement return IDENT ;) })))
(function_definition "undefined8 FUN_004e7c10(undefined8 param_1,undefined8 *param_2)\n\n{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    \n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" (type_identifier "undefined8") (function_declarator "FUN_004e7c10(undefined8 param_1,undefined8 *param_2)" (identifier "FUN_004e7c10") (parameter_list "(undefined8 param_1,undefined8 *param_2)" (( "(") (parameter_declaration "undefined8 param_1" (type_identifier "undefined8") (identifier "param_1")) (, ",") (parameter_declaration "undefined8 *param_2" (type_identifier "undefined8") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int *piVar2;\n  int iVar3;\n  pthread_mutex_t *__mutex;\n  undefined8 *puVar4;\n  char *local_48 [2];\n  char acStack_38 [16];\n  \n  FUN_004e7a60();\n  __mutex = (pthread_mutex_t *)FUN_004e6960();\n  puVar1 = PTR___pthread_key_create_0067bee8;\n  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }\n  piVar2 = DAT_00688b18;\n  DAT_00688b18 = (int *)*param_2;\n  if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }\n                    \n  FUN_004a0170(local_48,param_2);\n  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);\n  if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }\n  if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }\n  if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }\n  FUN_004a0160(param_1,piVar2);\n  return param_1;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "pthread_mutex_t *__mutex;" (type_identifier "pthread_mutex_t") (pointer_declarator "*__mutex" (* "*") (identifier "__mutex")) (; ";")) (declaration "undefined8 *puVar4;" (type_identifier "undefined8") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "char *local_48 [2];" (primitive_type "char") (pointer_declarator "*local_48 [2]" (* "*") (array_declarator "local_48 [2]" (identifier "local_48") ([ "[") (number_literal "2") (] "]"))) (; ";")) (declaration "char acStack_38 [16];" (primitive_type "char") (array_declarator "acStack_38 [16]" (identifier "acStack_38") ([ "[") (number_literal "16") (] "]")) (; ";")) (expression_statement "FUN_004e7a60();" (call_expression "FUN_004e7a60()" (identifier "FUN_004e7a60") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "__mutex = (pthread_mutex_t *)FUN_004e6960();" (assignment_expression "__mutex = (pthread_mutex_t *)FUN_004e6960()" (identifier "__mutex") (= "=") (cast_expression "(pthread_mutex_t *)FUN_004e6960()" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_004e6960()" (identifier "FUN_004e6960") (argument_list "()" (( "(") () ")"))))) (; ";")) (expression_statement "puVar1 = PTR___pthread_key_create_0067bee8;" (assignment_expression "puVar1 = PTR___pthread_key_create_0067bee8" (identifier "puVar1") (= "=") (identifier "PTR___pthread_key_create_0067bee8")) (; ";")) (if_statement "if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" (if "if") (parenthesized_expression "(PTR___pthread_key_create_0067bee8 != (undefined *)0x0)" (( "(") (binary_expression "PTR___pthread_key_create_0067bee8 != (undefined *)0x0" (identifier "PTR___pthread_key_create_0067bee8") (!= "!=") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar3 = pthread_mutex_lock(__mutex);\n    if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }\n  }" ({ "{") (expression_statement "iVar3 = pthread_mutex_lock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_lock(__mutex)" (identifier "iVar3") (= "=") (call_expression "pthread_mutex_lock(__mutex)" (identifier "pthread_mutex_lock") (argument_list "(__mutex)" (( "(") (identifier "__mutex") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0049deb0();\n      goto LAB_004e7cee;\n    }" ({ "{") (expression_statement "FUN_0049deb0();" (call_expression "FUN_0049deb0()" (identifier "FUN_0049deb0") (argument_list "()" (( "(") () ")"))) (; ";")) (goto_statement "goto LAB_004e7cee;" (goto "goto") (statement_identifier "LAB_004e7cee") (; ";")) (} "}"))) (} "}"))) (expression_statement "piVar2 = DAT_00688b18;" (assignment_expression "piVar2 = DAT_00688b18" (identifier "piVar2") (= "=") (identifier "DAT_00688b18")) (; ";")) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" (identifier "DAT_00688b18") (= "=") (cast_expression "(int *)*param_2" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (if_statement "if (puVar1 == (undefined *)0x0) {\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }\n  else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\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    *DAT_00688b18 = *DAT_00688b18 + 1;\n  }" ({ "{") (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" (* "*") (identifier "DAT_00688b18")) (= "=") (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" (* "*") (identifier "DAT_00688b18")) (+ "+") (number_literal "1"))) (; ";")) (} "}")) (else_clause "else {\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" (else "else") (compound_statement "{\n    LOCK();\n    *DAT_00688b18 = *DAT_00688b18 + 1;\n    UNLOCK();\n    DAT_00688b18 = (int *)*param_2;\n  }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "*DAT_00688b18 = *DAT_00688b18 + 1;" (assignment_expression "*DAT_00688b18 = *DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" (* "*") (identifier "DAT_00688b18")) (= "=") (binary_expression "*DAT_00688b18 + 1" (pointer_expression "*DAT_00688b18" (* "*") (identifier "DAT_00688b18")) (+ "+") (number_literal "1"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "DAT_00688b18 = (int *)*param_2;" (assignment_expression "DAT_00688b18 = (int *)*param_2" (identifier "DAT_00688b18") (= "=") (cast_expression "(int *)*param_2" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_2" (* "*") (identifier "param_2")))) (; ";")) (} "}")))) (expression_statement "FUN_004a0170(local_48,param_2);" (call_expression "FUN_004a0170(local_48,param_2)" (identifier "FUN_004a0170") (argument_list "(local_48,param_2)" (( "(") (identifier "local_48") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "iVar3 = FUN_004a7120(local_48,&DAT_005882bd);" (assignment_expression "iVar3 = FUN_004a7120(local_48,&DAT_005882bd)" (identifier "iVar3") (= "=") (call_expression "FUN_004a7120(local_48,&DAT_005882bd)" (identifier "FUN_004a7120") (argument_list "(local_48,&DAT_005882bd)" (( "(") (identifier "local_48") (, ",") (pointer_expression "&DAT_005882bd" (& "&") (identifier "DAT_005882bd")) () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\n    setlocale(6,local_48[0]);\n  }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    setlocale(6,local_48[0]);\n  }" ({ "{") (expression_statement "setlocale(6,local_48[0]);" (call_expression "setlocale(6,local_48[0])" (identifier "setlocale") (argument_list "(6,local_48[0])" (( "(") (number_literal "6") (, ",") (subscript_expression "local_48[0]" (identifier "local_48") ([ "[") (number_literal "0") (] "]")) () ")"))) (; ";")) (} "}"))) (if_statement "if (local_48[0] != acStack_38) {\n    FUN_0049e340();\n  }" (if "if") (parenthesized_expression "(local_48[0] != acStack_38)" (( "(") (binary_expression "local_48[0] != acStack_38" (subscript_expression "local_48[0]" (identifier "local_48") ([ "[") (number_literal "0") (] "]")) (!= "!=") (identifier "acStack_38")) () ")")) (compound_statement "{\n    FUN_0049e340();\n  }" ({ "{") (expression_statement "FUN_0049e340();" (call_expression "FUN_0049e340()" (identifier "FUN_0049e340") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (if_statement "if (puVar1 != (undefined *)0x0) {\n    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\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    iVar3 = pthread_mutex_unlock(__mutex);\n    if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }\n  }" ({ "{") (expression_statement "iVar3 = pthread_mutex_unlock(__mutex);" (assignment_expression "iVar3 = pthread_mutex_unlock(__mutex)" (identifier "iVar3") (= "=") (call_expression "pthread_mutex_unlock(__mutex)" (identifier "pthread_mutex_unlock") (argument_list "(__mutex)" (( "(") (identifier "__mutex") () ")")))) (; ";")) (if_statement "if (iVar3 != 0) {\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" (if "if") (parenthesized_expression "(iVar3 != 0)" (( "(") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\nLAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);\n      *puVar4 = &PTR_FUN_006764c0;\n                    \n                    \n      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);\n    }" ({ "{") (labeled_statement "LAB_004e7cee:\n      puVar4 = (undefined8 *)FUN_0049e1d0(8);" (statement_identifier "LAB_004e7cee") (: ":") (expression_statement "puVar4 = (undefined8 *)FUN_0049e1d0(8);" (assignment_expression "puVar4 = (undefined8 *)FUN_0049e1d0(8)" (identifier "puVar4") (= "=") (cast_expression "(undefined8 *)FUN_0049e1d0(8)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0049e1d0(8)" (identifier "FUN_0049e1d0") (argument_list "(8)" (( "(") (number_literal "8") () ")"))))) (; ";"))) (expression_statement "*puVar4 = &PTR_FUN_006764c0;" (assignment_expression "*puVar4 = &PTR_FUN_006764c0" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (pointer_expression "&PTR_FUN_006764c0" (& "&") (identifier "PTR_FUN_006764c0"))) (; ";")) (expression_statement "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);" (call_expression "FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" (identifier "FUN_0049cef0") (argument_list "(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30)" (( "(") (identifier "puVar4") (, ",") (pointer_expression "&PTR_PTR_FUN_00676470" (& "&") (identifier "PTR_PTR_FUN_00676470")) (, ",") (identifier "FUN_0049de30") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "FUN_004a0160(param_1,piVar2);" (call_expression "FUN_004a0160(param_1,piVar2)" (identifier "FUN_004a0160") (argument_list "(param_1,piVar2)" (( "(") (identifier "param_1") (, ",") (identifier "piVar2") () ")"))) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

/* std::locale::global(std::locale const&) */

var_18 * __thiscall std::var_18::global(var_18 *this,var_18 *param_1)

{
  type_1 *var_7;
  type_2 *p_Var2;
  int var_5;
  type_3 *__mutex;
  type_4 *puVar4;
  char *local_48 [2];
  char var_13 [16];
  
  var_1();
  __mutex = (type_3 *)::(anonymous_namespace)::var_2();
  var_7 = var_3;
  if (var_3 != (type_1 *)0x0) {
    var_5 = var_4(__mutex);
    if (var_5 != 0) {
      var_6();
      goto LAB_004e7cee;
    }
  }
  p_Var2 = _S_global;
  _S_global = *(type_2 **)param_1;
  if (var_7 == (type_1 *)0x0) {
    *(int *)_S_global = *(int *)_S_global + 1;
  }
  else {
    var_8();
    *(int *)_S_global = *(int *)_S_global + 1;
    var_9();
    _S_global = *(type_2 **)param_1;
  }
                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */
  var_10();
  var_5 = std::string::var_11((type_5 *)local_48,"*");
  if (var_5 != 0) {
    var_12(6,local_48[0]);
  }
  if (local_48[0] != var_13) {
    var_14(local_48[0]);
  }
  if (var_7 != (type_1 *)0x0) {
    var_5 = var_15(__mutex);
    if (var_5 != 0) {
LAB_004e7cee:
      puVar4 = (type_4 *)var_16(8);
      *puVar4 = &PTR____concurrence_unlock_error_006764c0;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */
      var_17(puVar4,&__concurrence_unlock_error::typeinfo,
                  __concurrence_unlock_error::~__concurrence_unlock_error);
    }
  }
  var_18(this,p_Var2);
  return this;
}


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

undefined8 MASKED(undefined8 param_1,undefined8 *param_2)

{
  undefined *puVar1;
  int *piVar2;
  int iVar3;
  pthread_mutex_t *__mutex;
  undefined8 *puVar4;
  char *local_48 [2];
  char acStack_38 [16];
  
  FUN_004e7a60();
  __mutex = (pthread_mutex_t *)FUN_004e6960();
  puVar1 = PTR___pthread_key_create_0067bee8;
  if (PTR___pthread_key_create_0067bee8 != (undefined *)0x0) {
    iVar3 = pthread_mutex_lock(__mutex);
    if (iVar3 != 0) {
      FUN_0049deb0();
      goto LAB_004e7cee;
    }
  }
  piVar2 = DAT_00688b18;
  DAT_00688b18 = (int *)*param_2;
  if (puVar1 == (undefined *)0x0) {
    *DAT_00688b18 = *DAT_00688b18 + 1;
  }
  else {
    LOCK();
    *DAT_00688b18 = *DAT_00688b18 + 1;
    UNLOCK();
    DAT_00688b18 = (int *)*param_2;
  }
                    /* try { // try from 004e7c74 to 004e7c78 has its CatchHandler @ 004e7d1c */
  FUN_004a0170(local_48,param_2);
  iVar3 = FUN_004a7120(local_48,&DAT_005882bd);
  if (iVar3 != 0) {
    setlocale(6,local_48[0]);
  }
  if (local_48[0] != acStack_38) {
    FUN_0049e340();
  }
  if (puVar1 != (undefined *)0x0) {
    iVar3 = pthread_mutex_unlock(__mutex);
    if (iVar3 != 0) {
LAB_004e7cee:
      puVar4 = (undefined8 *)FUN_0049e1d0(8);
      *puVar4 = &PTR_FUN_006764c0;
                    /* WARNING: Subroutine does not return */
                    /* try { // try from 004e7d17 to 004e7d1b has its CatchHandler @ 004e7d24 */
      FUN_0049cef0(puVar4,&PTR_PTR_FUN_00676470,FUN_0049de30);
    }
  }
  FUN_004a0160(param_1,piVar2);
  return param_1;
}

