
/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */
/* std::locale::id::_M_id() const */

int __thiscall std::locale::id::_M_id(id *this)

{
  int iVar1;
  
  iVar1 = *(int *)this;
  if (iVar1 == 0) {
    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
      iVar1 = _S_refcount + 1;
      _S_refcount = iVar1;
      *(int *)this = iVar1;
    }
    else {
      LOCK();
      UNLOCK();
      iVar1 = _S_refcount + 1;
      _S_refcount = _S_refcount + 1;
      *(int *)this = iVar1;
    }
  }
  return iVar1 + -1;
}



/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */

int FUN_003b0a10(int *param_1)

{
  int iVar1;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
      iVar1 = DAT_005f2584 + 1;
      DAT_005f2584 = iVar1;
      *param_1 = iVar1;
    }
    else {
      LOCK();
      UNLOCK();
      iVar1 = DAT_005f2584 + 1;
      DAT_005f2584 = DAT_005f2584 + 1;
      *param_1 = iVar1;
    }
  }
  return iVar1 + -1;
}


CALL 0x00074f06
ADD ECX,0x2395eb
MOV EDX,dword ptr [ESP + 0x4]
MOV EAX,dword ptr [EDX]
TEST EAX,EAX
JNZ 0x003b0a43
MOV EAX,dword ptr [ECX + 0xfffffff8]
LEA ECX,[ECX + 0x8584]
TEST EAX,EAX
JZ 0x003b0a50
MOV EAX,0x1
XADD.LOCK dword ptr [ECX],EAX
ADD EAX,0x1
MOV dword ptr [EDX],EAX
SUB EAX,0x1
RET
MOV EAX,dword ptr [ECX]
ADD EAX,0x1
MOV dword ptr [ECX],EAX
MOV dword ptr [EDX],EAX
JMP 0x003b0a43
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */\n\nint FUN_003b0a10(int *param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}\n\n" comment (function_definition "int FUN_003b0a10(int *param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" primitive_type (function_declarator "FUN_003b0a10(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 iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" { (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\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      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }" { (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "DAT_005f2584 = iVar1;" (assignment_expression "DAT_005f2584 = iVar1" identifier = identifier) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) }) (else_clause "else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" else (compound_statement "{\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "DAT_005f2584 = DAT_005f2584 + 1;" (assignment_expression "DAT_005f2584 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) }))) })) (return_statement "return iVar1 + -1;" return (binary_expression "iVar1 + -1" identifier + number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */\n/* std::locale::id::_M_id() const */\n\nint __thiscall std::locale::id::_M_id(id *this)\n\n{\n  int iVar1;\n  \n  iVar1 = *(int *)this;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}\n\n" comment comment (function_definition "int __thiscall std::locale::id::_M_id(id *this)\n\n{\n  int iVar1;\n  \n  iVar1 = *(int *)this;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::locale::id::" identifier : : identifier : : identifier : :) (function_declarator "_M_id(id *this)" identifier (parameter_list "(id *this)" ( (parameter_declaration "id *this" type_identifier (pointer_declarator "*this" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = *(int *)this;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }\n  }" { (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\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      iVar1 = _S_refcount + 1;\n      _S_refcount = iVar1;\n      *(int *)this = iVar1;\n    }" { (expression_statement "iVar1 = _S_refcount + 1;" (assignment_expression "iVar1 = _S_refcount + 1" identifier = (binary_expression "_S_refcount + 1" identifier + number_literal)) ;) (expression_statement "_S_refcount = iVar1;" (assignment_expression "_S_refcount = iVar1" identifier = identifier) ;) (expression_statement "*(int *)this = iVar1;" (assignment_expression "*(int *)this = iVar1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) }) (else_clause "else {\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }" else (compound_statement "{\n      LOCK();\n      UNLOCK();\n      iVar1 = _S_refcount + 1;\n      _S_refcount = _S_refcount + 1;\n      *(int *)this = iVar1;\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar1 = _S_refcount + 1;" (assignment_expression "iVar1 = _S_refcount + 1" identifier = (binary_expression "_S_refcount + 1" identifier + number_literal)) ;) (expression_statement "_S_refcount = _S_refcount + 1;" (assignment_expression "_S_refcount = _S_refcount + 1" identifier = (binary_expression "_S_refcount + 1" identifier + number_literal)) ;) (expression_statement "*(int *)this = iVar1;" (assignment_expression "*(int *)this = iVar1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) }))) })) (return_statement "return iVar1 + -1;" return (binary_expression "iVar1 + -1" identifier + number_literal) ;) })))
(translation_unit "int FUN_003b0a10(int *param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}\n\n" (function_definition "int FUN_003b0a10(int *param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" primitive_type (function_declarator "FUN_003b0a10(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 iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" { (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\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      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }" { (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "DAT_005f2584 = iVar1;" (assignment_expression "DAT_005f2584 = iVar1" identifier = identifier) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) }) (else_clause "else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" else (compound_statement "{\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "DAT_005f2584 = DAT_005f2584 + 1;" (assignment_expression "DAT_005f2584 = DAT_005f2584 + 1" identifier = (binary_expression "DAT_005f2584 + 1" identifier + number_literal)) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) }))) })) (return_statement "return iVar1 + -1;" return (binary_expression "iVar1 + -1" identifier + number_literal) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (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 = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) }))) })) (return_statement return (binary_expression IDENT + LIT) ;) })))
(function_definition "int FUN_003b0a10(int *param_1)\n\n{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" (primitive_type "int") (function_declarator "FUN_003b0a10(int *param_1)" (identifier "FUN_003b0a10") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = *param_1;\n  if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }\n  return iVar1 + -1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (iVar1 == 0) {\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }\n  }" ({ "{") (if_statement "if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }\n    else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\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      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = iVar1;\n      *param_1 = iVar1;\n    }" ({ "{") (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" (identifier "iVar1") (= "=") (binary_expression "DAT_005f2584 + 1" (identifier "DAT_005f2584") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "DAT_005f2584 = iVar1;" (assignment_expression "DAT_005f2584 = iVar1" (identifier "DAT_005f2584") (= "=") (identifier "iVar1")) (; ";")) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar1")) (; ";")) (} "}")) (else_clause "else {\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" (else "else") (compound_statement "{\n      LOCK();\n      UNLOCK();\n      iVar1 = DAT_005f2584 + 1;\n      DAT_005f2584 = DAT_005f2584 + 1;\n      *param_1 = iVar1;\n    }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "iVar1 = DAT_005f2584 + 1;" (assignment_expression "iVar1 = DAT_005f2584 + 1" (identifier "iVar1") (= "=") (binary_expression "DAT_005f2584 + 1" (identifier "DAT_005f2584") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "DAT_005f2584 = DAT_005f2584 + 1;" (assignment_expression "DAT_005f2584 = DAT_005f2584 + 1" (identifier "DAT_005f2584") (= "=") (binary_expression "DAT_005f2584 + 1" (identifier "DAT_005f2584") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar1")) (; ";")) (} "}")))) (} "}"))) (return_statement "return iVar1 + -1;" (return "return") (binary_expression "iVar1 + -1" (identifier "iVar1") (+ "+") (number_literal "-1")) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */
/* std::locale::id::_M_id() const */

int __thiscall std::locale::type_1::function_1(type_1 *this)

{
  int var_1;
  
  var_1 = *(int *)this;
  if (var_1 == 0) {
    if (var_2 == (type_2 *)0x0) {
      var_1 = var_3 + 1;
      var_3 = var_1;
      *(int *)this = var_1;
    }
    else {
      var_4();
      var_5();
      var_1 = var_3 + 1;
      var_3 = var_3 + 1;
      *(int *)this = var_1;
    }
  }
  return var_1 + -1;
}


(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: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (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: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (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: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier)))))))) (return_statement (binary_expression left: (identifier) right: (number_literal))))))

/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */

int MASKED(int *param_1)

{
  int iVar1;
  
  iVar1 = *param_1;
  if (iVar1 == 0) {
    if (PTR___pthread_key_create_005e9ff8 == (undefined *)0x0) {
      iVar1 = DAT_005f2584 + 1;
      DAT_005f2584 = iVar1;
      *param_1 = iVar1;
    }
    else {
      LOCK();
      UNLOCK();
      iVar1 = DAT_005f2584 + 1;
      DAT_005f2584 = DAT_005f2584 + 1;
      *param_1 = iVar1;
    }
  }
  return iVar1 + -1;
}

