
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::copy(char*, unsigned int, unsigned int) const */

size_t __thiscall std::string::copy(string *this,char *param_1,uint param_2,uint param_3)

{
  uint uVar1;
  char *__src;
  uint __n;
  
  uVar1 = *(uint *)(*(int *)this + -0xc);
  if (uVar1 < param_3) {
                    /* WARNING: Subroutine does not return */
    __throw_out_of_range_fmt
              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3
               ,uVar1);
  }
  __n = uVar1 - param_3;
  if (param_2 < uVar1 - param_3) {
    __n = param_2;
  }
  if (__n != 0) {
    __src = (char *)(param_3 + *(int *)this);
    if (__n == 1) {
      *param_1 = *__src;
      return 1;
    }
    memcpy(param_1,__src,__n);
  }
  return __n;
}



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

size_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)

{
  uint uVar1;
  undefined1 *__src;
  uint __n;
  
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (uVar1 < param_4) {
                    /* WARNING: Subroutine does not return */
    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",
                 param_4,uVar1);
  }
  __n = uVar1 - param_4;
  if (param_3 < uVar1 - param_4) {
    __n = param_3;
  }
  if (__n != 0) {
    __src = (undefined1 *)(param_4 + *param_1);
    if (__n == 1) {
      *param_2 = *__src;
      return 1;
    }
    memcpy(param_2,__src,__n);
  }
  return __n;
}


PUSH ESI
PUSH EBX
CALL 0x00032730
ADD EBX,0x14aab9
SUB ESP,0x4
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x1c]
MOV ECX,dword ptr [ESP + 0x18]
MOV EDX,dword ptr [EDX]
MOV ESI,dword ptr [EDX + -0xc]
CMP EAX,ESI
JA 0x001b75a1
SUB ESI,EAX
CMP ESI,ECX
CMOVA ESI,ECX
TEST ESI,ESI
JZ 0x001b7588
ADD EAX,EDX
CMP ESI,0x1
JZ 0x001b7590
SUB ESP,0x4
PUSH ESI
PUSH EAX
PUSH dword ptr [ESP + 0x20]
CALL 0x000265c0
ADD ESP,0x10
ADD ESP,0x4
MOV EAX,ESI
POP EBX
POP ESI
RET
MOVZX EAX,byte ptr [EAX]
MOV EBX,dword ptr [ESP + 0x14]
MOV byte ptr [EBX],AL
ADD ESP,0x4
MOV EAX,ESI
POP EBX
POP ESI
RET
PUSH ESI
PUSH EAX
LEA EAX,[EBX + 0xfff388f6]
PUSH EAX
LEA EAX,[EBX + 0xfff21910]
PUSH EAX
CALL 0x001c6230
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsize_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)\n\n{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}\n\n" comment (function_definition "size_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)\n\n{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" primitive_type (function_declarator "FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_1 + -0xc)" * (cast_expression "(uint *)(*param_1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (uVar1 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" if (parenthesized_expression "(uVar1 < param_4)" ( (binary_expression "uVar1 < param_4" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" { comment (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::copy"" " string_content ") , identifier , identifier ))) ;) })) (expression_statement "__n = uVar1 - param_4;" (assignment_expression "__n = uVar1 - param_4" identifier = (binary_expression "uVar1 - param_4" identifier - identifier)) ;) (if_statement "if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }" if (parenthesized_expression "(param_3 < uVar1 - param_4)" ( (binary_expression "param_3 < uVar1 - param_4" identifier < (binary_expression "uVar1 - param_4" identifier - identifier)) )) (compound_statement "{\n    __n = param_3;\n  }" { (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" { (expression_statement "__src = (undefined1 *)(param_4 + *param_1);" (assignment_expression "__src = (undefined1 *)(param_4 + *param_1)" identifier = (cast_expression "(undefined1 *)(param_4 + *param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_4 + *param_1)" ( (binary_expression "param_4 + *param_1" identifier + (pointer_expression "*param_1" * identifier)) )))) ;) (if_statement "if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      *param_2 = *__src;\n      return 1;\n    }" { (expression_statement "*param_2 = *__src;" (assignment_expression "*param_2 = *__src" (pointer_expression "*param_2" * identifier) = (pointer_expression "*__src" * identifier)) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "memcpy(param_2,__src,__n);" (call_expression "memcpy(param_2,__src,__n)" identifier (argument_list "(param_2,__src,__n)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return __n;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::copy(char*, unsigned int, unsigned int) const */\n\nsize_t __thiscall std::string::copy(string *this,char *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  char *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (uVar1 < param_3) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);\n  }\n  __n = uVar1 - param_3;\n  if (param_2 < uVar1 - param_3) {\n    __n = param_2;\n  }\n  if (__n != 0) {\n    __src = (char *)(param_3 + *(int *)this);\n    if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }\n    memcpy(param_1,__src,__n);\n  }\n  return __n;\n}\n\n" comment comment (function_definition "size_t __thiscall std::string::copy(string *this,char *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  char *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (uVar1 < param_3) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);\n  }\n  __n = uVar1 - param_3;\n  if (param_2 < uVar1 - param_3) {\n    __n = param_2;\n  }\n  if (__n != 0) {\n    __src = (char *)(param_3 + *(int *)this);\n    if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }\n    memcpy(param_1,__src,__n);\n  }\n  return __n;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "copy(string *this,char *param_1,uint param_2,uint param_3)" identifier (parameter_list "(string *this,char *param_1,uint param_2,uint param_3)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  char *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (uVar1 < param_3) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);\n  }\n  __n = uVar1 - param_3;\n  if (param_2 < uVar1 - param_3) {\n    __n = param_2;\n  }\n  if (__n != 0) {\n    __src = (char *)(param_3 + *(int *)this);\n    if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }\n    memcpy(param_1,__src,__n);\n  }\n  return __n;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*(int *)this + -0xc);" (assignment_expression "uVar1 = *(uint *)(*(int *)this + -0xc)" identifier = (pointer_expression "*(uint *)(*(int *)this + -0xc)" * (cast_expression "(uint *)(*(int *)this + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (uVar1 < param_3) {\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);\n  }" if (parenthesized_expression "(uVar1 < param_3)" ( (binary_expression "uVar1 < param_3" identifier < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);\n  }" { comment (expression_statement "__throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1);" (call_expression "__throw_out_of_range_fmt\n              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",param_3\n               ,uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::copy"" " string_content ") , identifier , identifier ))) ;) })) (expression_statement "__n = uVar1 - param_3;" (assignment_expression "__n = uVar1 - param_3" identifier = (binary_expression "uVar1 - param_3" identifier - identifier)) ;) (if_statement "if (param_2 < uVar1 - param_3) {\n    __n = param_2;\n  }" if (parenthesized_expression "(param_2 < uVar1 - param_3)" ( (binary_expression "param_2 < uVar1 - param_3" identifier < (binary_expression "uVar1 - param_3" identifier - identifier)) )) (compound_statement "{\n    __n = param_2;\n  }" { (expression_statement "__n = param_2;" (assignment_expression "__n = param_2" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n    __src = (char *)(param_3 + *(int *)this);\n    if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }\n    memcpy(param_1,__src,__n);\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    __src = (char *)(param_3 + *(int *)this);\n    if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }\n    memcpy(param_1,__src,__n);\n  }" { (expression_statement "__src = (char *)(param_3 + *(int *)this);" (assignment_expression "__src = (char *)(param_3 + *(int *)this)" identifier = (cast_expression "(char *)(param_3 + *(int *)this)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + *(int *)this)" ( (binary_expression "param_3 + *(int *)this" identifier + (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )))) ;) (if_statement "if (__n == 1) {\n      *param_1 = *__src;\n      return 1;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      *param_1 = *__src;\n      return 1;\n    }" { (expression_statement "*param_1 = *__src;" (assignment_expression "*param_1 = *__src" (pointer_expression "*param_1" * identifier) = (pointer_expression "*__src" * identifier)) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "memcpy(param_1,__src,__n);" (call_expression "memcpy(param_1,__src,__n)" identifier (argument_list "(param_1,__src,__n)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return __n;" return identifier ;) })))
(translation_unit "size_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)\n\n{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}\n\n" (function_definition "size_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)\n\n{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" primitive_type (function_declarator "FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "undefined1 *__src;" type_identifier (pointer_declarator "*__src" * identifier) ;) (declaration "uint __n;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_1 + -0xc)" * (cast_expression "(uint *)(*param_1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" if (parenthesized_expression "(uVar1 < param_4)" ( (binary_expression "uVar1 < param_4" identifier < identifier) )) (compound_statement "{\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" { (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::copy"" " string_content ") , identifier , identifier ))) ;) })) (expression_statement "__n = uVar1 - param_4;" (assignment_expression "__n = uVar1 - param_4" identifier = (binary_expression "uVar1 - param_4" identifier - identifier)) ;) (if_statement "if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }" if (parenthesized_expression "(param_3 < uVar1 - param_4)" ( (binary_expression "param_3 < uVar1 - param_4" identifier < (binary_expression "uVar1 - param_4" identifier - identifier)) )) (compound_statement "{\n    __n = param_3;\n  }" { (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" identifier = identifier) ;) })) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" { (expression_statement "__src = (undefined1 *)(param_4 + *param_1);" (assignment_expression "__src = (undefined1 *)(param_4 + *param_1)" identifier = (cast_expression "(undefined1 *)(param_4 + *param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_4 + *param_1)" ( (binary_expression "param_4 + *param_1" identifier + (pointer_expression "*param_1" * identifier)) )))) ;) (if_statement "if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n      *param_2 = *__src;\n      return 1;\n    }" { (expression_statement "*param_2 = *__src;" (assignment_expression "*param_2 = *__src" (pointer_expression "*param_2" * identifier) = (pointer_expression "*__src" * identifier)) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "memcpy(param_2,__src,__n);" (call_expression "memcpy(param_2,__src,__n)" identifier (argument_list "(param_2,__src,__n)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return __n;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT , IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (pointer_expression * IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })) (return_statement return IDENT ;) })))
(function_definition "size_t FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)\n\n{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" (primitive_type "size_t") (function_declarator "FUN_001b7540(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" (identifier "FUN_001b7540") (parameter_list "(int *param_1,undefined1 *param_2,uint param_3,uint param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  uint uVar1;\n  undefined1 *__src;\n  uint __n;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }\n  __n = uVar1 - param_4;\n  if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }\n  if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }\n  return __n;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "undefined1 *__src;" (type_identifier "undefined1") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "uint __n;" (type_identifier "uint") (identifier "__n") (; ";")) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(*param_1 + -0xc)" (* "*") (cast_expression "(uint *)(*param_1 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (uVar1 < param_4) {\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" (if "if") (parenthesized_expression "(uVar1 < param_4)" (( "(") (binary_expression "uVar1 < param_4" (identifier "uVar1") (< "<") (identifier "param_4")) () ")")) (compound_statement "{\n                    \n    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);\n  }" ({ "{") (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" (identifier "FUN_001c6230") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",\n                 param_4,uVar1)" (( "(") (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" (" """) (string_content "%s: __pos (which is %zu) > this->size() (which is %zu)") (" """)) (, ",") (string_literal ""basic_string::copy"" (" """) (string_content "basic_string::copy") (" """)) (, ",") (identifier "param_4") (, ",") (identifier "uVar1") () ")"))) (; ";")) (} "}"))) (expression_statement "__n = uVar1 - param_4;" (assignment_expression "__n = uVar1 - param_4" (identifier "__n") (= "=") (binary_expression "uVar1 - param_4" (identifier "uVar1") (- "-") (identifier "param_4"))) (; ";")) (if_statement "if (param_3 < uVar1 - param_4) {\n    __n = param_3;\n  }" (if "if") (parenthesized_expression "(param_3 < uVar1 - param_4)" (( "(") (binary_expression "param_3 < uVar1 - param_4" (identifier "param_3") (< "<") (binary_expression "uVar1 - param_4" (identifier "uVar1") (- "-") (identifier "param_4"))) () ")")) (compound_statement "{\n    __n = param_3;\n  }" ({ "{") (expression_statement "__n = param_3;" (assignment_expression "__n = param_3" (identifier "__n") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (if_statement "if (__n != 0) {\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    __src = (undefined1 *)(param_4 + *param_1);\n    if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }\n    memcpy(param_2,__src,__n);\n  }" ({ "{") (expression_statement "__src = (undefined1 *)(param_4 + *param_1);" (assignment_expression "__src = (undefined1 *)(param_4 + *param_1)" (identifier "__src") (= "=") (cast_expression "(undefined1 *)(param_4 + *param_1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_4 + *param_1)" (( "(") (binary_expression "param_4 + *param_1" (identifier "param_4") (+ "+") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n      *param_2 = *__src;\n      return 1;\n    }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *param_2 = *__src;\n      return 1;\n    }" ({ "{") (expression_statement "*param_2 = *__src;" (assignment_expression "*param_2 = *__src" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "memcpy(param_2,__src,__n);" (call_expression "memcpy(param_2,__src,__n)" (identifier "memcpy") (argument_list "(param_2,__src,__n)" (( "(") (identifier "param_2") (, ",") (identifier "__src") (, ",") (identifier "__n") () ")"))) (; ";")) (} "}"))) (return_statement "return __n;" (return "return") (identifier "__n") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::string::copy(char*, unsigned int, unsigned int) const */

size_t __thiscall std::type_1::function_1(type_1 *this,char *param_1,type_2 var_4,type_2 var_2)

{
  type_2 var_1;
  char *__src;
  type_2 var_5;
  
  var_1 = *(type_2 *)(*(int *)this + -0xc);
  if (var_1 < var_2) {
                    /* WARNING: Subroutine does not return */
    var_3
              ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",var_2
               ,var_1);
  }
  var_5 = var_1 - var_2;
  if (var_4 < var_1 - var_2) {
    var_5 = var_4;
  }
  if (var_5 != 0) {
    __src = (char *)(var_2 + *(int *)this);
    if (var_5 == 1) {
      *param_1 = *__src;
      return 1;
    }
    var_6(param_1,__src,var_5);
  }
  return var_5;
}


(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))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content)) (string_literal (string_content)) (identifier) (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (return_statement (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (return_statement (identifier)))))

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

size_t MASKED(int *param_1,undefined1 *param_2,uint param_3,uint param_4)

{
  uint uVar1;
  undefined1 *__src;
  uint __n;
  
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (uVar1 < param_4) {
                    /* WARNING: Subroutine does not return */
    FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::copy",
                 param_4,uVar1);
  }
  __n = uVar1 - param_4;
  if (param_3 < uVar1 - param_4) {
    __n = param_3;
  }
  if (__n != 0) {
    __src = (undefined1 *)(param_4 + *param_1);
    if (__n == 1) {
      *param_2 = *__src;
      return 1;
    }
    memcpy(param_2,__src,__n);
  }
  return __n;
}

