
/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* std::ios_base::xalloc() */

int std::ios_base::xalloc(void)

{
  int iVar1;
  
  iVar1 = xalloc()::_S_top;
  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {
    LOCK();
    xalloc()::_S_top = xalloc()::_S_top + 1;
    UNLOCK();
    return iVar1 + 4;
  }
  iVar1 = xalloc()::_S_top + 4;
  xalloc()::_S_top = xalloc()::_S_top + 1;
  return iVar1;
}



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

int FUN_003f3000(void)

{
  int iVar1;
  
  iVar1 = DAT_005f3098;
  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {
    LOCK();
    DAT_005f3098 = DAT_005f3098 + 1;
    UNLOCK();
    return iVar1 + 4;
  }
  iVar1 = DAT_005f3098 + 4;
  DAT_005f3098 = DAT_005f3098 + 1;
  return iVar1;
}


CALL 0x00050c85
ADD EDX,0x1f6ffb
MOV EAX,dword ptr [EDX + 0xfffffff8]
TEST EAX,EAX
JZ 0x003f3030
MOV EAX,0x1
XADD.LOCK dword ptr [EDX + 0x9098],EAX
ADD EAX,0x4
RET
MOV EAX,dword ptr [EDX + 0x9098]
LEA ECX,[EAX + 0x1]
ADD EAX,0x4
MOV dword ptr [EDX + 0x9098],ECX
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n\nint FUN_003f3000(void)\n\n{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}\n\n" comment (function_definition "int FUN_003f3000(void)\n\n{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" primitive_type (function_declarator "FUN_003f3000(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = DAT_005f3098;" (assignment_expression "iVar1 = DAT_005f3098" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\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    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" identifier = (binary_expression "DAT_005f3098 + 1" identifier + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (return_statement "return iVar1 + 4;" return (binary_expression "iVar1 + 4" identifier + number_literal) ;) })) (expression_statement "iVar1 = DAT_005f3098 + 4;" (assignment_expression "iVar1 = DAT_005f3098 + 4" identifier = (binary_expression "DAT_005f3098 + 4" identifier + number_literal)) ;) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" identifier = (binary_expression "DAT_005f3098 + 1" identifier + number_literal)) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n/* std::ios_base::xalloc() */\n\nint std::ios_base::xalloc(void)\n\n{\n  int iVar1;\n  \n  iVar1 = xalloc()::_S_top;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    xalloc()::_S_top = xalloc()::_S_top + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = xalloc()::_S_top + 4;\n  xalloc()::_S_top = xalloc()::_S_top + 1;\n  return iVar1;\n}\n\n" comment comment (function_definition "int std::ios_base::xalloc(void)\n\n{\n  int iVar1;\n  \n  iVar1 = xalloc()::_S_top;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    xalloc()::_S_top = xalloc()::_S_top + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = xalloc()::_S_top + 4;\n  xalloc()::_S_top = xalloc()::_S_top + 1;\n  return iVar1;\n}" primitive_type (ERROR "std::ios_base::" identifier : : identifier : :) (function_declarator "xalloc(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = xalloc()::_S_top;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    xalloc()::_S_top = xalloc()::_S_top + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = xalloc()::_S_top + 4;\n  xalloc()::_S_top = xalloc()::_S_top + 1;\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = xalloc()::_S_top;" (assignment_expression "iVar1 = xalloc()" identifier = (call_expression "xalloc()" identifier (argument_list "()" ( )))) (ERROR "::_S_top" : : identifier) ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    xalloc()::_S_top = xalloc()::_S_top + 1;\n    UNLOCK();\n    return iVar1 + 4;\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    LOCK();\n    xalloc()::_S_top = xalloc()::_S_top + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (ERROR "xalloc()::_S_top = xalloc()::" (call_expression "xalloc()" identifier (argument_list "()" ( ))) : : (assignment_expression "_S_top = xalloc()" identifier = (call_expression "xalloc()" identifier (argument_list "()" ( )))) : :) (expression_statement "_S_top + 1;" (binary_expression "_S_top + 1" identifier + number_literal) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (return_statement "return iVar1 + 4;" return (binary_expression "iVar1 + 4" identifier + number_literal) ;) })) (expression_statement "iVar1 = xalloc()::_S_top + 4;" (binary_expression "iVar1 = xalloc()::_S_top + 4" (assignment_expression "iVar1 = xalloc()" identifier = (call_expression "xalloc()" identifier (argument_list "()" ( )))) (ERROR "::_S_top" : : identifier) + number_literal) ;) (ERROR "xalloc()::_S_top = xalloc()::" (call_expression "xalloc()" identifier (argument_list "()" ( ))) : : (assignment_expression "_S_top = xalloc()" identifier = (call_expression "xalloc()" identifier (argument_list "()" ( )))) : :) (expression_statement "_S_top + 1;" (binary_expression "_S_top + 1" identifier + number_literal) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "int FUN_003f3000(void)\n\n{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}\n\n" (function_definition "int FUN_003f3000(void)\n\n{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" primitive_type (function_declarator "FUN_003f3000(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = DAT_005f3098;" (assignment_expression "iVar1 = DAT_005f3098" identifier = identifier) ;) (if_statement "if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\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    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" identifier = (binary_expression "DAT_005f3098 + 1" identifier + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (return_statement "return iVar1 + 4;" return (binary_expression "iVar1 + 4" identifier + number_literal) ;) })) (expression_statement "iVar1 = DAT_005f3098 + 4;" (assignment_expression "iVar1 = DAT_005f3098 + 4" identifier = (binary_expression "DAT_005f3098 + 4" identifier + number_literal)) ;) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" identifier = (binary_expression "DAT_005f3098 + 1" identifier + number_literal)) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return (binary_expression IDENT + LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_003f3000(void)\n\n{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" (primitive_type "int") (function_declarator "FUN_003f3000(void)" (identifier "FUN_003f3000") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = DAT_005f3098;\n  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }\n  iVar1 = DAT_005f3098 + 4;\n  DAT_005f3098 = DAT_005f3098 + 1;\n  return iVar1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "iVar1 = DAT_005f3098;" (assignment_expression "iVar1 = DAT_005f3098" (identifier "iVar1") (= "=") (identifier "DAT_005f3098")) (; ";")) (if_statement "if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {\n    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\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    LOCK();\n    DAT_005f3098 = DAT_005f3098 + 1;\n    UNLOCK();\n    return iVar1 + 4;\n  }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" (identifier "DAT_005f3098") (= "=") (binary_expression "DAT_005f3098 + 1" (identifier "DAT_005f3098") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return iVar1 + 4;" (return "return") (binary_expression "iVar1 + 4" (identifier "iVar1") (+ "+") (number_literal "4")) (; ";")) (} "}"))) (expression_statement "iVar1 = DAT_005f3098 + 4;" (assignment_expression "iVar1 = DAT_005f3098 + 4" (identifier "iVar1") (= "=") (binary_expression "DAT_005f3098 + 4" (identifier "DAT_005f3098") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "DAT_005f3098 = DAT_005f3098 + 1;" (assignment_expression "DAT_005f3098 = DAT_005f3098 + 1" (identifier "DAT_005f3098") (= "=") (binary_expression "DAT_005f3098 + 1" (identifier "DAT_005f3098") (+ "+") (number_literal "1"))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* std::ios_base::xalloc() */

int std::ios_base::function_1(void)

{
  int var_5;
  
  var_5 = function_1()::var_3;
  if (var_1 != (type_1 *)0x0) {
    var_2();
    function_1()::var_3 = function_1()::var_3 + 1;
    var_4();
    return var_5 + 4;
  }
  var_5 = function_1()::var_3 + 4;
  function_1()::var_3 = function_1()::var_3 + 1;
  return var_5;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (return_statement (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (return_statement (identifier)))))

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

int MASKED(void)

{
  int iVar1;
  
  iVar1 = DAT_005f3098;
  if (PTR___pthread_key_create_005e9ff8 != (undefined *)0x0) {
    LOCK();
    DAT_005f3098 = DAT_005f3098 + 1;
    UNLOCK();
    return iVar1 + 4;
  }
  iVar1 = DAT_005f3098 + 4;
  DAT_005f3098 = DAT_005f3098 + 1;
  return iVar1;
}

