
/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* std::locale::facet::_M_remove_reference() const */

void __thiscall std::locale::facet::_M_remove_reference(facet *this)

{
  facet *pfVar1;
  int iVar2;
  
  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
    iVar2 = *(int *)(this + 4);
    *(int *)(this + 4) = iVar2 + -1;
  }
  else {
    LOCK();
    pfVar1 = this + 4;
    iVar2 = *(int *)pfVar1;
    *(int *)pfVar1 = *(int *)pfVar1 + -1;
    UNLOCK();
  }
  if (iVar2 != 1) {
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 4))();
  return;
}



/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */

void FUN_003ead80(int *param_1)

{
  int *piVar1;
  int iVar2;
  
  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
    iVar2 = param_1[1];
    param_1[1] = iVar2 + -1;
  }
  else {
    LOCK();
    piVar1 = param_1 + 1;
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
  }
  if (iVar2 != 1) {
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*param_1 + 4))();
  return;
}


CALL 0x00050c85
ADD EDX,0x1ff27b
MOV EAX,dword ptr [ESP + 0x4]
MOV EDX,dword ptr [EDX + 0xfffffff8]
TEST EDX,EDX
JZ 0x003eadb0
MOV EDX,0xffffffff
XADD.LOCK dword ptr [EAX + 0x4],EDX
CMP EDX,0x1
JZ 0x003eadbe
RET
MOV EDX,dword ptr [EAX + 0x4]
LEA ECX,[EDX + -0x1]
MOV dword ptr [EAX + 0x4],ECX
CMP EDX,0x1
JNZ 0x003eada8
MOV EDX,dword ptr [EAX]
MOV dword ptr [ESP + 0x4],EAX
JMP dword ptr [EDX + 0x4]
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n\nvoid FUN_003ead80(int *param_1)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*param_1 + 4))();\n  return;\n}\n\n" comment (function_definition "void FUN_003ead80(int *param_1)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*param_1 + 4))();\n  return;\n}" primitive_type (function_declarator "FUN_003ead80(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*param_1 + 4))();\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" if (parenthesized_expression "(PTR___pthread_key_create_005e9ff8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_005e9ff8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }" { (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "param_1[1] = iVar2 + -1;" (assignment_expression "param_1[1] = iVar2 + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" else (compound_statement "{\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar1 = param_1 + 1;" (assignment_expression "piVar1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" * identifier) = (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar2 != 1) {\n    return;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment comment (expression_statement "(**(code **)(*param_1 + 4))();" (call_expression "(**(code **)(*param_1 + 4))()" (parenthesized_expression "(**(code **)(*param_1 + 4))" ( (pointer_expression "**(code **)(*param_1 + 4)" * (pointer_expression "*(code **)(*param_1 + 4)" * (cast_expression "(code **)(*param_1 + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 4)" ( (binary_expression "*param_1 + 4" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n/* std::locale::facet::_M_remove_reference() const */\n\nvoid __thiscall std::locale::facet::_M_remove_reference(facet *this)\n\n{\n  facet *pfVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = *(int *)(this + 4);\n    *(int *)(this + 4) = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*(int *)this + 4))();\n  return;\n}\n\n" comment comment (function_definition "void __thiscall std::locale::facet::_M_remove_reference(facet *this)\n\n{\n  facet *pfVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = *(int *)(this + 4);\n    *(int *)(this + 4) = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*(int *)this + 4))();\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::locale::facet::" identifier : : identifier : : identifier : :) (function_declarator "_M_remove_reference(facet *this)" identifier (parameter_list "(facet *this)" ( (parameter_declaration "facet *this" type_identifier (pointer_declarator "*this" * identifier)) ))) (compound_statement "{\n  facet *pfVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = *(int *)(this + 4);\n    *(int *)(this + 4) = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n  (**(code **)(*(int *)this + 4))();\n  return;\n}" { (declaration "facet *pfVar1;" type_identifier (pointer_declarator "*pfVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = *(int *)(this + 4);\n    *(int *)(this + 4) = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }" if (parenthesized_expression "(PTR___pthread_key_create_005e9ff8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_005e9ff8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = *(int *)(this + 4);\n    *(int *)(this + 4) = iVar2 + -1;\n  }" { (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(int *)(this + 4)" identifier = (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(this + 4) = iVar2 + -1;" (assignment_expression "*(int *)(this + 4) = iVar2 + -1" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }" else (compound_statement "{\n    LOCK();\n    pfVar1 = this + 4;\n    iVar2 = *(int *)pfVar1;\n    *(int *)pfVar1 = *(int *)pfVar1 + -1;\n    UNLOCK();\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "pfVar1 = this + 4;" (assignment_expression "pfVar1 = this + 4" identifier = (binary_expression "this + 4" identifier + number_literal)) ;) (expression_statement "iVar2 = *(int *)pfVar1;" (assignment_expression "iVar2 = *(int *)pfVar1" identifier = (pointer_expression "*(int *)pfVar1" * (cast_expression "(int *)pfVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "*(int *)pfVar1 = *(int *)pfVar1 + -1;" (assignment_expression "*(int *)pfVar1 = *(int *)pfVar1 + -1" (pointer_expression "*(int *)pfVar1" * (cast_expression "(int *)pfVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = (binary_expression "*(int *)pfVar1 + -1" (pointer_expression "*(int *)pfVar1" * (cast_expression "(int *)pfVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar2 != 1) {\n    return;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment comment (expression_statement "(**(code **)(*(int *)this + 4))();" (call_expression "(**(code **)(*(int *)this + 4))()" (parenthesized_expression "(**(code **)(*(int *)this + 4))" ( (pointer_expression "**(code **)(*(int *)this + 4)" * (pointer_expression "*(code **)(*(int *)this + 4)" * (cast_expression "(code **)(*(int *)this + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (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) ))))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_003ead80(int *param_1)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    \n                    \n  (**(code **)(*param_1 + 4))();\n  return;\n}\n\n" (function_definition "void FUN_003ead80(int *param_1)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    \n                    \n  (**(code **)(*param_1 + 4))();\n  return;\n}" primitive_type (function_declarator "FUN_003ead80(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    \n                    \n  (**(code **)(*param_1 + 4))();\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" if (parenthesized_expression "(PTR___pthread_key_create_005e9ff8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_005e9ff8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }" { (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "param_1[1] = iVar2 + -1;" (assignment_expression "param_1[1] = iVar2 + -1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = (binary_expression "iVar2 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" else (compound_statement "{\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar1 = param_1 + 1;" (assignment_expression "piVar1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" * identifier) = (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar2 != 1) {\n    return;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "(**(code **)(*param_1 + 4))();" (call_expression "(**(code **)(*param_1 + 4))()" (parenthesized_expression "(**(code **)(*param_1 + 4))" ( (pointer_expression "**(code **)(*param_1 + 4)" * (pointer_expression "*(code **)(*param_1 + 4)" * (cast_expression "(code **)(*param_1 + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 4)" ( (binary_expression "*param_1 + 4" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "()" ( ))) ;) (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 IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (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 { (return_statement return ;) })) (expression_statement (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 ( ))) ;) (return_statement return ;) })))
(function_definition "void FUN_003ead80(int *param_1)\n\n{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    \n                    \n  (**(code **)(*param_1 + 4))();\n  return;\n}" (primitive_type "void") (function_declarator "FUN_003ead80(int *param_1)" (identifier "FUN_003ead80") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  \n  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }\n  if (iVar2 != 1) {\n    return;\n  }\n                    \n                    \n  (**(code **)(*param_1 + 4))();\n  return;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }\n  else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" (if "if") (parenthesized_expression "(PTR___pthread_key_create_005e9ff8 == (undefined *)0x0)" (( "(") (binary_expression "PTR___pthread_key_create_005e9ff8 == (undefined *)0x0" (identifier "PTR___pthread_key_create_005e9ff8") (== "==") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = param_1[1];\n    param_1[1] = iVar2 + -1;\n  }" ({ "{") (expression_statement "iVar2 = param_1[1];" (assignment_expression "iVar2 = param_1[1]" (identifier "iVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "param_1[1] = iVar2 + -1;" (assignment_expression "param_1[1] = iVar2 + -1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (else_clause "else {\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" (else "else") (compound_statement "{\n    LOCK();\n    piVar1 = param_1 + 1;\n    iVar2 = *piVar1;\n    *piVar1 = *piVar1 + -1;\n    UNLOCK();\n  }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "piVar1 = param_1 + 1;" (assignment_expression "piVar1 = param_1 + 1" (identifier "piVar1") (= "=") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar2 = *piVar1;" (assignment_expression "iVar2 = *piVar1" (identifier "iVar2") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (if_statement "if (iVar2 != 1) {\n    return;\n  }" (if "if") (parenthesized_expression "(iVar2 != 1)" (( "(") (binary_expression "iVar2 != 1" (identifier "iVar2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "(**(code **)(*param_1 + 4))();" (call_expression "(**(code **)(*param_1 + 4))()" (parenthesized_expression "(**(code **)(*param_1 + 4))" (( "(") (pointer_expression "**(code **)(*param_1 + 4)" (* "*") (pointer_expression "*(code **)(*param_1 + 4)" (* "*") (cast_expression "(code **)(*param_1 + 4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 4)" (( "(") (binary_expression "*param_1 + 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "4")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* std::locale::facet::_M_remove_reference() const */

void __thiscall std::locale::type_1::function_1(type_1 *var_2)

{
  type_1 *pfVar1;
  int var_3;
  
  if (var_1 == (type_2 *)0x0) {
    var_3 = *(int *)(var_2 + 4);
    *(int *)(var_2 + 4) = var_3 + -1;
  }
  else {
    var_4();
    pfVar1 = var_2 + 4;
    var_3 = *(int *)pfVar1;
    *(int *)pfVar1 = *(int *)pfVar1 + -1;
    var_5();
  }
  if (var_3 != 1) {
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(type_3 **)(*(int *)var_2 + 4))();
  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: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (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: (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 (return_statement))) (expression_statement (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))) (return_statement))))

/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */

void MASKED(int *param_1)

{
  int *piVar1;
  int iVar2;
  
  if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
    iVar2 = param_1[1];
    param_1[1] = iVar2 + -1;
  }
  else {
    LOCK();
    piVar1 = param_1 + 1;
    iVar2 = *piVar1;
    *piVar1 = *piVar1 + -1;
    UNLOCK();
  }
  if (iVar2 != 1) {
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x003eadc4. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*param_1 + 4))();
  return;
}

