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

string * __thiscall std::string::assign(string *this,char *param_1,uint param_2)

{
  string *psVar1;
  uint uVar2;
  char *pcVar3;
  
  pcVar3 = *(char **)this;
  uVar2 = *(uint *)(pcVar3 + -0xc);
  if (0x3ffffffc < param_2) {
                    /* WARNING: Subroutine does not return */
    __throw_length_error("basic_string::assign");
  }
  if ((param_1 < pcVar3) || (pcVar3 + uVar2 < param_1)) {
LAB_0021f4d3:
    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);
    return psVar1;
  }
  if (0 < *(int *)(pcVar3 + -4)) {
    uVar2 = *(uint *)(*(int *)this + -0xc);
    goto LAB_0021f4d3;
  }
  pcVar3 = *(char **)this;
  if ((uint)((int)param_1 - (int)pcVar3) < param_2) {
    if (param_1 == pcVar3) goto LAB_0021f530;
    if (param_2 != 1) {
      memmove(pcVar3,param_1,param_2);
      pcVar3 = *(char **)this;
      goto LAB_0021f530;
    }
  }
  else if (param_2 != 1) {
    if (param_2 != 0) {
      memcpy(pcVar3,param_1,param_2);
      pcVar3 = *(char **)this;
    }
    goto LAB_0021f530;
  }
  *pcVar3 = *param_1;
  pcVar3 = *(char **)this;
LAB_0021f530:
  if (pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc) {
    return this;
  }
  pcVar3[-0xffffffff00000004] = '\0';
  pcVar3[-0xffffffff00000003] = '\0';
  pcVar3[-0xffffffff00000002] = '\0';
  pcVar3[-0xffffffff00000001] = '\0';
  *(uint *)(pcVar3 + -0xc) = param_2;
  pcVar3[param_2] = '\0';
  return this;
}



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

int * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)

{
  int *piVar1;
  int iVar2;
  undefined1 *puVar3;
  
  puVar3 = (undefined1 *)*param_1;
  iVar2 = *(int *)(puVar3 + -0xc);
  if (0x3ffffffc < param_3) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::assign");
  }
  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {
LAB_0021f4d3:
    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);
    return piVar1;
  }
  if (0 < *(int *)(puVar3 + -4)) {
    iVar2 = *(int *)(*param_1 + -0xc);
    goto LAB_0021f4d3;
  }
  puVar3 = (undefined1 *)*param_1;
  if ((uint)((int)param_2 - (int)puVar3) < param_3) {
    if (param_2 == puVar3) goto LAB_0021f530;
    if (param_3 != 1) {
      memmove(puVar3,param_2,param_3);
      puVar3 = (undefined1 *)*param_1;
      goto LAB_0021f530;
    }
  }
  else if (param_3 != 1) {
    if (param_3 != 0) {
      memcpy(puVar3,param_2,param_3);
      puVar3 = (undefined1 *)*param_1;
    }
    goto LAB_0021f530;
  }
  *puVar3 = *param_2;
  puVar3 = (undefined1 *)*param_1;
LAB_0021f530:
  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {
    return param_1;
  }
  *(undefined4 *)(puVar3 + -4) = 0;
  *(uint *)(puVar3 + -0xc) = param_3;
  puVar3[param_3] = 0;
  return param_1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x16fb57
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x28]
MOV ECX,dword ptr [ESP + 0x24]
MOV EAX,dword ptr [ESI]
MOV EDX,dword ptr [EAX + -0xc]
CMP EDI,0x3ffffffc
JA 0x0021f579
CMP EAX,ECX
JBE 0x0021f4f0
SUB ESP,0xc
PUSH EDI
PUSH ECX
PUSH EDX
PUSH 0x0
PUSH ESI
CALL 0x0021f430
ADD ESP,0x20
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EBP,[EAX + EDX*0x1]
CMP ECX,EBP
JA 0x0021f4d3
MOV EAX,dword ptr [EAX + -0x4]
TEST EAX,EAX
JLE 0x0021f508
MOV EAX,dword ptr [ESI]
MOV EDX,dword ptr [EAX + -0xc]
JMP 0x0021f4d3
MOV EDX,dword ptr [ESI]
MOV EAX,ECX
SUB EAX,EDX
CMP EDI,EAX
JBE 0x0021f550
TEST EAX,EAX
JZ 0x0021f530
CMP EDI,0x1
JZ 0x0021f570
SUB ESP,0x4
PUSH EDI
PUSH ECX
PUSH EDX
CALL 0x000298a0
MOV EDX,dword ptr [ESI]
ADD ESP,0x10
LEA ESI,[ESI]
NOP
LEA ECX,[EDX + -0xc]
MOV EAX,ESI
CMP ECX,dword ptr [EBX + 0xfffffcdc]
JZ 0x0021f4e4
MOV dword ptr [EDX + -0x4],0x0
MOV dword ptr [EDX + -0xc],EDI
MOV byte ptr [EDX + EDI*0x1],0x0
JMP 0x0021f4e4
CMP EDI,0x1
JZ 0x0021f570
TEST EDI,EDI
JZ 0x0021f530
SUB ESP,0x4
PUSH EDI
PUSH ECX
PUSH EDX
CALL 0x000295c0
MOV EDX,dword ptr [ESI]
ADD ESP,0x10
JMP 0x0021f530
MOVZX EAX,byte ptr [ECX]
MOV byte ptr [EDX],AL
MOV EDX,dword ptr [ESI]
JMP 0x0021f530
SUB ESP,0xc
LEA EAX,[EBX + 0xfff14d81]
PUSH EAX
CALL 0x0022c7a0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}\n\n" comment (function_definition "int * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" * (function_declarator "FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" ( (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) )))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "iVar2 = *(int *)(puVar3 + -0xc);" (assignment_expression "iVar2 = *(int *)(puVar3 + -0xc)" identifier = (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (0x3ffffffc < param_3) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::assign");\n  }" if (parenthesized_expression "(0x3ffffffc < param_3)" ( (binary_expression "0x3ffffffc < param_3" number_literal < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::assign");\n  }" { comment (expression_statement "FUN_0022c7a0("basic_string::assign");" (call_expression "FUN_0022c7a0("basic_string::assign")" identifier (argument_list "("basic_string::assign")" ( (string_literal ""basic_string::assign"" " string_content ") ))) ;) })) (if_statement "if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" if (parenthesized_expression "((param_2 < puVar3) || (puVar3 + iVar2 < param_2))" ( (binary_expression "(param_2 < puVar3) || (puVar3 + iVar2 < param_2)" (parenthesized_expression "(param_2 < puVar3)" ( (binary_expression "param_2 < puVar3" identifier < identifier) )) || (parenthesized_expression "(puVar3 + iVar2 < param_2)" ( (binary_expression "puVar3 + iVar2 < param_2" (binary_expression "puVar3 + iVar2" identifier + identifier) < identifier) ))) )) (compound_statement "{\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" { (labeled_statement "LAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" statement_identifier : (expression_statement "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" (assignment_expression "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" identifier = (cast_expression "(int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0021f430(param_1,0,iVar2,param_2,param_3)" identifier (argument_list "(param_1,0,iVar2,param_2,param_3)" ( identifier , number_literal , identifier , identifier , identifier ))))) ;)) (return_statement "return piVar1;" return identifier ;) })) (if_statement "if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" if (parenthesized_expression "(0 < *(int *)(puVar3 + -4))" ( (binary_expression "0 < *(int *)(puVar3 + -4)" number_literal < (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) ))))) )) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" { (expression_statement "iVar2 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc)" identifier = (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (goto_statement "goto LAB_0021f4d3;" goto statement_identifier ;) })) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "((uint)((int)param_2 - (int)puVar3) < param_3)" ( (binary_expression "(uint)((int)param_2 - (int)puVar3) < param_3" (call_expression "(uint)((int)param_2 - (int)puVar3)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_2 - (int)puVar3)" ( (binary_expression "(int)param_2 - (int)puVar3" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ))) < identifier) )) (compound_statement "{\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }" { (if_statement "if (param_2 == puVar3) goto LAB_0021f530;" if (parenthesized_expression "(param_2 == puVar3)" ( (binary_expression "param_2 == puVar3" identifier == identifier) )) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;)) (if_statement "if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" if (parenthesized_expression "(param_3 != 1)" ( (binary_expression "param_3 != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" { (expression_statement "memmove(puVar3,param_2,param_3);" (call_expression "memmove(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })) }) (else_clause "else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" else (if_statement "if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "(param_3 != 1)" ( (binary_expression "param_3 != 1" identifier != number_literal) )) (compound_statement "{\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" { (if_statement "if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" { (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })))) (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (labeled_statement "LAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" statement_identifier : (if_statement "if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" if (parenthesized_expression "(puVar3 + -0xc == PTR_DAT_0038ecdc)" ( (binary_expression "puVar3 + -0xc == PTR_DAT_0038ecdc" (binary_expression "puVar3 + -0xc" identifier + number_literal) == identifier) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) }))) (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" * (cast_expression "(undefined4 *)(puVar3 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(puVar3 + -0xc) = param_3;" (assignment_expression "*(uint *)(puVar3 + -0xc) = param_3" (pointer_expression "*(uint *)(puVar3 + -0xc)" * (cast_expression "(uint *)(puVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "puVar3[param_3] = 0;" (assignment_expression "puVar3[param_3] = 0" (subscript_expression "puVar3[param_3]" identifier [ identifier ]) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::assign(char const*, unsigned int) */\n\nstring * __thiscall std::string::assign(string *this,char *param_1,uint param_2)\n\n{\n  string *psVar1;\n  uint uVar2;\n  char *pcVar3;\n  \n  pcVar3 = *(char **)this;\n  uVar2 = *(uint *)(pcVar3 + -0xc);\n  if (0x3ffffffc < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::assign");\n  }\n  if ((param_1 < pcVar3) || (pcVar3 + uVar2 < param_1)) {\nLAB_0021f4d3:\n    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);\n    return psVar1;\n  }\n  if (0 < *(int *)(pcVar3 + -4)) {\n    uVar2 = *(uint *)(*(int *)this + -0xc);\n    goto LAB_0021f4d3;\n  }\n  pcVar3 = *(char **)this;\n  if ((uint)((int)param_1 - (int)pcVar3) < param_2) {\n    if (param_1 == pcVar3) goto LAB_0021f530;\n    if (param_2 != 1) {\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_2 != 1) {\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }\n  *pcVar3 = *param_1;\n  pcVar3 = *(char **)this;\nLAB_0021f530:\n  if (pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc) {\n    return this;\n  }\n  pcVar3[-0xffffffff00000004] = '\0';\n  pcVar3[-0xffffffff00000003] = '\0';\n  pcVar3[-0xffffffff00000002] = '\0';\n  pcVar3[-0xffffffff00000001] = '\0';\n  *(uint *)(pcVar3 + -0xc) = param_2;\n  pcVar3[param_2] = '\0';\n  return this;\n}\n\n" comment comment (ERROR "string * __thiscall std::string::assign(string *this,char *param_1,uint param_2)" (binary_expression "string * __thiscall std::string::assign(string *this" (binary_expression "string * __thiscall" identifier * identifier) (ERROR "std::string::assign(string" identifier : : identifier : : identifier ( identifier) * identifier) , primitive_type (pointer_declarator "*param_1" * identifier) , identifier identifier )) (compound_statement "{\n  string *psVar1;\n  uint uVar2;\n  char *pcVar3;\n  \n  pcVar3 = *(char **)this;\n  uVar2 = *(uint *)(pcVar3 + -0xc);\n  if (0x3ffffffc < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::assign");\n  }\n  if ((param_1 < pcVar3) || (pcVar3 + uVar2 < param_1)) {\nLAB_0021f4d3:\n    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);\n    return psVar1;\n  }\n  if (0 < *(int *)(pcVar3 + -4)) {\n    uVar2 = *(uint *)(*(int *)this + -0xc);\n    goto LAB_0021f4d3;\n  }\n  pcVar3 = *(char **)this;\n  if ((uint)((int)param_1 - (int)pcVar3) < param_2) {\n    if (param_1 == pcVar3) goto LAB_0021f530;\n    if (param_2 != 1) {\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_2 != 1) {\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }\n  *pcVar3 = *param_1;\n  pcVar3 = *(char **)this;\nLAB_0021f530:\n  if (pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc) {\n    return this;\n  }\n  pcVar3[-0xffffffff00000004] = '\0';\n  pcVar3[-0xffffffff00000003] = '\0';\n  pcVar3[-0xffffffff00000002] = '\0';\n  pcVar3[-0xffffffff00000001] = '\0';\n  *(uint *)(pcVar3 + -0xc) = param_2;\n  pcVar3[param_2] = '\0';\n  return this;\n}" { (declaration "string *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "uVar2 = *(uint *)(pcVar3 + -0xc);" (assignment_expression "uVar2 = *(uint *)(pcVar3 + -0xc)" identifier = (pointer_expression "*(uint *)(pcVar3 + -0xc)" * (cast_expression "(uint *)(pcVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (0x3ffffffc < param_2) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::assign");\n  }" if (parenthesized_expression "(0x3ffffffc < param_2)" ( (binary_expression "0x3ffffffc < param_2" number_literal < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::assign");\n  }" { comment (expression_statement "__throw_length_error("basic_string::assign");" (call_expression "__throw_length_error("basic_string::assign")" identifier (argument_list "("basic_string::assign")" ( (string_literal ""basic_string::assign"" " string_content ") ))) ;) })) (if_statement "if ((param_1 < pcVar3) || (pcVar3 + uVar2 < param_1)) {\nLAB_0021f4d3:\n    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);\n    return psVar1;\n  }" if (parenthesized_expression "((param_1 < pcVar3) || (pcVar3 + uVar2 < param_1))" ( (binary_expression "(param_1 < pcVar3) || (pcVar3 + uVar2 < param_1)" (parenthesized_expression "(param_1 < pcVar3)" ( (binary_expression "param_1 < pcVar3" identifier < identifier) )) || (parenthesized_expression "(pcVar3 + uVar2 < param_1)" ( (binary_expression "pcVar3 + uVar2 < param_1" (binary_expression "pcVar3 + uVar2" identifier + identifier) < identifier) ))) )) (compound_statement "{\nLAB_0021f4d3:\n    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);\n    return psVar1;\n  }" { (labeled_statement "LAB_0021f4d3:\n    psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);" statement_identifier : (expression_statement "psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2);" (assignment_expression "psVar1 = (string *)_M_replace_safe(this,0,uVar2,param_1,param_2)" identifier = (cast_expression "(string *)_M_replace_safe(this,0,uVar2,param_1,param_2)" ( (type_descriptor "string *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "_M_replace_safe(this,0,uVar2,param_1,param_2)" identifier (argument_list "(this,0,uVar2,param_1,param_2)" ( identifier , number_literal , identifier , identifier , identifier ))))) ;)) (return_statement "return psVar1;" return identifier ;) })) (if_statement "if (0 < *(int *)(pcVar3 + -4)) {\n    uVar2 = *(uint *)(*(int *)this + -0xc);\n    goto LAB_0021f4d3;\n  }" if (parenthesized_expression "(0 < *(int *)(pcVar3 + -4))" ( (binary_expression "0 < *(int *)(pcVar3 + -4)" number_literal < (pointer_expression "*(int *)(pcVar3 + -4)" * (cast_expression "(int *)(pcVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -4)" ( (binary_expression "pcVar3 + -4" identifier + number_literal) ))))) )) (compound_statement "{\n    uVar2 = *(uint *)(*(int *)this + -0xc);\n    goto LAB_0021f4d3;\n  }" { (expression_statement "uVar2 = *(uint *)(*(int *)this + -0xc);" (assignment_expression "uVar2 = *(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) ))))) ;) (goto_statement "goto LAB_0021f4d3;" goto statement_identifier ;) })) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if ((uint)((int)param_1 - (int)pcVar3) < param_2) {\n    if (param_1 == pcVar3) goto LAB_0021f530;\n    if (param_2 != 1) {\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_2 != 1) {\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "((uint)((int)param_1 - (int)pcVar3) < param_2)" ( (binary_expression "(uint)((int)param_1 - (int)pcVar3) < param_2" (call_expression "(uint)((int)param_1 - (int)pcVar3)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_1 - (int)pcVar3)" ( (binary_expression "(int)param_1 - (int)pcVar3" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)pcVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ))) < identifier) )) (compound_statement "{\n    if (param_1 == pcVar3) goto LAB_0021f530;\n    if (param_2 != 1) {\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }\n  }" { (if_statement "if (param_1 == pcVar3) goto LAB_0021f530;" if (parenthesized_expression "(param_1 == pcVar3)" ( (binary_expression "param_1 == pcVar3" identifier == identifier) )) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;)) (if_statement "if (param_2 != 1) {\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n      goto LAB_0021f530;\n    }" { (expression_statement "memmove(pcVar3,param_1,param_2);" (call_expression "memmove(pcVar3,param_1,param_2)" identifier (argument_list "(pcVar3,param_1,param_2)" ( identifier , identifier , identifier ))) ;) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })) }) (else_clause "else if (param_2 != 1) {\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }" else (if_statement "if (param_2 != 1) {\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n    if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }\n    goto LAB_0021f530;\n  }" { (if_statement "if (param_2 != 0) {\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n      memcpy(pcVar3,param_1,param_2);\n      pcVar3 = *(char **)this;\n    }" { (expression_statement "memcpy(pcVar3,param_1,param_2);" (call_expression "memcpy(pcVar3,param_1,param_2)" identifier (argument_list "(pcVar3,param_1,param_2)" ( identifier , identifier , identifier ))) ;) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) })) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })))) (expression_statement "*pcVar3 = *param_1;" (assignment_expression "*pcVar3 = *param_1" (pointer_expression "*pcVar3" * identifier) = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "pcVar3 = *(char **)this;" (assignment_expression "pcVar3 = *(char **)this" identifier = (pointer_expression "*(char **)this" * (cast_expression "(char **)this" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (labeled_statement "LAB_0021f530:\n  if (pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc) {\n    return this;\n  }" statement_identifier : (if_statement "if (pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc) {\n    return this;\n  }" if (parenthesized_expression "(pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc)" ( (binary_expression "pcVar3 + -0xc == PTR__S_empty_rep_storage_0038ecdc" (binary_expression "pcVar3 + -0xc" identifier + number_literal) == identifier) )) (compound_statement "{\n    return this;\n  }" { (return_statement "return this;" return identifier ;) }))) (expression_statement "pcVar3[-0xffffffff00000004] = '\0';" (assignment_expression "pcVar3[-0xffffffff00000004] = '\0'" (subscript_expression "pcVar3[-0xffffffff00000004]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[-0xffffffff00000003] = '\0';" (assignment_expression "pcVar3[-0xffffffff00000003] = '\0'" (subscript_expression "pcVar3[-0xffffffff00000003]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[-0xffffffff00000002] = '\0';" (assignment_expression "pcVar3[-0xffffffff00000002] = '\0'" (subscript_expression "pcVar3[-0xffffffff00000002]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pcVar3[-0xffffffff00000001] = '\0';" (assignment_expression "pcVar3[-0xffffffff00000001] = '\0'" (subscript_expression "pcVar3[-0xffffffff00000001]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "*(uint *)(pcVar3 + -0xc) = param_2;" (assignment_expression "*(uint *)(pcVar3 + -0xc) = param_2" (pointer_expression "*(uint *)(pcVar3 + -0xc)" * (cast_expression "(uint *)(pcVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pcVar3 + -0xc)" ( (binary_expression "pcVar3 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "pcVar3[param_2] = '\0';" (assignment_expression "pcVar3[param_2] = '\0'" (subscript_expression "pcVar3[param_2]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return this;" return identifier ;) }))
(translation_unit "int * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}\n\n" (function_definition "int * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" primitive_type (pointer_declarator "* FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" * (function_declarator "FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" ( (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) )))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "iVar2 = *(int *)(puVar3 + -0xc);" (assignment_expression "iVar2 = *(int *)(puVar3 + -0xc)" identifier = (pointer_expression "*(int *)(puVar3 + -0xc)" * (cast_expression "(int *)(puVar3 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }" if (parenthesized_expression "(0x3ffffffc < param_3)" ( (binary_expression "0x3ffffffc < param_3" number_literal < identifier) )) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }" { (expression_statement "FUN_0022c7a0("basic_string::assign");" (call_expression "FUN_0022c7a0("basic_string::assign")" identifier (argument_list "("basic_string::assign")" ( (string_literal ""basic_string::assign"" " string_content ") ))) ;) })) (if_statement "if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" if (parenthesized_expression "((param_2 < puVar3) || (puVar3 + iVar2 < param_2))" ( (binary_expression "(param_2 < puVar3) || (puVar3 + iVar2 < param_2)" (parenthesized_expression "(param_2 < puVar3)" ( (binary_expression "param_2 < puVar3" identifier < identifier) )) || (parenthesized_expression "(puVar3 + iVar2 < param_2)" ( (binary_expression "puVar3 + iVar2 < param_2" (binary_expression "puVar3 + iVar2" identifier + identifier) < identifier) ))) )) (compound_statement "{\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" { (labeled_statement "LAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" statement_identifier : (expression_statement "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" (assignment_expression "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" identifier = (cast_expression "(int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0021f430(param_1,0,iVar2,param_2,param_3)" identifier (argument_list "(param_1,0,iVar2,param_2,param_3)" ( identifier , number_literal , identifier , identifier , identifier ))))) ;)) (return_statement "return piVar1;" return identifier ;) })) (if_statement "if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" if (parenthesized_expression "(0 < *(int *)(puVar3 + -4))" ( (binary_expression "0 < *(int *)(puVar3 + -4)" number_literal < (pointer_expression "*(int *)(puVar3 + -4)" * (cast_expression "(int *)(puVar3 + -4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) ))))) )) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" { (expression_statement "iVar2 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc)" identifier = (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (goto_statement "goto LAB_0021f4d3;" goto statement_identifier ;) })) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "((uint)((int)param_2 - (int)puVar3) < param_3)" ( (binary_expression "(uint)((int)param_2 - (int)puVar3) < param_3" (call_expression "(uint)((int)param_2 - (int)puVar3)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_2 - (int)puVar3)" ( (binary_expression "(int)param_2 - (int)puVar3" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ))) < identifier) )) (compound_statement "{\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }" { (if_statement "if (param_2 == puVar3) goto LAB_0021f530;" if (parenthesized_expression "(param_2 == puVar3)" ( (binary_expression "param_2 == puVar3" identifier == identifier) )) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;)) (if_statement "if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" if (parenthesized_expression "(param_3 != 1)" ( (binary_expression "param_3 != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" { (expression_statement "memmove(puVar3,param_2,param_3);" (call_expression "memmove(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })) }) (else_clause "else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" else (if_statement "if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" if (parenthesized_expression "(param_3 != 1)" ( (binary_expression "param_3 != 1" identifier != number_literal) )) (compound_statement "{\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" { (if_statement "if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" { (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" identifier (argument_list "(puVar3,param_2,param_3)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) })) (goto_statement "goto LAB_0021f530;" goto statement_identifier ;) })))) (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" * identifier) = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" identifier = (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (labeled_statement "LAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" statement_identifier : (if_statement "if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" if (parenthesized_expression "(puVar3 + -0xc == PTR_DAT_0038ecdc)" ( (binary_expression "puVar3 + -0xc == PTR_DAT_0038ecdc" (binary_expression "puVar3 + -0xc" identifier + number_literal) == identifier) )) (compound_statement "{\n    return param_1;\n  }" { (return_statement "return param_1;" return identifier ;) }))) (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" * (cast_expression "(undefined4 *)(puVar3 + -4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -4)" ( (binary_expression "puVar3 + -4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(puVar3 + -0xc) = param_3;" (assignment_expression "*(uint *)(puVar3 + -0xc) = param_3" (pointer_expression "*(uint *)(puVar3 + -0xc)" * (cast_expression "(uint *)(puVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + -0xc)" ( (binary_expression "puVar3 + -0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "puVar3[param_3] = 0;" (assignment_expression "puVar3[param_3] = 0" (subscript_expression "puVar3[param_3]" identifier [ identifier ]) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < IDENT) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) < IDENT) ))) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , IDENT , IDENT ))))) ;)) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (goto_statement goto statement_identifier ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) })) (goto_statement goto statement_identifier ;) })))) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) == IDENT) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "int * FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" (primitive_type "int") (pointer_declarator "* FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" (* "*") (function_declarator "FUN_0021f4a0(int *param_1,undefined1 *param_2,uint param_3)" (identifier "FUN_0021f4a0") (parameter_list "(int *param_1,undefined1 *param_2,uint param_3)" (( "(") (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")) () ")")))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined1 *puVar3;\n  \n  puVar3 = (undefined1 *)*param_1;\n  iVar2 = *(int *)(puVar3 + -0xc);\n  if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }\n  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }\n  if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }\n  puVar3 = (undefined1 *)*param_1;\n  if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }\n  *puVar3 = *param_2;\n  puVar3 = (undefined1 *)*param_1;\nLAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }\n  *(undefined4 *)(puVar3 + -4) = 0;\n  *(uint *)(puVar3 + -0xc) = param_3;\n  puVar3[param_3] = 0;\n  return param_1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "iVar2 = *(int *)(puVar3 + -0xc);" (assignment_expression "iVar2 = *(int *)(puVar3 + -0xc)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(puVar3 + -0xc)" (* "*") (cast_expression "(int *)(puVar3 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (0x3ffffffc < param_3) {\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }" (if "if") (parenthesized_expression "(0x3ffffffc < param_3)" (( "(") (binary_expression "0x3ffffffc < param_3" (number_literal "0x3ffffffc") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::assign");\n  }" ({ "{") (expression_statement "FUN_0022c7a0("basic_string::assign");" (call_expression "FUN_0022c7a0("basic_string::assign")" (identifier "FUN_0022c7a0") (argument_list "("basic_string::assign")" (( "(") (string_literal ""basic_string::assign"" (" """) (string_content "basic_string::assign") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" (if "if") (parenthesized_expression "((param_2 < puVar3) || (puVar3 + iVar2 < param_2))" (( "(") (binary_expression "(param_2 < puVar3) || (puVar3 + iVar2 < param_2)" (parenthesized_expression "(param_2 < puVar3)" (( "(") (binary_expression "param_2 < puVar3" (identifier "param_2") (< "<") (identifier "puVar3")) () ")")) (|| "||") (parenthesized_expression "(puVar3 + iVar2 < param_2)" (( "(") (binary_expression "puVar3 + iVar2 < param_2" (binary_expression "puVar3 + iVar2" (identifier "puVar3") (+ "+") (identifier "iVar2")) (< "<") (identifier "param_2")) () ")"))) () ")")) (compound_statement "{\nLAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);\n    return piVar1;\n  }" ({ "{") (labeled_statement "LAB_0021f4d3:\n    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" (statement_identifier "LAB_0021f4d3") (: ":") (expression_statement "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);" (assignment_expression "piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" (identifier "piVar1") (= "=") (cast_expression "(int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0021f430(param_1,0,iVar2,param_2,param_3)" (identifier "FUN_0021f430") (argument_list "(param_1,0,iVar2,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (number_literal "0") (, ",") (identifier "iVar2") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))))) (; ";"))) (return_statement "return piVar1;" (return "return") (identifier "piVar1") (; ";")) (} "}"))) (if_statement "if (0 < *(int *)(puVar3 + -4)) {\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" (if "if") (parenthesized_expression "(0 < *(int *)(puVar3 + -4))" (( "(") (binary_expression "0 < *(int *)(puVar3 + -4)" (number_literal "0") (< "<") (pointer_expression "*(int *)(puVar3 + -4)" (* "*") (cast_expression "(int *)(puVar3 + -4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")"))))) () ")")) (compound_statement "{\n    iVar2 = *(int *)(*param_1 + -0xc);\n    goto LAB_0021f4d3;\n  }" ({ "{") (expression_statement "iVar2 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (goto_statement "goto LAB_0021f4d3;" (goto "goto") (statement_identifier "LAB_0021f4d3") (; ";")) (} "}"))) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if ((uint)((int)param_2 - (int)puVar3) < param_3) {\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }\n  else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" (if "if") (parenthesized_expression "((uint)((int)param_2 - (int)puVar3) < param_3)" (( "(") (binary_expression "(uint)((int)param_2 - (int)puVar3) < param_3" (call_expression "(uint)((int)param_2 - (int)puVar3)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((int)param_2 - (int)puVar3)" (( "(") (binary_expression "(int)param_2 - (int)puVar3" (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2")) (- "-") (cast_expression "(int)puVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar3"))) () ")"))) (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    if (param_2 == puVar3) goto LAB_0021f530;\n    if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }\n  }" ({ "{") (if_statement "if (param_2 == puVar3) goto LAB_0021f530;" (if "if") (parenthesized_expression "(param_2 == puVar3)" (( "(") (binary_expression "param_2 == puVar3" (identifier "param_2") (== "==") (identifier "puVar3")) () ")")) (goto_statement "goto LAB_0021f530;" (goto "goto") (statement_identifier "LAB_0021f530") (; ";"))) (if_statement "if (param_3 != 1) {\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" (if "if") (parenthesized_expression "(param_3 != 1)" (( "(") (binary_expression "param_3 != 1" (identifier "param_3") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      memmove(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n      goto LAB_0021f530;\n    }" ({ "{") (expression_statement "memmove(puVar3,param_2,param_3);" (call_expression "memmove(puVar3,param_2,param_3)" (identifier "memmove") (argument_list "(puVar3,param_2,param_3)" (( "(") (identifier "puVar3") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (goto_statement "goto LAB_0021f530;" (goto "goto") (statement_identifier "LAB_0021f530") (; ";")) (} "}"))) (} "}")) (else_clause "else if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" (else "else") (if_statement "if (param_3 != 1) {\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" (if "if") (parenthesized_expression "(param_3 != 1)" (( "(") (binary_expression "param_3 != 1" (identifier "param_3") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n    if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }\n    goto LAB_0021f530;\n  }" ({ "{") (if_statement "if (param_3 != 0) {\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      memcpy(puVar3,param_2,param_3);\n      puVar3 = (undefined1 *)*param_1;\n    }" ({ "{") (expression_statement "memcpy(puVar3,param_2,param_3);" (call_expression "memcpy(puVar3,param_2,param_3)" (identifier "memcpy") (argument_list "(puVar3,param_2,param_3)" (( "(") (identifier "puVar3") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}"))) (goto_statement "goto LAB_0021f530;" (goto "goto") (statement_identifier "LAB_0021f530") (; ";")) (} "}"))))) (expression_statement "*puVar3 = *param_2;" (assignment_expression "*puVar3 = *param_2" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "puVar3 = (undefined1 *)*param_1;" (assignment_expression "puVar3 = (undefined1 *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (labeled_statement "LAB_0021f530:\n  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" (statement_identifier "LAB_0021f530") (: ":") (if_statement "if (puVar3 + -0xc == PTR_DAT_0038ecdc) {\n    return param_1;\n  }" (if "if") (parenthesized_expression "(puVar3 + -0xc == PTR_DAT_0038ecdc)" (( "(") (binary_expression "puVar3 + -0xc == PTR_DAT_0038ecdc" (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) (== "==") (identifier "PTR_DAT_0038ecdc")) () ")")) (compound_statement "{\n    return param_1;\n  }" ({ "{") (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))) (expression_statement "*(undefined4 *)(puVar3 + -4) = 0;" (assignment_expression "*(undefined4 *)(puVar3 + -4) = 0" (pointer_expression "*(undefined4 *)(puVar3 + -4)" (* "*") (cast_expression "(undefined4 *)(puVar3 + -4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -4)" (( "(") (binary_expression "puVar3 + -4" (identifier "puVar3") (+ "+") (number_literal "-4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(uint *)(puVar3 + -0xc) = param_3;" (assignment_expression "*(uint *)(puVar3 + -0xc) = param_3" (pointer_expression "*(uint *)(puVar3 + -0xc)" (* "*") (cast_expression "(uint *)(puVar3 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + -0xc)" (( "(") (binary_expression "puVar3 + -0xc" (identifier "puVar3") (+ "+") (number_literal "-0xc")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (expression_statement "puVar3[param_3] = 0;" (assignment_expression "puVar3[param_3] = 0" (subscript_expression "puVar3[param_3]" (identifier "puVar3") ([ "[") (identifier "param_3") (] "]")) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

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

type_1 * __thiscall std::type_1::assign(type_1 *this,char *var_4,type_2 var_2)

{
  type_1 *psVar1;
  type_2 var_5;
  char *var_1;
  
  var_1 = *(char **)this;
  var_5 = *(type_2 *)(var_1 + -0xc);
  if (0x3ffffffc < var_2) {
                    /* WARNING: Subroutine does not return */
    var_3("basic_string::assign");
  }
  if ((var_4 < var_1) || (var_1 + var_5 < var_4)) {
LAB_0021f4d3:
    psVar1 = (type_1 *)var_6(this,0,var_5,var_4,var_2);
    return psVar1;
  }
  if (0 < *(int *)(var_1 + -4)) {
    var_5 = *(type_2 *)(*(int *)this + -0xc);
    goto LAB_0021f4d3;
  }
  var_1 = *(char **)this;
  if ((type_2)((int)var_4 - (int)var_1) < var_2) {
    if (var_4 == var_1) goto LAB_0021f530;
    if (var_2 != 1) {
      var_7(var_1,var_4,var_2);
      var_1 = *(char **)this;
      goto LAB_0021f530;
    }
  }
  else if (var_2 != 1) {
    if (var_2 != 0) {
      var_8(var_1,var_4,var_2);
      var_1 = *(char **)this;
    }
    goto LAB_0021f530;
  }
  *var_1 = *var_4;
  var_1 = *(char **)this;
LAB_0021f530:
  if (var_1 + -0xc == var_9) {
    return this;
  }
  var_1[-0xffffffff00000004] = '\0';
  var_1[-0xffffffff00000003] = '\0';
  var_1[-0xffffffff00000002] = '\0';
  var_1[-0xffffffff00000001] = '\0';
  *(type_2 *)(var_1 + -0xc) = var_2;
  var_1[var_2] = '\0';
  return this;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator 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))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (identifier) (identifier) (identifier))))))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (goto_statement label: (statement_identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (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: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))))) (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (number_literal))) (return_statement (identifier)))))

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

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

{
  int *piVar1;
  int iVar2;
  undefined1 *puVar3;
  
  puVar3 = (undefined1 *)*param_1;
  iVar2 = *(int *)(puVar3 + -0xc);
  if (0x3ffffffc < param_3) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::assign");
  }
  if ((param_2 < puVar3) || (puVar3 + iVar2 < param_2)) {
LAB_0021f4d3:
    piVar1 = (int *)FUN_0021f430(param_1,0,iVar2,param_2,param_3);
    return piVar1;
  }
  if (0 < *(int *)(puVar3 + -4)) {
    iVar2 = *(int *)(*param_1 + -0xc);
    goto LAB_0021f4d3;
  }
  puVar3 = (undefined1 *)*param_1;
  if ((uint)((int)param_2 - (int)puVar3) < param_3) {
    if (param_2 == puVar3) goto LAB_0021f530;
    if (param_3 != 1) {
      memmove(puVar3,param_2,param_3);
      puVar3 = (undefined1 *)*param_1;
      goto LAB_0021f530;
    }
  }
  else if (param_3 != 1) {
    if (param_3 != 0) {
      memcpy(puVar3,param_2,param_3);
      puVar3 = (undefined1 *)*param_1;
    }
    goto LAB_0021f530;
  }
  *puVar3 = *param_2;
  puVar3 = (undefined1 *)*param_1;
LAB_0021f530:
  if (puVar3 + -0xc == PTR_DAT_0038ecdc) {
    return param_1;
  }
  *(undefined4 *)(puVar3 + -4) = 0;
  *(uint *)(puVar3 + -0xc) = param_3;
  puVar3[param_3] = 0;
  return param_1;
}

