
/* std::string::erase(__normal_iterator<char*, std::string >, __normal_iterator<char*, std::string
   >) */

long __thiscall std::string::erase(string *this,undefined1 *param_2,long param_3)

{
  ulong uVar1;
  
  uVar1 = (long)param_2 - *(long *)this;
  if (param_3 != *(long *)this + *(long *)(this + 8)) {
    _M_erase(this,uVar1,param_3 - (long)param_2);
    return *(long *)this + uVar1;
  }
  *(ulong *)(this + 8) = uVar1;
  *param_2 = 0;
  return *(long *)this + uVar1;
}



long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)

{
  long lVar1;
  
  lVar1 = (long)param_2 - *param_1;
  if (param_3 != *param_1 + param_1[1]) {
    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);
    return *param_1 + lVar1;
  }
  param_1[1] = lVar1;
  *param_2 = 0;
  return *param_1 + lVar1;
}


PUSH RBP
MOV RBP,RDI
PUSH RBX
MOV RBX,RSI
SUB RSP,0x8
MOV RCX,qword ptr [RDI]
SUB RBX,RCX
ADD RCX,qword ptr [RDI + 0x8]
CMP RDX,RCX
JZ 0x0037bea8
SUB RDX,RSI
MOV RSI,RBX
CALL 0x002f8c90
MOV RAX,qword ptr [RBP]
ADD RSP,0x8
ADD RAX,RBX
POP RBX
POP RBP
RET
MOV qword ptr [RDI + 0x8],RBX
MOV byte ptr [RSI],0x0
MOV RAX,qword ptr [RBP]
ADD RSP,0x8
ADD RAX,RBX
POP RBX
POP RBP
RET
(translation_unit "long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}\n\n" (function_definition "long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = (long)param_2 - *param_1;" (assignment_expression "lVar1 = (long)param_2 - *param_1" identifier = (binary_expression "(long)param_2 - *param_1" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" if (parenthesized_expression "(param_3 != *param_1 + param_1[1])" ( (binary_expression "param_3 != *param_1 + param_1[1]" identifier != (binary_expression "*param_1 + param_1[1]" (pointer_expression "*param_1" * identifier) + (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" { (expression_statement "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);" (call_expression "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2)" identifier (argument_list "(param_1,lVar1,param_3 - (long)param_2)" ( identifier , identifier , (binary_expression "param_3 - (long)param_2" identifier - (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) ;) (return_statement "return *param_1 + lVar1;" return (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" * identifier) + identifier) ;) })) (expression_statement "param_1[1] = lVar1;" (assignment_expression "param_1[1] = lVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return *param_1 + lVar1;" return (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" * identifier) + identifier) ;) })))
(translation_unit "/* std::string::erase(__normal_iterator<char*, std::string >, __normal_iterator<char*, std::string\n   >) */\n\nlong __thiscall std::string::erase(string *this,undefined1 *param_2,long param_3)\n\n{\n  ulong uVar1;\n  \n  uVar1 = (long)param_2 - *(long *)this;\n  if (param_3 != *(long *)this + *(long *)(this + 8)) {\n    _M_erase(this,uVar1,param_3 - (long)param_2);\n    return *(long *)this + uVar1;\n  }\n  *(ulong *)(this + 8) = uVar1;\n  *param_2 = 0;\n  return *(long *)this + uVar1;\n}\n\n" comment (function_definition "long __thiscall std::string::erase(string *this,undefined1 *param_2,long param_3)\n\n{\n  ulong uVar1;\n  \n  uVar1 = (long)param_2 - *(long *)this;\n  if (param_3 != *(long *)this + *(long *)(this + 8)) {\n    _M_erase(this,uVar1,param_3 - (long)param_2);\n    return *(long *)this + uVar1;\n  }\n  *(ulong *)(this + 8) = uVar1;\n  *param_2 = 0;\n  return *(long *)this + uVar1;\n}" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "erase(string *this,undefined1 *param_2,long param_3)" identifier (parameter_list "(string *this,undefined1 *param_2,long param_3)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  ulong uVar1;\n  \n  uVar1 = (long)param_2 - *(long *)this;\n  if (param_3 != *(long *)this + *(long *)(this + 8)) {\n    _M_erase(this,uVar1,param_3 - (long)param_2);\n    return *(long *)this + uVar1;\n  }\n  *(ulong *)(this + 8) = uVar1;\n  *param_2 = 0;\n  return *(long *)this + uVar1;\n}" { (declaration "ulong uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = (long)param_2 - *(long *)this;" (assignment_expression "uVar1 = (long)param_2 - *(long *)this" identifier = (binary_expression "(long)param_2 - *(long *)this" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)))) ;) (if_statement "if (param_3 != *(long *)this + *(long *)(this + 8)) {\n    _M_erase(this,uVar1,param_3 - (long)param_2);\n    return *(long *)this + uVar1;\n  }" if (parenthesized_expression "(param_3 != *(long *)this + *(long *)(this + 8))" ( (binary_expression "param_3 != *(long *)this + *(long *)(this + 8)" identifier != (binary_expression "*(long *)this + *(long *)(this + 8)" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + (pointer_expression "*(long *)(this + 8)" * (cast_expression "(long *)(this + 8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) )) (compound_statement "{\n    _M_erase(this,uVar1,param_3 - (long)param_2);\n    return *(long *)this + uVar1;\n  }" { (expression_statement "_M_erase(this,uVar1,param_3 - (long)param_2);" (call_expression "_M_erase(this,uVar1,param_3 - (long)param_2)" identifier (argument_list "(this,uVar1,param_3 - (long)param_2)" ( identifier , identifier , (binary_expression "param_3 - (long)param_2" identifier - (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) ;) (return_statement "return *(long *)this + uVar1;" return (binary_expression "*(long *)this + uVar1" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) ;) })) (expression_statement "*(ulong *)(this + 8) = uVar1;" (assignment_expression "*(ulong *)(this + 8) = uVar1" (pointer_expression "*(ulong *)(this + 8)" * (cast_expression "(ulong *)(this + 8)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return *(long *)this + uVar1;" return (binary_expression "*(long *)this + uVar1" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) ;) })))
(translation_unit "long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}\n\n" (function_definition "long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = (long)param_2 - *param_1;" (assignment_expression "lVar1 = (long)param_2 - *param_1" identifier = (binary_expression "(long)param_2 - *param_1" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" if (parenthesized_expression "(param_3 != *param_1 + param_1[1])" ( (binary_expression "param_3 != *param_1 + param_1[1]" identifier != (binary_expression "*param_1 + param_1[1]" (pointer_expression "*param_1" * identifier) + (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" { (expression_statement "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);" (call_expression "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2)" identifier (argument_list "(param_1,lVar1,param_3 - (long)param_2)" ( identifier , identifier , (binary_expression "param_3 - (long)param_2" identifier - (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) ;) (return_statement "return *param_1 + lVar1;" return (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" * identifier) + identifier) ;) })) (expression_statement "param_1[1] = lVar1;" (assignment_expression "param_1[1] = lVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" * identifier) = number_literal) ;) (return_statement "return *param_1 + lVar1;" return (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" * identifier) + identifier) ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) - (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (binary_expression (pointer_expression * IDENT) + (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression IDENT - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ))) ;) (return_statement return (binary_expression (pointer_expression * IDENT) + IDENT) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return (binary_expression (pointer_expression * IDENT) + IDENT) ;) })))
(function_definition "long FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_0037be70(long *param_1,undefined1 *param_2,long param_3)" (identifier "FUN_0037be70") (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) () ")"))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = (long)param_2 - *param_1;\n  if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }\n  param_1[1] = lVar1;\n  *param_2 = 0;\n  return *param_1 + lVar1;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (expression_statement "lVar1 = (long)param_2 - *param_1;" (assignment_expression "lVar1 = (long)param_2 - *param_1" (identifier "lVar1") (= "=") (binary_expression "(long)param_2 - *param_1" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (- "-") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if (param_3 != *param_1 + param_1[1]) {\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" (if "if") (parenthesized_expression "(param_3 != *param_1 + param_1[1])" (( "(") (binary_expression "param_3 != *param_1 + param_1[1]" (identifier "param_3") (!= "!=") (binary_expression "*param_1 + param_1[1]" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (compound_statement "{\n    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);\n    return *param_1 + lVar1;\n  }" ({ "{") (expression_statement "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);" (call_expression "FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2)" (identifier "FUN_002f8c90") (argument_list "(param_1,lVar1,param_3 - (long)param_2)" (( "(") (identifier "param_1") (, ",") (identifier "lVar1") (, ",") (binary_expression "param_3 - (long)param_2" (identifier "param_3") (- "-") (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2"))) () ")"))) (; ";")) (return_statement "return *param_1 + lVar1;" (return "return") (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "lVar1")) (; ";")) (} "}"))) (expression_statement "param_1[1] = lVar1;" (assignment_expression "param_1[1] = lVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "lVar1")) (; ";")) (expression_statement "*param_2 = 0;" (assignment_expression "*param_2 = 0" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "0")) (; ";")) (return_statement "return *param_1 + lVar1;" (return "return") (binary_expression "*param_1 + lVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "lVar1")) (; ";")) (} "}")))

/* std::string::erase(__normal_iterator<char*, std::string >, __normal_iterator<char*, std::string
   >) */

long __thiscall std::type_1::function_1(type_1 *var_2,type_2 *param_2,long var_1)

{
  type_3 var_4;
  
  var_4 = (long)param_2 - *(long *)var_2;
  if (var_1 != *(long *)var_2 + *(long *)(var_2 + 8)) {
    var_3(var_2,var_4,var_1 - (long)param_2);
    return *(long *)var_2 + var_4;
  }
  *(type_3 *)(var_2 + 8) = var_4;
  *param_2 = 0;
  return *(long *)var_2 + var_4;
}


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

long MASKED(long *param_1,undefined1 *param_2,long param_3)

{
  long lVar1;
  
  lVar1 = (long)param_2 - *param_1;
  if (param_3 != *param_1 + param_1[1]) {
    FUN_002f8c90(param_1,lVar1,param_3 - (long)param_2);
    return *param_1 + lVar1;
  }
  param_1[1] = lVar1;
  *param_2 = 0;
  return *param_1 + lVar1;
}

