
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::clear() */

void __thiscall std::string::clear(string *this)

{
  allocator *paVar1;
  int *piVar2;
  undefined1 *puVar3;
  int iVar4;
  
  puVar3 = *(undefined1 **)this;
  paVar1 = (allocator *)(puVar3 + -0xc);
  if (*(int *)(*(int *)this + -4) < 1) {
    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {
      *(undefined4 *)(puVar3 + -4) = 0;
      *(undefined4 *)(puVar3 + -0xc) = 0;
      *puVar3 = 0;
    }
  }
  else {
    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {
      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {
        iVar4 = *(int *)(puVar3 + -4);
        *(int *)(puVar3 + -4) = iVar4 + -1;
      }
      else {
        LOCK();
        piVar2 = (int *)(puVar3 + -4);
        iVar4 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
      }
      if (iVar4 < 1) {
        _Rep::_M_destroy(paVar1);
      }
    }
    *(undefined **)this = &DAT_00396e0c;
  }
  return;
}



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

void FUN_0021eaf0(int *param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  undefined1 *puVar3;
  int iVar4;
  undefined1 local_1d [9];
  undefined4 uStack_14;
  
  uStack_14 = 0x21eaf9;
  puVar3 = (undefined1 *)*param_1;
  puVar1 = (undefined4 *)(puVar3 + -0xc);
  if (*(int *)(*param_1 + -4) < 1) {
    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {
      *(undefined4 *)(puVar3 + -4) = 0;
      *(undefined4 *)(puVar3 + -0xc) = 0;
      *puVar3 = 0;
    }
  }
  else {
    if (puVar1 != &DAT_00396e00) {
      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {
        iVar4 = *(int *)(puVar3 + -4);
        *(int *)(puVar3 + -4) = iVar4 + -1;
      }
      else {
        LOCK();
        piVar2 = (int *)(puVar3 + -4);
        iVar4 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
      }
      if (iVar4 < 1) {
        FUN_0021e9b0(puVar1,local_1d);
      }
    }
    *param_1 = (int)&DAT_00396e0c;
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x170507
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
MOV EAX,dword ptr [ESI]
MOV EAX,dword ptr [EAX + -0x4]
TEST EAX,EAX
MOV EAX,dword ptr [ESI]
LEA EDX,[EAX + -0xc]
JLE 0x0021eb30
LEA EDI,[EBX + 0x7e00]
CMP EDX,EDI
JNZ 0x0021eb50
LEA EAX,[EDI + 0xc]
MOV dword ptr [ESI],EAX
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
CMP EDX,dword ptr [EBX + 0xfffffcdc]
JZ 0x0021eb23
MOV dword ptr [EAX + -0x4],0x0
MOV dword ptr [EAX + -0xc],0x0
MOV byte ptr [EAX],0x0
JMP 0x0021eb23
MOV ECX,dword ptr [EBX + 0xffffff24]
TEST ECX,ECX
JZ 0x0021eb80
MOV ECX,0xffffffff
XADD.LOCK dword ptr [EAX + -0x4],ECX
TEST ECX,ECX
JG 0x0021eb1e
SUB ESP,0x8
LEA EAX,[ESP + 0x17]
PUSH EAX
PUSH EDX
CALL 0x0021e9b0
ADD ESP,0x10
JMP 0x0021eb1e
MOV ECX,dword ptr [EAX + -0x4]
LEA EBP,[ECX + -0x1]
MOV dword ptr [EAX + -0x4],EBP
JMP 0x0021eb64
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0021eaf0(int *param_1)\n\n{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_0021eaf0(int *param_1)\n\n{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0021eaf0(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 local_1d [9];" type_identifier (array_declarator "local_1d [9]" identifier [ number_literal ]) ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x21eaf9;" (assignment_expression "uStack_14 = 0x21eaf9" identifier = number_literal) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar1 = (undefined4 *)(puVar3 + -0xc);" (assignment_expression "puVar1 = (undefined4 *)(puVar3 + -0xc)" identifier = (cast_expression "(undefined4 *)(puVar3 + -0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) ;) (if_statement "if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" if (parenthesized_expression "(*(int *)(*param_1 + -4) < 1)" ( (binary_expression "*(int *)(*param_1 + -4) < 1" (pointer_expression "*(int *)(*param_1 + -4)" * (cast_expression "(int *)(*param_1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -4)" ( (binary_expression "*param_1 + -4" (pointer_expression "*param_1" * identifier) + number_literal) )))) < number_literal) )) (compound_statement "{\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }" { (if_statement "if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" if (parenthesized_expression "(puVar1 != (undefined4 *)PTR_DAT_0038ecdc)" ( (binary_expression "puVar1 != (undefined4 *)PTR_DAT_0038ecdc" identifier != (cast_expression "(undefined4 *)PTR_DAT_0038ecdc" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" { (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" * (cast_expression "(undefined4 *)(puVar3 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(puVar3 + -0xc) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -0xc) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -0xc)" * (cast_expression "(undefined4 *)(puVar3 + -0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*puVar3 = 0;" (assignment_expression "*puVar3 = 0" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }) (else_clause "else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" else (compound_statement "{\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" { (if_statement "if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" if (parenthesized_expression "(puVar1 != &DAT_00396e00)" ( (binary_expression "puVar1 != &DAT_00396e00" identifier != (pointer_expression "&DAT_00396e00" & identifier)) )) (compound_statement "{\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0038ef24 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0038ef24 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }" { (expression_statement "iVar4 = *(int *)(puVar3 + -4);" (assignment_expression "iVar4 = *(int *)(puVar3 + -4)" identifier = (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(puVar3 + -4) = iVar4 + -1;" (assignment_expression "*(int *)(puVar3 + -4) = iVar4 + -1" (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar2 = (int *)(puVar3 + -4);" (assignment_expression "piVar2 = (int *)(puVar3 + -4)" identifier = (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) ;) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "*piVar2 = *piVar2 + -1;" (assignment_expression "*piVar2 = *piVar2 + -1" (pointer_expression "*piVar2" * identifier) = (binary_expression "*piVar2 + -1" (pointer_expression "*piVar2" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }" if (parenthesized_expression "(iVar4 < 1)" ( (binary_expression "iVar4 < 1" identifier < number_literal) )) (compound_statement "{\n        FUN_0021e9b0(puVar1,local_1d);\n      }" { (expression_statement "FUN_0021e9b0(puVar1,local_1d);" (call_expression "FUN_0021e9b0(puVar1,local_1d)" identifier (argument_list "(puVar1,local_1d)" ( identifier , identifier ))) ;) })) })) (expression_statement "*param_1 = (int)&DAT_00396e0c;" (assignment_expression "*param_1 = (int)&DAT_00396e0c" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)&DAT_00396e0c" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&DAT_00396e0c" & identifier))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::clear() */\n\nvoid __thiscall std::string::clear(string *this)\n\n{\n  allocator *paVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  \n  puVar3 = *(undefined1 **)this;\n  paVar1 = (allocator *)(puVar3 + -0xc);\n  if (*(int *)(*(int *)this + -4) < 1) {\n    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }\n  return;\n}\n\n" comment comment (function_definition "void __thiscall std::string::clear(string *this)\n\n{\n  allocator *paVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  \n  puVar3 = *(undefined1 **)this;\n  paVar1 = (allocator *)(puVar3 + -0xc);\n  if (*(int *)(*(int *)this + -4) < 1) {\n    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "clear(string *this)" identifier (parameter_list "(string *this)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) ))) (compound_statement "{\n  allocator *paVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  \n  puVar3 = *(undefined1 **)this;\n  paVar1 = (allocator *)(puVar3 + -0xc);\n  if (*(int *)(*(int *)this + -4) < 1) {\n    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }\n  return;\n}" { (declaration "allocator *paVar1;" type_identifier (pointer_declarator "*paVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "puVar3 = *(undefined1 **)this;" (assignment_expression "puVar3 = *(undefined1 **)this" identifier = (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "paVar1 = (allocator *)(puVar3 + -0xc);" (assignment_expression "paVar1 = (allocator *)(puVar3 + -0xc)" identifier = (cast_expression "(allocator *)(puVar3 + -0xc)" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) ;) (if_statement "if (*(int *)(*(int *)this + -4) < 1) {\n    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }" if (parenthesized_expression "(*(int *)(*(int *)this + -4) < 1)" ( (binary_expression "*(int *)(*(int *)this + -4) < 1" (pointer_expression "*(int *)(*(int *)this + -4)" * (cast_expression "(int *)(*(int *)this + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -4)" ( (binary_expression "*(int *)this + -4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) )))) < number_literal) )) (compound_statement "{\n    if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }" { (if_statement "if (paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" if (parenthesized_expression "(paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc)" ( (binary_expression "paVar1 != (allocator *)PTR__S_empty_rep_storage_0038ecdc" identifier != (cast_expression "(allocator *)PTR__S_empty_rep_storage_0038ecdc" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" { (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" * (cast_expression "(undefined4 *)(puVar3 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(puVar3 + -0xc) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -0xc) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -0xc)" * (cast_expression "(undefined4 *)(puVar3 + -0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*puVar3 = 0;" (assignment_expression "*puVar3 = 0" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }) (else_clause "else {\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }" else (compound_statement "{\n    if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }\n    *(undefined **)this = &DAT_00396e0c;\n  }" { (if_statement "if (paVar1 != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }" if (parenthesized_expression "(paVar1 != (allocator *)&_Rep::_S_empty_rep_storage)" ( (binary_expression "paVar1 != (allocator *)&_Rep" identifier != (cast_expression "(allocator *)&_Rep" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&_Rep" & identifier))) (ERROR "::_S_empty_rep_storage" : : identifier) )) (compound_statement "{\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0038ef24 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0038ef24 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }" { (expression_statement "iVar4 = *(int *)(puVar3 + -4);" (assignment_expression "iVar4 = *(int *)(puVar3 + -4)" identifier = (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(puVar3 + -4) = iVar4 + -1;" (assignment_expression "*(int *)(puVar3 + -4) = iVar4 + -1" (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar2 = (int *)(puVar3 + -4);" (assignment_expression "piVar2 = (int *)(puVar3 + -4)" identifier = (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) ;) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "*piVar2 = *piVar2 + -1;" (assignment_expression "*piVar2 = *piVar2 + -1" (pointer_expression "*piVar2" * identifier) = (binary_expression "*piVar2 + -1" (pointer_expression "*piVar2" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar4 < 1) {\n        _Rep::_M_destroy(paVar1);\n      }" if (parenthesized_expression "(iVar4 < 1)" ( (binary_expression "iVar4 < 1" identifier < number_literal) )) (compound_statement "{\n        _Rep::_M_destroy(paVar1);\n      }" { (labeled_statement "_Rep::_M_destroy(paVar1);" statement_identifier : (ERROR ":" :) (expression_statement "_M_destroy(paVar1);" (call_expression "_M_destroy(paVar1)" identifier (argument_list "(paVar1)" ( identifier ))) ;)) })) })) (expression_statement "*(undefined **)this = &DAT_00396e0c;" (assignment_expression "*(undefined **)this = &DAT_00396e0c" (pointer_expression "*(undefined **)this" * (cast_expression "(undefined **)this" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (pointer_expression "&DAT_00396e0c" & identifier)) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0021eaf0(int *param_1)\n\n{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}\n\n" (function_definition "void FUN_0021eaf0(int *param_1)\n\n{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0021eaf0(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 local_1d [9];" type_identifier (array_declarator "local_1d [9]" identifier [ number_literal ]) ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x21eaf9;" (assignment_expression "uStack_14 = 0x21eaf9" identifier = number_literal) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar1 = (undefined4 *)(puVar3 + -0xc);" (assignment_expression "puVar1 = (undefined4 *)(puVar3 + -0xc)" identifier = (cast_expression "(undefined4 *)(puVar3 + -0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) ;) (if_statement "if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" if (parenthesized_expression "(*(int *)(*param_1 + -4) < 1)" ( (binary_expression "*(int *)(*param_1 + -4) < 1" (pointer_expression "*(int *)(*param_1 + -4)" * (cast_expression "(int *)(*param_1 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -4)" ( (binary_expression "*param_1 + -4" (pointer_expression "*param_1" * identifier) + number_literal) )))) < number_literal) )) (compound_statement "{\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }" { (if_statement "if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" if (parenthesized_expression "(puVar1 != (undefined4 *)PTR_DAT_0038ecdc)" ( (binary_expression "puVar1 != (undefined4 *)PTR_DAT_0038ecdc" identifier != (cast_expression "(undefined4 *)PTR_DAT_0038ecdc" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" { (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" * (cast_expression "(undefined4 *)(puVar3 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(puVar3 + -0xc) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -0xc) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -0xc)" * (cast_expression "(undefined4 *)(puVar3 + -0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*puVar3 = 0;" (assignment_expression "*puVar3 = 0" (pointer_expression "*puVar3" * identifier) = number_literal) ;) })) }) (else_clause "else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" else (compound_statement "{\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" { (if_statement "if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" if (parenthesized_expression "(puVar1 != &DAT_00396e00)" ( (binary_expression "puVar1 != &DAT_00396e00" identifier != (pointer_expression "&DAT_00396e00" & identifier)) )) (compound_statement "{\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0038ef24 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0038ef24 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }" { (expression_statement "iVar4 = *(int *)(puVar3 + -4);" (assignment_expression "iVar4 = *(int *)(puVar3 + -4)" identifier = (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(puVar3 + -4) = iVar4 + -1;" (assignment_expression "*(int *)(puVar3 + -4) = iVar4 + -1" (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar2 = (int *)(puVar3 + -4);" (assignment_expression "piVar2 = (int *)(puVar3 + -4)" identifier = (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) ;) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "*piVar2 = *piVar2 + -1;" (assignment_expression "*piVar2 = *piVar2 + -1" (pointer_expression "*piVar2" * identifier) = (binary_expression "*piVar2 + -1" (pointer_expression "*piVar2" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }" if (parenthesized_expression "(iVar4 < 1)" ( (binary_expression "iVar4 < 1" identifier < number_literal) )) (compound_statement "{\n        FUN_0021e9b0(puVar1,local_1d);\n      }" { (expression_statement "FUN_0021e9b0(puVar1,local_1d);" (call_expression "FUN_0021e9b0(puVar1,local_1d)" identifier (argument_list "(puVar1,local_1d)" ( identifier , identifier ))) ;) })) })) (expression_statement "*param_1 = (int)&DAT_00396e0c;" (assignment_expression "*param_1 = (int)&DAT_00396e0c" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)&DAT_00396e0c" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&DAT_00396e0c" & identifier))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression & IDENT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) })) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (pointer_expression & IDENT))) ;) }))) (return_statement return ;) })))
(function_definition "void FUN_0021eaf0(int *param_1)\n\n{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0021eaf0(int *param_1)" (identifier "FUN_0021eaf0") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  int *piVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 local_1d [9];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x21eaf9;\n  puVar3 = (undefined1 *)*param_1;\n  puVar1 = (undefined4 *)(puVar3 + -0xc);\n  if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }\n  return;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined1 local_1d [9];" (type_identifier "undefined1") (array_declarator "local_1d [9]" (identifier "local_1d") ([ "[") (number_literal "9") (] "]")) (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x21eaf9;" (assignment_expression "uStack_14 = 0x21eaf9" (identifier "uStack_14") (= "=") (number_literal "0x21eaf9")) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "puVar1 = (undefined4 *)(puVar3 + -0xc);" (assignment_expression "puVar1 = (undefined4 *)(puVar3 + -0xc)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)(puVar3 + -0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))) (; ";")) (if_statement "if (*(int *)(*param_1 + -4) < 1) {\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }\n  else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" (if "if") (parenthesized_expression "(*(int *)(*param_1 + -4) < 1)" (( "(") (binary_expression "*(int *)(*param_1 + -4) < 1" (pointer_expression "*(int *)(*param_1 + -4)" (* "*") (cast_expression "(int *)(*param_1 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -4)" (( "(") (binary_expression "*param_1 + -4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-4")) () ")")))) (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }\n  }" ({ "{") (if_statement "if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" (if "if") (parenthesized_expression "(puVar1 != (undefined4 *)PTR_DAT_0038ecdc)" (( "(") (binary_expression "puVar1 != (undefined4 *)PTR_DAT_0038ecdc" (identifier "puVar1") (!= "!=") (cast_expression "(undefined4 *)PTR_DAT_0038ecdc" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_DAT_0038ecdc"))) () ")")) (compound_statement "{\n      *(undefined4 *)(puVar3 + -4) = 0;\n      *(undefined4 *)(puVar3 + -0xc) = 0;\n      *puVar3 = 0;\n    }" ({ "{") (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" (* "*") (cast_expression "(undefined4 *)(puVar3 + -4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(puVar3 + -0xc) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -0xc) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -0xc)" (* "*") (cast_expression "(undefined4 *)(puVar3 + -0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*puVar3 = 0;" (assignment_expression "*puVar3 = 0" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" (else "else") (compound_statement "{\n    if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }\n    *param_1 = (int)&DAT_00396e0c;\n  }" ({ "{") (if_statement "if (puVar1 != &DAT_00396e00) {\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" (if "if") (parenthesized_expression "(puVar1 != &DAT_00396e00)" (( "(") (binary_expression "puVar1 != &DAT_00396e00" (identifier "puVar1") (!= "!=") (pointer_expression "&DAT_00396e00" (& "&") (identifier "DAT_00396e00"))) () ")")) (compound_statement "{\n      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }\n      if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }\n    }" ({ "{") (if_statement "if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }\n      else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" (if "if") (parenthesized_expression "(PTR___pthread_key_create_0038ef24 == (undefined *)0x0)" (( "(") (binary_expression "PTR___pthread_key_create_0038ef24 == (undefined *)0x0" (identifier "PTR___pthread_key_create_0038ef24") (== "==") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        iVar4 = *(int *)(puVar3 + -4);\n        *(int *)(puVar3 + -4) = iVar4 + -1;\n      }" ({ "{") (expression_statement "iVar4 = *(int *)(puVar3 + -4);" (assignment_expression "iVar4 = *(int *)(puVar3 + -4)" (identifier "iVar4") (= "=") (pointer_expression "*(int *)(puVar3 + -4)" (* "*") (cast_expression "(int *)(puVar3 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")"))))) (; ";")) (expression_statement "*(int *)(puVar3 + -4) = iVar4 + -1;" (assignment_expression "*(int *)(puVar3 + -4) = iVar4 + -1" (pointer_expression "*(int *)(puVar3 + -4)" (* "*") (cast_expression "(int *)(puVar3 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")")))) (= "=") (binary_expression "iVar4 + -1" (identifier "iVar4") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (else_clause "else {\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" (else "else") (compound_statement "{\n        LOCK();\n        piVar2 = (int *)(puVar3 + -4);\n        iVar4 = *piVar2;\n        *piVar2 = *piVar2 + -1;\n        UNLOCK();\n      }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "piVar2 = (int *)(puVar3 + -4);" (assignment_expression "piVar2 = (int *)(puVar3 + -4)" (identifier "piVar2") (= "=") (cast_expression "(int *)(puVar3 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")")))) (; ";")) (expression_statement "iVar4 = *piVar2;" (assignment_expression "iVar4 = *piVar2" (identifier "iVar4") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (expression_statement "*piVar2 = *piVar2 + -1;" (assignment_expression "*piVar2 = *piVar2 + -1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (binary_expression "*piVar2 + -1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (if_statement "if (iVar4 < 1) {\n        FUN_0021e9b0(puVar1,local_1d);\n      }" (if "if") (parenthesized_expression "(iVar4 < 1)" (( "(") (binary_expression "iVar4 < 1" (identifier "iVar4") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n        FUN_0021e9b0(puVar1,local_1d);\n      }" ({ "{") (expression_statement "FUN_0021e9b0(puVar1,local_1d);" (call_expression "FUN_0021e9b0(puVar1,local_1d)" (identifier "FUN_0021e9b0") (argument_list "(puVar1,local_1d)" (( "(") (identifier "puVar1") (, ",") (identifier "local_1d") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "*param_1 = (int)&DAT_00396e0c;" (assignment_expression "*param_1 = (int)&DAT_00396e0c" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)&DAT_00396e0c" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (pointer_expression "&DAT_00396e0c" (& "&") (identifier "DAT_00396e0c")))) (; ";")) (} "}")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::clear() */

void __thiscall std::type_1::function_1(type_1 *this)

{
  type_2 *var_2;
  int *piVar2;
  type_3 *var_1;
  int var_4;
  
  var_1 = *(type_3 **)this;
  var_2 = (type_2 *)(var_1 + -0xc);
  if (*(int *)(*(int *)this + -4) < 1) {
    if (var_2 != (type_2 *)PTR__S_empty_rep_storage_0038ecdc) {
      *(type_4 *)(var_1 + -4) = 0;
      *(type_4 *)(var_1 + -0xc) = 0;
      *var_1 = 0;
    }
  }
  else {
    if (var_2 != (type_2 *)&_Rep::_S_empty_rep_storage) {
      if (var_3 == (type_5 *)0x0) {
        var_4 = *(int *)(var_1 + -4);
        *(int *)(var_1 + -4) = var_4 + -1;
      }
      else {
        var_5();
        piVar2 = (int *)(var_1 + -4);
        var_4 = *piVar2;
        *piVar2 = *piVar2 + -1;
        var_6();
      }
      if (var_4 < 1) {
        _Rep::var_7(var_2);
      }
    }
    *(type_5 **)this = &DAT_00396e0c;
  }
  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))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (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: (pointer_expression argument: (identifier)) right: (number_literal))))) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (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))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (identifier)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (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))))))) (expression_statement (assignment_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: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (pointer_expression argument: (identifier)))))))) (return_statement))))

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

void MASKED(int *param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  undefined1 *puVar3;
  int iVar4;
  undefined1 local_1d [9];
  undefined4 uStack_14;
  
  uStack_14 = 0x21eaf9;
  puVar3 = (undefined1 *)*param_1;
  puVar1 = (undefined4 *)(puVar3 + -0xc);
  if (*(int *)(*param_1 + -4) < 1) {
    if (puVar1 != (undefined4 *)PTR_DAT_0038ecdc) {
      *(undefined4 *)(puVar3 + -4) = 0;
      *(undefined4 *)(puVar3 + -0xc) = 0;
      *puVar3 = 0;
    }
  }
  else {
    if (puVar1 != &DAT_00396e00) {
      if (PTR___pthread_key_create_0038ef24 == (undefined *)0x0) {
        iVar4 = *(int *)(puVar3 + -4);
        *(int *)(puVar3 + -4) = iVar4 + -1;
      }
      else {
        LOCK();
        piVar2 = (int *)(puVar3 + -4);
        iVar4 = *piVar2;
        *piVar2 = *piVar2 + -1;
        UNLOCK();
      }
      if (iVar4 < 1) {
        FUN_0021e9b0(puVar1,local_1d);
      }
    }
    *param_1 = (int)&DAT_00396e0c;
  }
  return;
}

