
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "DT": Some values do not have unique names */
/* DWARF original prototype: void run_once(Once * this, void * arg) */

void __thiscall gold::Once::run_once(Once *this,void *arg)

{
  uint32_t *puVar1;
  uint32_t uVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  
  if ((parameters->options_ == (General_options *)0x0) ||
     ((parameters->options_->threads_).value != false)) {
    puVar1 = &this->was_run_lock_;
    do {
      LOCK();
      uVar2 = *puVar1;
      if (uVar2 == 0) {
        *puVar1 = 1;
      }
      UNLOCK();
    } while (uVar2 != 0);
    do {
      LOCK();
      uVar2 = *puVar1;
      if (uVar2 == 1) {
        *puVar1 = 0;
      }
      UNLOCK();
    } while (uVar2 != 1);
    if (this->was_run_ == false) {
      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);
      if (iVar3 == 0) {
        once_pointer = this;
        once_arg = arg;
        iVar3 = pthread_once(&this->once_->once_,c_run_once);
        if (iVar3 == 0) {
          once_pointer = (Once *)0x0;
          once_arg = (void *)0x0;
          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);
          if (iVar3 == 0) {
            return;
          }
          pcVar4 = strerror(iVar3);
          pcVar5 = "pthread_mutex_unlock failed: %s";
        }
        else {
          pcVar4 = strerror(iVar3);
          pcVar5 = "pthread_once failed: %s";
        }
      }
      else {
        pcVar4 = strerror(iVar3);
        pcVar5 = "pthread_mutex_lock failed: %s";
      }
      pcVar5 = (char *)gettext(pcVar5);
                    /* WARNING: Subroutine does not return */
      gold_fatal(pcVar5,pcVar4);
    }
  }
  else if (this->was_run_ == false) {
    (*this->_vptr_Once[2])(this,arg);
    this->was_run_ = true;
    return;
  }
  return;
}



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

int FUN_0006cdc0(int *param_1,undefined4 param_2)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  undefined4 uVar5;
  bool bVar6;
  
  iVar2 = *(int *)(DAT_0038f378 + 8);
  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {
    piVar1 = param_1 + 2;
    do {
      LOCK();
      iVar2 = *piVar1;
      if (iVar2 == 0) {
        *piVar1 = 1;
      }
      UNLOCK();
    } while (iVar2 != 0);
    do {
      LOCK();
      iVar2 = *piVar1;
      bVar6 = iVar2 == 1;
      if (bVar6) {
        *piVar1 = 0;
        iVar2 = 1;
      }
      UNLOCK();
    } while (!bVar6);
    if ((char)param_1[1] == '\0') {
      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);
      if (iVar2 == 0) {
        DAT_0038f490 = param_1;
        DAT_0038f48c = param_2;
        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);
        if (iVar2 == 0) {
          DAT_0038f490 = (int *)0x0;
          DAT_0038f48c = 0;
          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);
          if (iVar2 == 0) {
            return 0;
          }
          pcVar3 = strerror(iVar2);
          pcVar4 = "pthread_mutex_unlock failed: %s";
        }
        else {
          pcVar3 = strerror(iVar2);
          pcVar4 = "pthread_once failed: %s";
        }
      }
      else {
        pcVar3 = strerror(iVar2);
        pcVar4 = "pthread_mutex_lock failed: %s";
      }
      uVar5 = gettext(pcVar4);
                    /* WARNING: Subroutine does not return */
      FUN_00065450(uVar5,pcVar3);
    }
  }
  else if ((char)param_1[1] == '\0') {
    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);
    *(undefined1 *)(param_1 + 1) = 1;
    return iVar2;
  }
  return iVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x322237
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
LEA EAX,[EBX + 0x378]
MOV EAX,dword ptr [EAX]
MOV EAX,dword ptr [EAX + 0x8]
TEST EAX,EAX
JZ 0x0006cdf2
CMP byte ptr [EAX + 0x3d69],0x0
JZ 0x0006ceb8
LEA EDX,[ESI + 0x8]
XOR EDI,EDI
MOV ECX,0x1
MOV EAX,EDI
CMPXCHG.LOCK dword ptr [EDX],ECX
JNZ 0x0006cdfc
MOVZX ECX,byte ptr [ESI + 0x4]
MOV EBP,0x1
XOR EDI,EDI
MOV EAX,EBP
CMPXCHG.LOCK dword ptr [EDX],EDI
JNZ 0x0006ce0f
TEST CL,CL
JZ 0x0006ce28
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
LEA EDI,[EBX + 0x494]
PUSH EDI
CALL 0x000297c0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0006cede
MOV EAX,dword ptr [ESP + 0x24]
SUB ESP,0x8
MOV dword ptr [EBX + 0x490],ESI
MOV dword ptr [EBX + 0x48c],EAX
LEA EAX,[EBX + 0xffcdd7a0]
PUSH EAX
PUSH dword ptr [ESI + 0xc]
CALL 0x000290b0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0006cef1
MOV dword ptr [EBX + 0x490],0x0
SUB ESP,0xc
PUSH EDI
MOV dword ptr [EBX + 0x48c],0x0
CALL 0x00029500
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0006ce1b
SUB ESP,0xc
PUSH EAX
CALL 0x00029100
MOV ESI,EAX
LEA EAX,[EBX + 0xffef8a84]
MOV dword ptr [ESP],EAX
CALL 0x000293b0
POP EDX
POP ECX
PUSH ESI
PUSH EAX
CALL 0x00065450
CMP byte ptr [ESI + 0x4],0x0
JNZ 0x0006ce1b
SUB ESP,0x8
MOV EAX,dword ptr [ESI]
PUSH dword ptr [ESP + 0x2c]
PUSH ESI
CALL dword ptr [EAX + 0x8]
MOV byte ptr [ESI + 0x4],0x1
ADD ESP,0x10
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EAX
CALL 0x00029100
MOV ESI,EAX
LEA EAX,[EBX + 0xffef8b51]
JMP 0x0006cea4
SUB ESP,0xc
PUSH EAX
CALL 0x00029100
MOV ESI,EAX
LEA EAX,[EBX + 0xffef8bc7]
JMP 0x0006cea4
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_0006cdc0(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}\n\n" comment (function_definition "int FUN_0006cdc0(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_0006cdc0(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "bool bVar6;" primitive_type identifier ;) (expression_statement "iVar2 = *(int *)(DAT_0038f378 + 8);" (assignment_expression "iVar2 = *(int *)(DAT_0038f378 + 8)" identifier = (pointer_expression "*(int *)(DAT_0038f378 + 8)" * (cast_expression "(int *)(DAT_0038f378 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0038f378 + 8)" ( (binary_expression "DAT_0038f378 + 8" identifier + number_literal) ))))) ;) (if_statement "if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" if (parenthesized_expression "((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0'))" ( (binary_expression "(iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) || (parenthesized_expression "(*(char *)(iVar2 + 0x3d69) != '\0')" ( (binary_expression "*(char *)(iVar2 + 0x3d69) != '\0'" (pointer_expression "*(char *)(iVar2 + 0x3d69)" * (cast_expression "(char *)(iVar2 + 0x3d69)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0x3d69)" ( (binary_expression "iVar2 + 0x3d69" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }\n  }" { (expression_statement "piVar1 = param_1 + 2;" (assignment_expression "piVar1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);" do (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (if_statement "if (iVar2 == 0) {\n        *piVar1 = 1;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        *piVar1 = 1;\n      }" { (expression_statement "*piVar1 = 1;" (assignment_expression "*piVar1 = 1" (pointer_expression "*piVar1" * identifier) = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) ;) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);" do (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "bVar6 = iVar2 == 1;" (assignment_expression "bVar6 = iVar2 == 1" identifier = (binary_expression "iVar2 == 1" identifier == number_literal)) ;) (if_statement "if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" if (parenthesized_expression "(bVar6)" ( identifier )) (compound_statement "{\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" { (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(!bVar6)" ( (unary_expression "!bVar6" ! identifier) )) ;) (if_statement "if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }" if (parenthesized_expression "((char)param_1[1] == '\0')" ( (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    /* WARNING: Subroutine does not return */\n      FUN_00065450(uVar5,pcVar3);\n    }" { (expression_statement "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" identifier = (call_expression "pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" identifier (argument_list "((pthread_mutex_t *)&DAT_0038f494)" ( (cast_expression "(pthread_mutex_t *)&DAT_0038f494" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0038f494" & identifier)) )))) ;) (if_statement "if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }" { (expression_statement "DAT_0038f490 = param_1;" (assignment_expression "DAT_0038f490 = param_1" identifier = identifier) ;) (expression_statement "DAT_0038f48c = param_2;" (assignment_expression "DAT_0038f48c = param_2" identifier = identifier) ;) (expression_statement "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);" (assignment_expression "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" identifier = (call_expression "pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" identifier (argument_list "((pthread_once_t *)param_1[3],FUN_0006c7a0)" ( (cast_expression "(pthread_once_t *)param_1[3]" ( (type_descriptor "pthread_once_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }" { (expression_statement "DAT_0038f490 = (int *)0x0;" (assignment_expression "DAT_0038f490 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "DAT_0038f48c = 0;" (assignment_expression "DAT_0038f48c = 0" identifier = number_literal) ;) (expression_statement "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" identifier = (call_expression "pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" identifier (argument_list "((pthread_mutex_t *)&DAT_0038f494)" ( (cast_expression "(pthread_mutex_t *)&DAT_0038f494" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0038f494" & identifier)) )))) ;) (if_statement "if (iVar2 == 0) {\n            return 0;\n          }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n            return 0;\n          }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_mutex_unlock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_unlock failed: %s"" identifier = (string_literal ""pthread_mutex_unlock failed: %s"" " string_content ")) ;) }) (else_clause "else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" else (compound_statement "{\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" { (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_once failed: %s";" (assignment_expression "pcVar4 = "pthread_once failed: %s"" identifier = (string_literal ""pthread_once failed: %s"" " string_content ")) ;) }))) }) (else_clause "else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" else (compound_statement "{\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" { (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_mutex_lock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_lock failed: %s"" identifier = (string_literal ""pthread_mutex_lock failed: %s"" " string_content ")) ;) }))) (expression_statement "uVar5 = gettext(pcVar4);" (assignment_expression "uVar5 = gettext(pcVar4)" identifier = (call_expression "gettext(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier )))) ;) comment (expression_statement "FUN_00065450(uVar5,pcVar3);" (call_expression "FUN_00065450(uVar5,pcVar3)" identifier (argument_list "(uVar5,pcVar3)" ( identifier , identifier ))) ;) })) }) (else_clause "else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" else (if_statement "if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" if (parenthesized_expression "((char)param_1[1] == '\0')" ( (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" { (expression_statement "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2)" identifier = (call_expression "(**(code **)(*param_1 + 8))(param_1,param_2)" (parenthesized_expression "(**(code **)(*param_1 + 8))" ( (pointer_expression "**(code **)(*param_1 + 8)" * (pointer_expression "*(code **)(*param_1 + 8)" * (cast_expression "(code **)(*param_1 + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 8)" ( (binary_expression "*param_1 + 8" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" * (cast_expression "(undefined1 *)(param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (return_statement "return iVar2;" return identifier ;) })))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "DT": Some values do not have unique names */\n/* DWARF original prototype: void run_once(Once * this, void * arg) */\n\nvoid __thiscall gold::Once::run_once(Once *this,void *arg)\n\n{\n  uint32_t *puVar1;\n  uint32_t uVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  if ((parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false)) {\n    puVar1 = &this->was_run_lock_;\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);\n    if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }\n  }\n  else if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }\n  return;\n}\n\n" comment comment comment (function_definition "void __thiscall gold::Once::run_once(Once *this,void *arg)\n\n{\n  uint32_t *puVar1;\n  uint32_t uVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  if ((parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false)) {\n    puVar1 = &this->was_run_lock_;\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);\n    if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }\n  }\n  else if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "gold::Once::" identifier : : identifier : :) (function_declarator "run_once(Once *this,void *arg)" identifier (parameter_list "(Once *this,void *arg)" ( (parameter_declaration "Once *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "void *arg" primitive_type (pointer_declarator "*arg" * identifier)) ))) (compound_statement "{\n  uint32_t *puVar1;\n  uint32_t uVar2;\n  int iVar3;\n  char *pcVar4;\n  char *pcVar5;\n  \n  if ((parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false)) {\n    puVar1 = &this->was_run_lock_;\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);\n    if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }\n  }\n  else if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }\n  return;\n}" { (declaration "uint32_t *puVar1;" primitive_type (pointer_declarator "*puVar1" * identifier) ;) (declaration "uint32_t uVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (if_statement "if ((parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false)) {\n    puVar1 = &this->was_run_lock_;\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);\n    if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }\n  }\n  else if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }" if (parenthesized_expression "((parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false))" ( (binary_expression "(parameters->options_ == (General_options *)0x0) ||\n     ((parameters->options_->threads_).value != false)" (parenthesized_expression "(parameters->options_ == (General_options *)0x0)" ( (binary_expression "parameters->options_ == (General_options *)0x0" (field_expression "parameters->options_" identifier -> field_identifier) == (cast_expression "(General_options *)0x0" ( (type_descriptor "General_options *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "((parameters->options_->threads_).value != false)" ( (binary_expression "(parameters->options_->threads_).value != false" (field_expression "(parameters->options_->threads_).value" (parenthesized_expression "(parameters->options_->threads_)" ( (field_expression "parameters->options_->threads_" (field_expression "parameters->options_" identifier -> field_identifier) -> field_identifier) )) . field_identifier) != false) ))) )) (compound_statement "{\n    puVar1 = &this->was_run_lock_;\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);\n    do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);\n    if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }\n  }" { (expression_statement "puVar1 = &this->was_run_lock_;" (assignment_expression "puVar1 = &this->was_run_lock_" identifier = (pointer_expression "&this->was_run_lock_" & (field_expression "this->was_run_lock_" identifier -> field_identifier))) ;) (do_statement "do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    } while (uVar2 != 0);" do (compound_statement "{\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 0) {\n        *puVar1 = 1;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "uVar2 = *puVar1;" (assignment_expression "uVar2 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (if_statement "if (uVar2 == 0) {\n        *puVar1 = 1;\n      }" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        *puVar1 = 1;\n      }" { (expression_statement "*puVar1 = 1;" (assignment_expression "*puVar1 = 1" (pointer_expression "*puVar1" * identifier) = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(uVar2 != 0)" ( (binary_expression "uVar2 != 0" identifier != number_literal) )) ;) (do_statement "do {\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    } while (uVar2 != 1);" do (compound_statement "{\n      LOCK();\n      uVar2 = *puVar1;\n      if (uVar2 == 1) {\n        *puVar1 = 0;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "uVar2 = *puVar1;" (assignment_expression "uVar2 = *puVar1" identifier = (pointer_expression "*puVar1" * identifier)) ;) (if_statement "if (uVar2 == 1) {\n        *puVar1 = 0;\n      }" if (parenthesized_expression "(uVar2 == 1)" ( (binary_expression "uVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        *puVar1 = 0;\n      }" { (expression_statement "*puVar1 = 0;" (assignment_expression "*puVar1 = 0" (pointer_expression "*puVar1" * identifier) = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(uVar2 != 1)" ( (binary_expression "uVar2 != 1" identifier != number_literal) )) ;) (if_statement "if (this->was_run_ == false) {\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }" if (parenthesized_expression "(this->was_run_ == false)" ( (binary_expression "this->was_run_ == false" (field_expression "this->was_run_" identifier -> field_identifier) == false) )) (compound_statement "{\n      iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);\n      if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }\n      pcVar5 = (char *)gettext(pcVar5);\n                    /* WARNING: Subroutine does not return */\n      gold_fatal(pcVar5,pcVar4);\n    }" { (expression_statement "iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control);" (assignment_expression "iVar3 = pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control)" identifier = (call_expression "pthread_mutex_lock((pthread_mutex_t *)&once_pointer_control)" identifier (argument_list "((pthread_mutex_t *)&once_pointer_control)" ( (cast_expression "(pthread_mutex_t *)&once_pointer_control" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&once_pointer_control" & identifier)) )))) ;) (if_statement "if (iVar3 == 0) {\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        once_pointer = this;\n        once_arg = arg;\n        iVar3 = pthread_once(&this->once_->once_,c_run_once);\n        if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }\n      }" { (expression_statement "once_pointer = this;" (assignment_expression "once_pointer = this" identifier = identifier) ;) (expression_statement "once_arg = arg;" (assignment_expression "once_arg = arg" identifier = identifier) ;) (expression_statement "iVar3 = pthread_once(&this->once_->once_,c_run_once);" (assignment_expression "iVar3 = pthread_once(&this->once_->once_,c_run_once)" identifier = (call_expression "pthread_once(&this->once_->once_,c_run_once)" identifier (argument_list "(&this->once_->once_,c_run_once)" ( (pointer_expression "&this->once_->once_" & (field_expression "this->once_->once_" (field_expression "this->once_" identifier -> field_identifier) -> field_identifier)) , identifier )))) ;) (if_statement "if (iVar3 == 0) {\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n          once_pointer = (Once *)0x0;\n          once_arg = (void *)0x0;\n          iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);\n          if (iVar3 == 0) {\n            return;\n          }\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_mutex_unlock failed: %s";\n        }" { (expression_statement "once_pointer = (Once *)0x0;" (assignment_expression "once_pointer = (Once *)0x0" identifier = (cast_expression "(Once *)0x0" ( (type_descriptor "Once *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "once_arg = (void *)0x0;" (assignment_expression "once_arg = (void *)0x0" identifier = (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control);" (assignment_expression "iVar3 = pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control)" identifier = (call_expression "pthread_mutex_unlock((pthread_mutex_t *)&once_pointer_control)" identifier (argument_list "((pthread_mutex_t *)&once_pointer_control)" ( (cast_expression "(pthread_mutex_t *)&once_pointer_control" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&once_pointer_control" & identifier)) )))) ;) (if_statement "if (iVar3 == 0) {\n            return;\n          }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n            return;\n          }" { (return_statement "return;" return ;) })) (expression_statement "pcVar4 = strerror(iVar3);" (assignment_expression "pcVar4 = strerror(iVar3)" identifier = (call_expression "strerror(iVar3)" identifier (argument_list "(iVar3)" ( identifier )))) ;) (expression_statement "pcVar5 = "pthread_mutex_unlock failed: %s";" (assignment_expression "pcVar5 = "pthread_mutex_unlock failed: %s"" identifier = (string_literal ""pthread_mutex_unlock failed: %s"" " string_content ")) ;) }) (else_clause "else {\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }" else (compound_statement "{\n          pcVar4 = strerror(iVar3);\n          pcVar5 = "pthread_once failed: %s";\n        }" { (expression_statement "pcVar4 = strerror(iVar3);" (assignment_expression "pcVar4 = strerror(iVar3)" identifier = (call_expression "strerror(iVar3)" identifier (argument_list "(iVar3)" ( identifier )))) ;) (expression_statement "pcVar5 = "pthread_once failed: %s";" (assignment_expression "pcVar5 = "pthread_once failed: %s"" identifier = (string_literal ""pthread_once failed: %s"" " string_content ")) ;) }))) }) (else_clause "else {\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }" else (compound_statement "{\n        pcVar4 = strerror(iVar3);\n        pcVar5 = "pthread_mutex_lock failed: %s";\n      }" { (expression_statement "pcVar4 = strerror(iVar3);" (assignment_expression "pcVar4 = strerror(iVar3)" identifier = (call_expression "strerror(iVar3)" identifier (argument_list "(iVar3)" ( identifier )))) ;) (expression_statement "pcVar5 = "pthread_mutex_lock failed: %s";" (assignment_expression "pcVar5 = "pthread_mutex_lock failed: %s"" identifier = (string_literal ""pthread_mutex_lock failed: %s"" " string_content ")) ;) }))) (expression_statement "pcVar5 = (char *)gettext(pcVar5);" (assignment_expression "pcVar5 = (char *)gettext(pcVar5)" identifier = (cast_expression "(char *)gettext(pcVar5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "gettext(pcVar5)" identifier (argument_list "(pcVar5)" ( identifier ))))) ;) comment (expression_statement "gold_fatal(pcVar5,pcVar4);" (call_expression "gold_fatal(pcVar5,pcVar4)" identifier (argument_list "(pcVar5,pcVar4)" ( identifier , identifier ))) ;) })) }) (else_clause "else if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }" else (if_statement "if (this->was_run_ == false) {\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }" if (parenthesized_expression "(this->was_run_ == false)" ( (binary_expression "this->was_run_ == false" (field_expression "this->was_run_" identifier -> field_identifier) == false) )) (compound_statement "{\n    (*this->_vptr_Once[2])(this,arg);\n    this->was_run_ = true;\n    return;\n  }" { (expression_statement "(*this->_vptr_Once[2])(this,arg);" (call_expression "(*this->_vptr_Once[2])(this,arg)" (parenthesized_expression "(*this->_vptr_Once[2])" ( (pointer_expression "*this->_vptr_Once[2]" * (subscript_expression "this->_vptr_Once[2]" (field_expression "this->_vptr_Once" identifier -> field_identifier) [ number_literal ])) )) (argument_list "(this,arg)" ( identifier , identifier ))) ;) (expression_statement "this->was_run_ = true;" (assignment_expression "this->was_run_ = true" (field_expression "this->was_run_" identifier -> field_identifier) = true) ;) (return_statement "return;" return ;) })))) (return_statement "return;" return ;) })))
(translation_unit "int FUN_0006cdc0(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}\n\n" (function_definition "int FUN_0006cdc0(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" primitive_type (function_declarator "FUN_0006cdc0(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "bool bVar6;" primitive_type identifier ;) (expression_statement "iVar2 = *(int *)(DAT_0038f378 + 8);" (assignment_expression "iVar2 = *(int *)(DAT_0038f378 + 8)" identifier = (pointer_expression "*(int *)(DAT_0038f378 + 8)" * (cast_expression "(int *)(DAT_0038f378 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(DAT_0038f378 + 8)" ( (binary_expression "DAT_0038f378 + 8" identifier + number_literal) ))))) ;) (if_statement "if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" if (parenthesized_expression "((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0'))" ( (binary_expression "(iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) || (parenthesized_expression "(*(char *)(iVar2 + 0x3d69) != '\0')" ( (binary_expression "*(char *)(iVar2 + 0x3d69) != '\0'" (pointer_expression "*(char *)(iVar2 + 0x3d69)" * (cast_expression "(char *)(iVar2 + 0x3d69)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0x3d69)" ( (binary_expression "iVar2 + 0x3d69" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }" { (expression_statement "piVar1 = param_1 + 2;" (assignment_expression "piVar1 = param_1 + 2" identifier = (binary_expression "param_1 + 2" identifier + number_literal)) ;) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);" do (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (if_statement "if (iVar2 == 0) {\n        *piVar1 = 1;\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        *piVar1 = 1;\n      }" { (expression_statement "*piVar1 = 1;" (assignment_expression "*piVar1 = 1" (pointer_expression "*piVar1" * identifier) = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) ;) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);" do (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "bVar6 = iVar2 == 1;" (assignment_expression "bVar6 = iVar2 == 1" identifier = (binary_expression "iVar2 == 1" identifier == number_literal)) ;) (if_statement "if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" if (parenthesized_expression "(bVar6)" ( identifier )) (compound_statement "{\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" { (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" * identifier) = number_literal) ;) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" identifier = number_literal) ;) })) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }) while (parenthesized_expression "(!bVar6)" ( (unary_expression "!bVar6" ! identifier) )) ;) (if_statement "if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }" if (parenthesized_expression "((char)param_1[1] == '\0')" ( (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }" { (expression_statement "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" identifier = (call_expression "pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" identifier (argument_list "((pthread_mutex_t *)&DAT_0038f494)" ( (cast_expression "(pthread_mutex_t *)&DAT_0038f494" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0038f494" & identifier)) )))) ;) (if_statement "if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }" { (expression_statement "DAT_0038f490 = param_1;" (assignment_expression "DAT_0038f490 = param_1" identifier = identifier) ;) (expression_statement "DAT_0038f48c = param_2;" (assignment_expression "DAT_0038f48c = param_2" identifier = identifier) ;) (expression_statement "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);" (assignment_expression "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" identifier = (call_expression "pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" identifier (argument_list "((pthread_once_t *)param_1[3],FUN_0006c7a0)" ( (cast_expression "(pthread_once_t *)param_1[3]" ( (type_descriptor "pthread_once_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) , identifier )))) ;) (if_statement "if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }" { (expression_statement "DAT_0038f490 = (int *)0x0;" (assignment_expression "DAT_0038f490 = (int *)0x0" identifier = (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "DAT_0038f48c = 0;" (assignment_expression "DAT_0038f48c = 0" identifier = number_literal) ;) (expression_statement "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" identifier = (call_expression "pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" identifier (argument_list "((pthread_mutex_t *)&DAT_0038f494)" ( (cast_expression "(pthread_mutex_t *)&DAT_0038f494" ( (type_descriptor "pthread_mutex_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0038f494" & identifier)) )))) ;) (if_statement "if (iVar2 == 0) {\n            return 0;\n          }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n            return 0;\n          }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_mutex_unlock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_unlock failed: %s"" identifier = (string_literal ""pthread_mutex_unlock failed: %s"" " string_content ")) ;) }) (else_clause "else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" else (compound_statement "{\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" { (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_once failed: %s";" (assignment_expression "pcVar4 = "pthread_once failed: %s"" identifier = (string_literal ""pthread_once failed: %s"" " string_content ")) ;) }))) }) (else_clause "else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" else (compound_statement "{\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" { (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" identifier = (call_expression "strerror(iVar2)" identifier (argument_list "(iVar2)" ( identifier )))) ;) (expression_statement "pcVar4 = "pthread_mutex_lock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_lock failed: %s"" identifier = (string_literal ""pthread_mutex_lock failed: %s"" " string_content ")) ;) }))) (expression_statement "uVar5 = gettext(pcVar4);" (assignment_expression "uVar5 = gettext(pcVar4)" identifier = (call_expression "gettext(pcVar4)" identifier (argument_list "(pcVar4)" ( identifier )))) ;) (expression_statement "FUN_00065450(uVar5,pcVar3);" (call_expression "FUN_00065450(uVar5,pcVar3)" identifier (argument_list "(uVar5,pcVar3)" ( identifier , identifier ))) ;) })) }) (else_clause "else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" else (if_statement "if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" if (parenthesized_expression "((char)param_1[1] == '\0')" ( (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" { (expression_statement "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2)" identifier = (call_expression "(**(code **)(*param_1 + 8))(param_1,param_2)" (parenthesized_expression "(**(code **)(*param_1 + 8))" ( (pointer_expression "**(code **)(*param_1 + 8)" * (pointer_expression "*(code **)(*param_1 + 8)" * (cast_expression "(code **)(*param_1 + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 8)" ( (binary_expression "*param_1 + 8" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" * (cast_expression "(undefined1 *)(param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (return_statement "return iVar2;" return 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 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 IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (char_literal ' escape_sequence ')) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (do_statement do (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (do_statement do (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT == LIT)) ;) (if_statement if (parenthesized_expression ( IDENT )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }) while (parenthesized_expression ( (unary_expression ! IDENT) )) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) , 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 *)) ) LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (return_statement return IDENT ;) })))) (return_statement return IDENT ;) })))
(function_definition "int FUN_0006cdc0(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" (primitive_type "int") (function_declarator "FUN_0006cdc0(int *param_1,undefined4 param_2)" (identifier "FUN_0006cdc0") (parameter_list "(int *param_1,undefined4 param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char *pcVar3;\n  char *pcVar4;\n  undefined4 uVar5;\n  bool bVar6;\n  \n  iVar2 = *(int *)(DAT_0038f378 + 8);\n  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }\n  return iVar2;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "char *pcVar4;" (primitive_type "char") (pointer_declarator "*pcVar4" (* "*") (identifier "pcVar4")) (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "bool bVar6;" (primitive_type "bool") (identifier "bVar6") (; ";")) (expression_statement "iVar2 = *(int *)(DAT_0038f378 + 8);" (assignment_expression "iVar2 = *(int *)(DAT_0038f378 + 8)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(DAT_0038f378 + 8)" (* "*") (cast_expression "(int *)(DAT_0038f378 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(DAT_0038f378 + 8)" (( "(") (binary_expression "DAT_0038f378 + 8" (identifier "DAT_0038f378") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (if_statement "if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }\n  else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" (if "if") (parenthesized_expression "((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0'))" (( "(") (binary_expression "(iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')" (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(*(char *)(iVar2 + 0x3d69) != '\0')" (( "(") (binary_expression "*(char *)(iVar2 + 0x3d69) != '\0'" (pointer_expression "*(char *)(iVar2 + 0x3d69)" (* "*") (cast_expression "(char *)(iVar2 + 0x3d69)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0x3d69)" (( "(") (binary_expression "iVar2 + 0x3d69" (identifier "iVar2") (+ "+") (number_literal "0x3d69")) () ")")))) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")"))) () ")")) (compound_statement "{\n    piVar1 = param_1 + 2;\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);\n    do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);\n    if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }\n  }" ({ "{") (expression_statement "piVar1 = param_1 + 2;" (assignment_expression "piVar1 = param_1 + 2" (identifier "piVar1") (= "=") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2"))) (; ";")) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    } while (iVar2 != 0);" (do "do") (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      if (iVar2 == 0) {\n        *piVar1 = 1;\n      }\n      UNLOCK();\n    }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" (identifier "iVar2") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (if_statement "if (iVar2 == 0) {\n        *piVar1 = 1;\n      }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        *piVar1 = 1;\n      }" ({ "{") (expression_statement "*piVar1 = 1;" (assignment_expression "*piVar1 = 1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (; ";")) (do_statement "do {\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    } while (!bVar6);" (do "do") (compound_statement "{\n      LOCK();\n      iVar2 = *piVar1;\n      bVar6 = iVar2 == 1;\n      if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }\n      UNLOCK();\n    }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" (identifier "iVar2") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (expression_statement "bVar6 = iVar2 == 1;" (assignment_expression "bVar6 = iVar2 == 1" (identifier "bVar6") (= "=") (binary_expression "iVar2 == 1" (identifier "iVar2") (== "==") (number_literal "1"))) (; ";")) (if_statement "if (bVar6) {\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" (if "if") (parenthesized_expression "(bVar6)" (( "(") (identifier "bVar6") () ")")) (compound_statement "{\n        *piVar1 = 0;\n        iVar2 = 1;\n      }" ({ "{") (expression_statement "*piVar1 = 0;" (assignment_expression "*piVar1 = 0" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = 1;" (assignment_expression "iVar2 = 1" (identifier "iVar2") (= "=") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(!bVar6)" (( "(") (unary_expression "!bVar6" (! "!") (identifier "bVar6")) () ")")) (; ";")) (if_statement "if ((char)param_1[1] == '\0') {\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }" (if "if") (parenthesized_expression "((char)param_1[1] == '\0')" (( "(") (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);\n      if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }\n      uVar5 = gettext(pcVar4);\n                    \n      FUN_00065450(uVar5,pcVar3);\n    }" ({ "{") (expression_statement "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" (identifier "iVar2") (= "=") (call_expression "pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494)" (identifier "pthread_mutex_lock") (argument_list "((pthread_mutex_t *)&DAT_0038f494)" (( "(") (cast_expression "(pthread_mutex_t *)&DAT_0038f494" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_0038f494" (& "&") (identifier "DAT_0038f494"))) () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }\n      else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        DAT_0038f490 = param_1;\n        DAT_0038f48c = param_2;\n        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);\n        if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }\n      }" ({ "{") (expression_statement "DAT_0038f490 = param_1;" (assignment_expression "DAT_0038f490 = param_1" (identifier "DAT_0038f490") (= "=") (identifier "param_1")) (; ";")) (expression_statement "DAT_0038f48c = param_2;" (assignment_expression "DAT_0038f48c = param_2" (identifier "DAT_0038f48c") (= "=") (identifier "param_2")) (; ";")) (expression_statement "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);" (assignment_expression "iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" (identifier "iVar2") (= "=") (call_expression "pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0)" (identifier "pthread_once") (argument_list "((pthread_once_t *)param_1[3],FUN_0006c7a0)" (( "(") (cast_expression "(pthread_once_t *)param_1[3]" (( "(") (type_descriptor "pthread_once_t *" (type_identifier "pthread_once_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (, ",") (identifier "FUN_0006c7a0") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }\n        else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          DAT_0038f490 = (int *)0x0;\n          DAT_0038f48c = 0;\n          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);\n          if (iVar2 == 0) {\n            return 0;\n          }\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_mutex_unlock failed: %s";\n        }" ({ "{") (expression_statement "DAT_0038f490 = (int *)0x0;" (assignment_expression "DAT_0038f490 = (int *)0x0" (identifier "DAT_0038f490") (= "=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "DAT_0038f48c = 0;" (assignment_expression "DAT_0038f48c = 0" (identifier "DAT_0038f48c") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);" (assignment_expression "iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" (identifier "iVar2") (= "=") (call_expression "pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494)" (identifier "pthread_mutex_unlock") (argument_list "((pthread_mutex_t *)&DAT_0038f494)" (( "(") (cast_expression "(pthread_mutex_t *)&DAT_0038f494" (( "(") (type_descriptor "pthread_mutex_t *" (type_identifier "pthread_mutex_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_0038f494" (& "&") (identifier "DAT_0038f494"))) () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n            return 0;\n          }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n            return 0;\n          }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(iVar2)" (identifier "strerror") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "pcVar4 = "pthread_mutex_unlock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_unlock failed: %s"" (identifier "pcVar4") (= "=") (string_literal ""pthread_mutex_unlock failed: %s"" (" """) (string_content "pthread_mutex_unlock failed: %s") (" """))) (; ";")) (} "}")) (else_clause "else {\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" (else "else") (compound_statement "{\n          pcVar3 = strerror(iVar2);\n          pcVar4 = "pthread_once failed: %s";\n        }" ({ "{") (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(iVar2)" (identifier "strerror") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "pcVar4 = "pthread_once failed: %s";" (assignment_expression "pcVar4 = "pthread_once failed: %s"" (identifier "pcVar4") (= "=") (string_literal ""pthread_once failed: %s"" (" """) (string_content "pthread_once failed: %s") (" """))) (; ";")) (} "}")))) (} "}")) (else_clause "else {\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" (else "else") (compound_statement "{\n        pcVar3 = strerror(iVar2);\n        pcVar4 = "pthread_mutex_lock failed: %s";\n      }" ({ "{") (expression_statement "pcVar3 = strerror(iVar2);" (assignment_expression "pcVar3 = strerror(iVar2)" (identifier "pcVar3") (= "=") (call_expression "strerror(iVar2)" (identifier "strerror") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "pcVar4 = "pthread_mutex_lock failed: %s";" (assignment_expression "pcVar4 = "pthread_mutex_lock failed: %s"" (identifier "pcVar4") (= "=") (string_literal ""pthread_mutex_lock failed: %s"" (" """) (string_content "pthread_mutex_lock failed: %s") (" """))) (; ";")) (} "}")))) (expression_statement "uVar5 = gettext(pcVar4);" (assignment_expression "uVar5 = gettext(pcVar4)" (identifier "uVar5") (= "=") (call_expression "gettext(pcVar4)" (identifier "gettext") (argument_list "(pcVar4)" (( "(") (identifier "pcVar4") () ")")))) (; ";")) (expression_statement "FUN_00065450(uVar5,pcVar3);" (call_expression "FUN_00065450(uVar5,pcVar3)" (identifier "FUN_00065450") (argument_list "(uVar5,pcVar3)" (( "(") (identifier "uVar5") (, ",") (identifier "pcVar3") () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" (else "else") (if_statement "if ((char)param_1[1] == '\0') {\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" (if "if") (parenthesized_expression "((char)param_1[1] == '\0')" (( "(") (binary_expression "(char)param_1[1] == '\0'" (cast_expression "(char)param_1[1]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);\n    *(undefined1 *)(param_1 + 1) = 1;\n    return iVar2;\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*param_1 + 8))(param_1,param_2)" (parenthesized_expression "(**(code **)(*param_1 + 8))" (( "(") (pointer_expression "**(code **)(*param_1 + 8)" (* "*") (pointer_expression "*(code **)(*param_1 + 8)" (* "*") (cast_expression "(code **)(*param_1 + 8)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 8)" (( "(") (binary_expression "*param_1 + 8" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "8")) () ")"))))) () ")")) (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" (* "*") (cast_expression "(undefined1 *)(param_1 + 1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "1")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "DT": Some values do not have unique names */
/* DWARF original prototype: void run_once(Once * this, void * arg) */

void __thiscall gold::type_1::function_1(type_1 *this,void *arg)

{
  uint32_t *puVar1;
  uint32_t var_2;
  int var_5;
  char *pcVar4;
  char *pcVar5;
  
  if ((parameters->options_ == (type_2 *)0x0) ||
     ((parameters->options_->threads_).value != false)) {
    puVar1 = &this->was_run_lock_;
    do {
      var_1();
      var_2 = *puVar1;
      if (var_2 == 0) {
        *puVar1 = 1;
      }
      var_3();
    } while (var_2 != 0);
    do {
      var_1();
      var_2 = *puVar1;
      if (var_2 == 1) {
        *puVar1 = 0;
      }
      var_3();
    } while (var_2 != 1);
    if (this->was_run_ == false) {
      var_5 = var_4((type_3 *)&once_pointer_control);
      if (var_5 == 0) {
        once_pointer = this;
        once_arg = arg;
        var_5 = var_6(&this->once_->once_,c_run_once);
        if (var_5 == 0) {
          once_pointer = (type_1 *)0x0;
          once_arg = (void *)0x0;
          var_5 = var_7((type_3 *)&once_pointer_control);
          if (var_5 == 0) {
            return;
          }
          pcVar4 = var_8(var_5);
          pcVar5 = "pthread_mutex_unlock failed: %s";
        }
        else {
          pcVar4 = var_8(var_5);
          pcVar5 = "pthread_once failed: %s";
        }
      }
      else {
        pcVar4 = var_8(var_5);
        pcVar5 = "pthread_mutex_lock failed: %s";
      }
      pcVar5 = (char *)var_9(pcVar5);
                    /* WARNING: Subroutine does not return */
      var_10(pcVar5,pcVar4);
    }
  }
  else if (this->was_run_ == false) {
    (*this->_vptr_Once[2])(this,arg);
    this->was_run_ = true;
    return;
  }
  return;
}


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

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

int MASKED(int *param_1,undefined4 param_2)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  undefined4 uVar5;
  bool bVar6;
  
  iVar2 = *(int *)(DAT_0038f378 + 8);
  if ((iVar2 == 0) || (*(char *)(iVar2 + 0x3d69) != '\0')) {
    piVar1 = param_1 + 2;
    do {
      LOCK();
      iVar2 = *piVar1;
      if (iVar2 == 0) {
        *piVar1 = 1;
      }
      UNLOCK();
    } while (iVar2 != 0);
    do {
      LOCK();
      iVar2 = *piVar1;
      bVar6 = iVar2 == 1;
      if (bVar6) {
        *piVar1 = 0;
        iVar2 = 1;
      }
      UNLOCK();
    } while (!bVar6);
    if ((char)param_1[1] == '\0') {
      iVar2 = pthread_mutex_lock((pthread_mutex_t *)&DAT_0038f494);
      if (iVar2 == 0) {
        DAT_0038f490 = param_1;
        DAT_0038f48c = param_2;
        iVar2 = pthread_once((pthread_once_t *)param_1[3],FUN_0006c7a0);
        if (iVar2 == 0) {
          DAT_0038f490 = (int *)0x0;
          DAT_0038f48c = 0;
          iVar2 = pthread_mutex_unlock((pthread_mutex_t *)&DAT_0038f494);
          if (iVar2 == 0) {
            return 0;
          }
          pcVar3 = strerror(iVar2);
          pcVar4 = "pthread_mutex_unlock failed: %s";
        }
        else {
          pcVar3 = strerror(iVar2);
          pcVar4 = "pthread_once failed: %s";
        }
      }
      else {
        pcVar3 = strerror(iVar2);
        pcVar4 = "pthread_mutex_lock failed: %s";
      }
      uVar5 = gettext(pcVar4);
                    /* WARNING: Subroutine does not return */
      FUN_00065450(uVar5,pcVar3);
    }
  }
  else if ((char)param_1[1] == '\0') {
    iVar2 = (**(code **)(*param_1 + 8))(param_1,param_2);
    *(undefined1 *)(param_1 + 1) = 1;
    return iVar2;
  }
  return iVar2;
}

