
/* std::wstring::replace(__normal_iterator<wchar_t*, std::wstring >, __normal_iterator<wchar_t*,
   std::wstring >, __normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t
   const*, std::wstring >) */

void std::wstring::replace(int *param_1,int param_2,int param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  undefined *puVar4;
  
  uVar1 = param_1[1];
  uVar2 = param_2 - *param_1 >> 2;
  if (uVar2 <= uVar1) {
    uVar3 = param_3 - param_2 >> 2;
                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    if (uVar1 - uVar2 <= uVar3) {
      uVar3 = uVar1 - uVar2;
    }
    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);
    return;
  }
  puVar4 = PTR___throw_out_of_range_fmt_004c225c;
  (*(code *)PTR___throw_out_of_range_fmt_004c225c)
            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);
  (**(code **)(puVar4 + 0xdee24))();
  return;
}



void FUN_003e68e4(int *param_1,int param_2,int param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  undefined *puVar4;
  
  uVar1 = param_1[1];
  uVar2 = param_2 - *param_1 >> 2;
  if (uVar2 <= uVar1) {
    uVar3 = param_3 - param_2 >> 2;
                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    if (uVar1 - uVar2 <= uVar3) {
      uVar3 = uVar1 - uVar2;
    }
    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);
    return;
  }
  puVar4 = PTR___throw_out_of_range_fmt_004c225c;
  (*(code *)PTR___throw_out_of_range_fmt_004c225c)
            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);
  (**(code **)(puVar4 + 0xdee24))();
  return;
}


lui gp,0xe
addiu gp,gp,0x295c
addu gp,gp,t9
lw t0,0x0(a0)
addiu sp,sp,-0x20
subu a2,a2,a1
lw v1,0x4(a0)
subu a1,a1,t0
lw v0,0x30(sp)
sw gp,0x10(sp)
sra a1,a1,0x2
sw ra,0x1c(sp)
sltu t0,v1,a1
bne t0,zero,0x003e6948
_subu v0,v0,a3
sra a2,a2,0x2
lw ra,0x1c(sp)
sra v0,v0,0x2
lw t9,-0x60dc(gp)
subu v1,v1,a1
sw v0,0x30(sp)
addiu sp,sp,0x20
sltu v0,a2,v1
jr t9
_movz a2,v1,v0
or a2,a1,zero
lw a0,-0x77f0(gp)
lw a1,-0x7f64(gp)
or a3,v1,zero
lw t9,-0x6fe4(gp)
addiu a0,a0,-0xe00
jalr t9
_addiu a1,a1,-0x3aec
(translation_unit "void FUN_003e68e4(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}\n\n" (function_definition "void FUN_003e68e4(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" primitive_type (function_declarator "FUN_003e68e4(int *param_1,int param_2,int param_3)" identifier (parameter_list "(int *param_1,int param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar2 = param_2 - *param_1 >> 2;" (assignment_expression "uVar2 = param_2 - *param_1 >> 2" identifier = (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" identifier - (pointer_expression "*param_1" * identifier)) >> number_literal)) ;) (if_statement "if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" if (parenthesized_expression "(uVar2 <= uVar1)" ( (binary_expression "uVar2 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" { (expression_statement "uVar3 = param_3 - param_2 >> 2;" (assignment_expression "uVar3 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) comment comment (if_statement "if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }" if (parenthesized_expression "(uVar1 - uVar2 <= uVar3)" ( (binary_expression "uVar1 - uVar2 <= uVar3" (binary_expression "uVar1 - uVar2" identifier - identifier) <= identifier) )) (compound_statement "{\n      uVar3 = uVar1 - uVar2;\n    }" { (expression_statement "uVar3 = uVar1 - uVar2;" (assignment_expression "uVar3 = uVar1 - uVar2" identifier = (binary_expression "uVar1 - uVar2" identifier - identifier)) ;) })) (expression_statement "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);" (call_expression "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3)" (parenthesized_expression "(*(code *)PTR__M_replace_004c3164)" ( (pointer_expression "*(code *)PTR__M_replace_004c3164" * (cast_expression "(code *)PTR__M_replace_004c3164" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,uVar2,uVar3)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "puVar4 = PTR___throw_out_of_range_fmt_004c225c;" (assignment_expression "puVar4 = PTR___throw_out_of_range_fmt_004c225c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);" (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" (parenthesized_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)" ( (pointer_expression "*(code *)PTR___throw_out_of_range_fmt_004c225c" * (cast_expression "(code *)PTR___throw_out_of_range_fmt_004c225c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3aec" identifier + number_literal) , identifier , identifier ))) ;) (expression_statement "(**(code **)(puVar4 + 0xdee24))();" (call_expression "(**(code **)(puVar4 + 0xdee24))()" (parenthesized_expression "(**(code **)(puVar4 + 0xdee24))" ( (pointer_expression "**(code **)(puVar4 + 0xdee24)" * (pointer_expression "*(code **)(puVar4 + 0xdee24)" * (cast_expression "(code **)(puVar4 + 0xdee24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar4 + 0xdee24)" ( (binary_expression "puVar4 + 0xdee24" identifier + number_literal) ))))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::wstring::replace(__normal_iterator<wchar_t*, std::wstring >, __normal_iterator<wchar_t*,\n   std::wstring >, __normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t\n   const*, std::wstring >) */\n\nvoid std::wstring::replace(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}\n\n" comment (function_definition "void std::wstring::replace(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" primitive_type (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "replace(int *param_1,int param_2,int param_3)" identifier (parameter_list "(int *param_1,int param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar2 = param_2 - *param_1 >> 2;" (assignment_expression "uVar2 = param_2 - *param_1 >> 2" identifier = (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" identifier - (pointer_expression "*param_1" * identifier)) >> number_literal)) ;) (if_statement "if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" if (parenthesized_expression "(uVar2 <= uVar1)" ( (binary_expression "uVar2 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    uVar3 = param_3 - param_2 >> 2;\n                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" { (expression_statement "uVar3 = param_3 - param_2 >> 2;" (assignment_expression "uVar3 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) comment comment (if_statement "if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }" if (parenthesized_expression "(uVar1 - uVar2 <= uVar3)" ( (binary_expression "uVar1 - uVar2 <= uVar3" (binary_expression "uVar1 - uVar2" identifier - identifier) <= identifier) )) (compound_statement "{\n      uVar3 = uVar1 - uVar2;\n    }" { (expression_statement "uVar3 = uVar1 - uVar2;" (assignment_expression "uVar3 = uVar1 - uVar2" identifier = (binary_expression "uVar1 - uVar2" identifier - identifier)) ;) })) (expression_statement "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);" (call_expression "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3)" (parenthesized_expression "(*(code *)PTR__M_replace_004c3164)" ( (pointer_expression "*(code *)PTR__M_replace_004c3164" * (cast_expression "(code *)PTR__M_replace_004c3164" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,uVar2,uVar3)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "puVar4 = PTR___throw_out_of_range_fmt_004c225c;" (assignment_expression "puVar4 = PTR___throw_out_of_range_fmt_004c225c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);" (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" (parenthesized_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)" ( (pointer_expression "*(code *)PTR___throw_out_of_range_fmt_004c225c" * (cast_expression "(code *)PTR___throw_out_of_range_fmt_004c225c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3aec" identifier + number_literal) , identifier , identifier ))) ;) (expression_statement "(**(code **)(puVar4 + 0xdee24))();" (call_expression "(**(code **)(puVar4 + 0xdee24))()" (parenthesized_expression "(**(code **)(puVar4 + 0xdee24))" ( (pointer_expression "**(code **)(puVar4 + 0xdee24)" * (pointer_expression "*(code **)(puVar4 + 0xdee24)" * (cast_expression "(code **)(puVar4 + 0xdee24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar4 + 0xdee24)" ( (binary_expression "puVar4 + 0xdee24" identifier + number_literal) ))))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_003e68e4(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}\n\n" (function_definition "void FUN_003e68e4(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" primitive_type (function_declarator "FUN_003e68e4(int *param_1,int param_2,int param_3)" identifier (parameter_list "(int *param_1,int param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "uVar2 = param_2 - *param_1 >> 2;" (assignment_expression "uVar2 = param_2 - *param_1 >> 2" identifier = (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" identifier - (pointer_expression "*param_1" * identifier)) >> number_literal)) ;) (if_statement "if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" if (parenthesized_expression "(uVar2 <= uVar1)" ( (binary_expression "uVar2 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" { (expression_statement "uVar3 = param_3 - param_2 >> 2;" (assignment_expression "uVar3 = param_3 - param_2 >> 2" identifier = (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" identifier - identifier) >> number_literal)) ;) (if_statement "if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }" if (parenthesized_expression "(uVar1 - uVar2 <= uVar3)" ( (binary_expression "uVar1 - uVar2 <= uVar3" (binary_expression "uVar1 - uVar2" identifier - identifier) <= identifier) )) (compound_statement "{\n      uVar3 = uVar1 - uVar2;\n    }" { (expression_statement "uVar3 = uVar1 - uVar2;" (assignment_expression "uVar3 = uVar1 - uVar2" identifier = (binary_expression "uVar1 - uVar2" identifier - identifier)) ;) })) (expression_statement "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);" (call_expression "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3)" (parenthesized_expression "(*(code *)PTR__M_replace_004c3164)" ( (pointer_expression "*(code *)PTR__M_replace_004c3164" * (cast_expression "(code *)PTR__M_replace_004c3164" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,uVar2,uVar3)" ( identifier , identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "puVar4 = PTR___throw_out_of_range_fmt_004c225c;" (assignment_expression "puVar4 = PTR___throw_out_of_range_fmt_004c225c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);" (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" (parenthesized_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)" ( (pointer_expression "*(code *)PTR___throw_out_of_range_fmt_004c225c" * (cast_expression "(code *)PTR___throw_out_of_range_fmt_004c225c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3aec" identifier + number_literal) , identifier , identifier ))) ;) (expression_statement "(**(code **)(puVar4 + 0xdee24))();" (call_expression "(**(code **)(puVar4 + 0xdee24))()" (parenthesized_expression "(**(code **)(puVar4 + 0xdee24))" ( (pointer_expression "**(code **)(puVar4 + 0xdee24)" * (pointer_expression "*(code **)(puVar4 + 0xdee24)" * (cast_expression "(code **)(puVar4 + 0xdee24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar4 + 0xdee24)" ( (binary_expression "puVar4 + 0xdee24" identifier + number_literal) ))))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT - (pointer_expression * IDENT)) >> LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT - IDENT) >> LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT - IDENT) <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) })) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT ))) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) , (binary_expression IDENT + LIT) , IDENT , IDENT ))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( ))) ;) (return_statement return ;) })))
(function_definition "void FUN_003e68e4(int *param_1,int param_2,int param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" (primitive_type "void") (function_declarator "FUN_003e68e4(int *param_1,int param_2,int param_3)" (identifier "FUN_003e68e4") (parameter_list "(int *param_1,int param_2,int param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  uint uVar3;\n  undefined *puVar4;\n  \n  uVar1 = param_1[1];\n  uVar2 = param_2 - *param_1 >> 2;\n  if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }\n  puVar4 = PTR___throw_out_of_range_fmt_004c225c;\n  (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);\n  (**(code **)(puVar4 + 0xdee24))();\n  return;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "undefined *puVar4;" (type_identifier "undefined") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (expression_statement "uVar1 = param_1[1];" (assignment_expression "uVar1 = param_1[1]" (identifier "uVar1") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "uVar2 = param_2 - *param_1 >> 2;" (assignment_expression "uVar2 = param_2 - *param_1 >> 2" (identifier "uVar2") (= "=") (binary_expression "param_2 - *param_1 >> 2" (binary_expression "param_2 - *param_1" (identifier "param_2") (- "-") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (>> ">>") (number_literal "2"))) (; ";")) (if_statement "if (uVar2 <= uVar1) {\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" (if "if") (parenthesized_expression "(uVar2 <= uVar1)" (( "(") (binary_expression "uVar2 <= uVar1" (identifier "uVar2") (<= "<=") (identifier "uVar1")) () ")")) (compound_statement "{\n    uVar3 = param_3 - param_2 >> 2;\n                    \n                    \n    if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }\n    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);\n    return;\n  }" ({ "{") (expression_statement "uVar3 = param_3 - param_2 >> 2;" (assignment_expression "uVar3 = param_3 - param_2 >> 2" (identifier "uVar3") (= "=") (binary_expression "param_3 - param_2 >> 2" (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) (>> ">>") (number_literal "2"))) (; ";")) (if_statement "if (uVar1 - uVar2 <= uVar3) {\n      uVar3 = uVar1 - uVar2;\n    }" (if "if") (parenthesized_expression "(uVar1 - uVar2 <= uVar3)" (( "(") (binary_expression "uVar1 - uVar2 <= uVar3" (binary_expression "uVar1 - uVar2" (identifier "uVar1") (- "-") (identifier "uVar2")) (<= "<=") (identifier "uVar3")) () ")")) (compound_statement "{\n      uVar3 = uVar1 - uVar2;\n    }" ({ "{") (expression_statement "uVar3 = uVar1 - uVar2;" (assignment_expression "uVar3 = uVar1 - uVar2" (identifier "uVar3") (= "=") (binary_expression "uVar1 - uVar2" (identifier "uVar1") (- "-") (identifier "uVar2"))) (; ";")) (} "}"))) (expression_statement "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);" (call_expression "(*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3)" (parenthesized_expression "(*(code *)PTR__M_replace_004c3164)" (( "(") (pointer_expression "*(code *)PTR__M_replace_004c3164" (* "*") (cast_expression "(code *)PTR__M_replace_004c3164" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR__M_replace_004c3164"))) () ")")) (argument_list "(param_1,uVar2,uVar3)" (( "(") (identifier "param_1") (, ",") (identifier "uVar2") (, ",") (identifier "uVar3") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "puVar4 = PTR___throw_out_of_range_fmt_004c225c;" (assignment_expression "puVar4 = PTR___throw_out_of_range_fmt_004c225c" (identifier "puVar4") (= "=") (identifier "PTR___throw_out_of_range_fmt_004c225c")) (; ";")) (expression_statement "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);" (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" (parenthesized_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)" (( "(") (pointer_expression "*(code *)PTR___throw_out_of_range_fmt_004c225c" (* "*") (cast_expression "(code *)PTR___throw_out_of_range_fmt_004c225c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___throw_out_of_range_fmt_004c225c"))) () ")")) (argument_list "(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1)" (( "(") (binary_expression "PTR_s__s_004c1a50 + -0xe00" (identifier "PTR_s__s_004c1a50") (+ "+") (number_literal "-0xe00")) (, ",") (binary_expression "PTR_UINT_004c12dc + -0x3aec" (identifier "PTR_UINT_004c12dc") (+ "+") (number_literal "-0x3aec")) (, ",") (identifier "uVar2") (, ",") (identifier "uVar1") () ")"))) (; ";")) (expression_statement "(**(code **)(puVar4 + 0xdee24))();" (call_expression "(**(code **)(puVar4 + 0xdee24))()" (parenthesized_expression "(**(code **)(puVar4 + 0xdee24))" (( "(") (pointer_expression "**(code **)(puVar4 + 0xdee24)" (* "*") (pointer_expression "*(code **)(puVar4 + 0xdee24)" (* "*") (cast_expression "(code **)(puVar4 + 0xdee24)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar4 + 0xdee24)" (( "(") (binary_expression "puVar4 + 0xdee24" (identifier "puVar4") (+ "+") (number_literal "0xdee24")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::wstring::replace(__normal_iterator<wchar_t*, std::wstring >, __normal_iterator<wchar_t*,
   std::wstring >, __normal_iterator<wchar_t const*, std::wstring >, __normal_iterator<wchar_t
   const*, std::wstring >) */

void std::wstring::function_1(int *param_1,int var_1,int var_4)

{
  type_1 var_3;
  type_1 var_2;
  type_1 var_5;
  type_2 *var_8;
  
  var_3 = param_1[1];
  var_2 = var_1 - *param_1 >> 2;
  if (var_2 <= var_3) {
    var_5 = var_4 - var_1 >> 2;
                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    if (var_3 - var_2 <= var_5) {
      var_5 = var_3 - var_2;
    }
    (*(type_3 *)PTR__M_replace_004c3164)(param_1,var_2,var_5);
    return;
  }
  var_8 = PTR___throw_out_of_range_fmt_004c225c;
  (*(type_3 *)PTR___throw_out_of_range_fmt_004c225c)
            (var_6 + -0xe00,var_7 + -0x3aec,var_2,var_3);
  (**(type_3 **)(var_8 + 0xdee24))();
  return;
}


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

void MASKED(int *param_1,int param_2,int param_3)

{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  undefined *puVar4;
  
  uVar1 = param_1[1];
  uVar2 = param_2 - *param_1 >> 2;
  if (uVar2 <= uVar1) {
    uVar3 = param_3 - param_2 >> 2;
                    /* WARNING: Could not recover jumptable at 0x003e6940. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    if (uVar1 - uVar2 <= uVar3) {
      uVar3 = uVar1 - uVar2;
    }
    (*(code *)PTR__M_replace_004c3164)(param_1,uVar2,uVar3);
    return;
  }
  puVar4 = PTR___throw_out_of_range_fmt_004c225c;
  (*(code *)PTR___throw_out_of_range_fmt_004c225c)
            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3aec,uVar2,uVar1);
  (**(code **)(puVar4 + 0xdee24))();
  return;
}

