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

uint std::wstring::substr(uint param_1,uint param_2)

{
  int iVar1;
  uint uVar2;
  uint in_stack_0000000c;
  uint in_stack_00000010;
  
  if (in_stack_0000000c <= *(uint *)(param_2 + 4)) {
    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;
    *(uint *)param_1 = param_1 + 8;
    if (in_stack_00000010 < uVar2) {
      uVar2 = in_stack_00000010;
    }
    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;
    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  __throw_out_of_range_fmt
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");
}



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

int * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  uVar2 = param_2[1];
  if (param_3 <= uVar2) {
    *param_1 = (int)(param_1 + 2);
    uVar3 = uVar2 - param_3;
    if (param_4 < uVar2 - param_3) {
      uVar3 = param_4;
    }
    iVar1 = *param_2 + param_3 * 4;
    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",
               param_3,uVar2);
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00032730
ADD EBX,0x17a267
SUB ESP,0xc
MOV ECX,dword ptr [ESP + 0x24]
MOV EAX,dword ptr [ESP + 0x28]
MOV ESI,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x2c]
MOV EDX,dword ptr [ECX + 0x4]
CMP EAX,EDX
JA 0x00187de3
LEA EBP,[ESI + 0x8]
SUB EDX,EAX
MOV dword ptr [ESI],EBP
CMP EDX,EDI
MOV ECX,dword ptr [ECX]
CMOVA EDX,EDI
PUSH 0x0
LEA ECX,[ECX + EAX*0x4]
LEA EAX,[ECX + EDX*0x4]
PUSH EAX
PUSH ECX
PUSH ESI
CALL 0x00187ac0
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET 0x4
PUSH EDX
PUSH EAX
LEA EAX,[EBX + 0xfff24f3c]
PUSH EAX
LEA EAX,[EBX + 0xfff21910]
PUSH EAX
CALL 0x001c6230
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}\n\n" comment (function_definition "int * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" primitive_type (pointer_declarator "* FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" * (function_declarator "FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar2 = param_2[1];" (assignment_expression "uVar2 = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (if_statement "if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" { (expression_statement "*param_1 = (int)(param_1 + 2);" (assignment_expression "*param_1 = (int)(param_1 + 2)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(param_1 + 2)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) ;) (expression_statement "uVar3 = uVar2 - param_3;" (assignment_expression "uVar3 = uVar2 - param_3" identifier = (binary_expression "uVar2 - param_3" identifier - identifier)) ;) (if_statement "if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }" if (parenthesized_expression "(param_4 < uVar2 - param_3)" ( (binary_expression "param_4 < uVar2 - param_3" identifier < (binary_expression "uVar2 - param_3" identifier - identifier)) )) (compound_statement "{\n      uVar3 = param_4;\n    }" { (expression_statement "uVar3 = param_4;" (assignment_expression "uVar3 = param_4" identifier = identifier) ;) })) (expression_statement "iVar1 = *param_2 + param_3 * 4;" (assignment_expression "iVar1 = *param_2 + param_3 * 4" identifier = (binary_expression "*param_2 + param_3 * 4" (pointer_expression "*param_2" * identifier) + (binary_expression "param_3 * 4" identifier * number_literal))) ;) (expression_statement "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);" (call_expression "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0)" identifier (argument_list "(param_1,iVar1,iVar1 + uVar3 * 4,0)" ( identifier , identifier , (binary_expression "iVar1 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) , number_literal ))) ;) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::substr"" " string_content ") , identifier , identifier ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::substr(unsigned int, unsigned int) const */\n\nuint std::wstring::substr(uint param_1,uint param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint in_stack_0000000c;\n  uint in_stack_00000010;\n  \n  if (in_stack_0000000c <= *(uint *)(param_2 + 4)) {\n    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;\n    *(uint *)param_1 = param_1 + 8;\n    if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }\n    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;\n    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");\n}\n\n" comment comment (function_definition "uint std::wstring::substr(uint param_1,uint param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint in_stack_0000000c;\n  uint in_stack_00000010;\n  \n  if (in_stack_0000000c <= *(uint *)(param_2 + 4)) {\n    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;\n    *(uint *)param_1 = param_1 + 8;\n    if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }\n    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;\n    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");\n}" type_identifier (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "substr(uint param_1,uint param_2)" identifier (parameter_list "(uint param_1,uint param_2)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint in_stack_0000000c;\n  uint in_stack_00000010;\n  \n  if (in_stack_0000000c <= *(uint *)(param_2 + 4)) {\n    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;\n    *(uint *)param_1 = param_1 + 8;\n    if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }\n    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;\n    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);\n    return param_1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint in_stack_0000000c;" type_identifier identifier ;) (declaration "uint in_stack_00000010;" type_identifier identifier ;) (if_statement "if (in_stack_0000000c <= *(uint *)(param_2 + 4)) {\n    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;\n    *(uint *)param_1 = param_1 + 8;\n    if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }\n    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;\n    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);\n    return param_1;\n  }" if (parenthesized_expression "(in_stack_0000000c <= *(uint *)(param_2 + 4))" ( (binary_expression "in_stack_0000000c <= *(uint *)(param_2 + 4)" identifier <= (pointer_expression "*(uint *)(param_2 + 4)" * (cast_expression "(uint *)(param_2 + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) ))))) )) (compound_statement "{\n    uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;\n    *(uint *)param_1 = param_1 + 8;\n    if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }\n    iVar1 = *(int *)param_2 + in_stack_0000000c * 4;\n    _M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);\n    return param_1;\n  }" { (expression_statement "uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c;" (assignment_expression "uVar2 = *(uint *)(param_2 + 4) - in_stack_0000000c" identifier = (binary_expression "*(uint *)(param_2 + 4) - in_stack_0000000c" (pointer_expression "*(uint *)(param_2 + 4)" * (cast_expression "(uint *)(param_2 + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 4)" ( (binary_expression "param_2 + 4" identifier + number_literal) )))) - identifier)) ;) (expression_statement "*(uint *)param_1 = param_1 + 8;" (assignment_expression "*(uint *)param_1 = param_1 + 8" (pointer_expression "*(uint *)param_1" * (cast_expression "(uint *)param_1" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (binary_expression "param_1 + 8" identifier + number_literal)) ;) (if_statement "if (in_stack_00000010 < uVar2) {\n      uVar2 = in_stack_00000010;\n    }" if (parenthesized_expression "(in_stack_00000010 < uVar2)" ( (binary_expression "in_stack_00000010 < uVar2" identifier < identifier) )) (compound_statement "{\n      uVar2 = in_stack_00000010;\n    }" { (expression_statement "uVar2 = in_stack_00000010;" (assignment_expression "uVar2 = in_stack_00000010" identifier = identifier) ;) })) (expression_statement "iVar1 = *(int *)param_2 + in_stack_0000000c * 4;" (assignment_expression "iVar1 = *(int *)param_2 + in_stack_0000000c * 4" identifier = (binary_expression "*(int *)param_2 + in_stack_0000000c * 4" (pointer_expression "*(int *)param_2" * (cast_expression "(int *)param_2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (binary_expression "in_stack_0000000c * 4" identifier * number_literal))) ;) (expression_statement "_M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0);" (binary_expression "_M_construct<wchar_t_const*>(param_1,iVar1,iVar1 + uVar2 * 4,0)" (binary_expression "_M_construct<wchar_t_const" identifier < identifier) (ERROR "*" *) > (parenthesized_expression "(param_1,iVar1,iVar1 + uVar2 * 4,0)" ( (comma_expression "param_1,iVar1,iVar1 + uVar2 * 4,0" identifier , (comma_expression "iVar1,iVar1 + uVar2 * 4,0" identifier , (comma_expression "iVar1 + uVar2 * 4,0" (binary_expression "iVar1 + uVar2 * 4" identifier + (binary_expression "uVar2 * 4" identifier * number_literal)) , number_literal))) ))) ;) (return_statement "return param_1;" return identifier ;) })) comment (expression_statement "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");" (call_expression "__throw_out_of_range_fmt\n            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr")" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr")" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::substr"" " string_content ") ))) ;) })))
(translation_unit "int * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    \n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}\n\n" (function_definition "int * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    \n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" primitive_type (pointer_declarator "* FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" * (function_declarator "FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    \n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar2 = param_2[1];" (assignment_expression "uVar2 = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (if_statement "if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" if (parenthesized_expression "(param_3 <= uVar2)" ( (binary_expression "param_3 <= uVar2" identifier <= identifier) )) (compound_statement "{\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" { (expression_statement "*param_1 = (int)(param_1 + 2);" (assignment_expression "*param_1 = (int)(param_1 + 2)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(param_1 + 2)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) ;) (expression_statement "uVar3 = uVar2 - param_3;" (assignment_expression "uVar3 = uVar2 - param_3" identifier = (binary_expression "uVar2 - param_3" identifier - identifier)) ;) (if_statement "if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }" if (parenthesized_expression "(param_4 < uVar2 - param_3)" ( (binary_expression "param_4 < uVar2 - param_3" identifier < (binary_expression "uVar2 - param_3" identifier - identifier)) )) (compound_statement "{\n      uVar3 = param_4;\n    }" { (expression_statement "uVar3 = param_4;" (assignment_expression "uVar3 = param_4" identifier = identifier) ;) })) (expression_statement "iVar1 = *param_2 + param_3 * 4;" (assignment_expression "iVar1 = *param_2 + param_3 * 4" identifier = (binary_expression "*param_2 + param_3 * 4" (pointer_expression "*param_2" * identifier) + (binary_expression "param_3 * 4" identifier * number_literal))) ;) (expression_statement "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);" (call_expression "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0)" identifier (argument_list "(param_1,iVar1,iVar1 + uVar3 * 4,0)" ( identifier , identifier , (binary_expression "iVar1 + uVar3 * 4" identifier + (binary_expression "uVar3 * 4" identifier * number_literal)) , number_literal ))) ;) (return_statement "return param_1;" return identifier ;) })) (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" identifier (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" ( (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" " string_content ") , (string_literal ""basic_string::substr"" " string_content ") , identifier , 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) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) + (binary_expression IDENT * LIT))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression IDENT + (binary_expression IDENT * LIT)) , LIT ))) ;) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , IDENT , IDENT ))) ;) })))
(function_definition "int * FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    \n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" (primitive_type "int") (pointer_declarator "* FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" (* "*") (function_declarator "FUN_00187d90(int *param_1,int *param_2,uint param_3,uint param_4)" (identifier "FUN_00187d90") (parameter_list "(int *param_1,int *param_2,uint param_3,uint param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")")))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  \n  uVar2 = param_2[1];\n  if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }\n                    \n  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (expression_statement "uVar2 = param_2[1];" (assignment_expression "uVar2 = param_2[1]" (identifier "uVar2") (= "=") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (param_3 <= uVar2) {\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" (if "if") (parenthesized_expression "(param_3 <= uVar2)" (( "(") (binary_expression "param_3 <= uVar2" (identifier "param_3") (<= "<=") (identifier "uVar2")) () ")")) (compound_statement "{\n    *param_1 = (int)(param_1 + 2);\n    uVar3 = uVar2 - param_3;\n    if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }\n    iVar1 = *param_2 + param_3 * 4;\n    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);\n    return param_1;\n  }" ({ "{") (expression_statement "*param_1 = (int)(param_1 + 2);" (assignment_expression "*param_1 = (int)(param_1 + 2)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)(param_1 + 2)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (; ";")) (expression_statement "uVar3 = uVar2 - param_3;" (assignment_expression "uVar3 = uVar2 - param_3" (identifier "uVar3") (= "=") (binary_expression "uVar2 - param_3" (identifier "uVar2") (- "-") (identifier "param_3"))) (; ";")) (if_statement "if (param_4 < uVar2 - param_3) {\n      uVar3 = param_4;\n    }" (if "if") (parenthesized_expression "(param_4 < uVar2 - param_3)" (( "(") (binary_expression "param_4 < uVar2 - param_3" (identifier "param_4") (< "<") (binary_expression "uVar2 - param_3" (identifier "uVar2") (- "-") (identifier "param_3"))) () ")")) (compound_statement "{\n      uVar3 = param_4;\n    }" ({ "{") (expression_statement "uVar3 = param_4;" (assignment_expression "uVar3 = param_4" (identifier "uVar3") (= "=") (identifier "param_4")) (; ";")) (} "}"))) (expression_statement "iVar1 = *param_2 + param_3 * 4;" (assignment_expression "iVar1 = *param_2 + param_3 * 4" (identifier "iVar1") (= "=") (binary_expression "*param_2 + param_3 * 4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4")))) (; ";")) (expression_statement "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);" (call_expression "FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0)" (identifier "FUN_00187ac0") (argument_list "(param_1,iVar1,iVar1 + uVar3 * 4,0)" (( "(") (identifier "param_1") (, ",") (identifier "iVar1") (, ",") (binary_expression "iVar1 + uVar3 * 4" (identifier "iVar1") (+ "+") (binary_expression "uVar3 * 4" (identifier "uVar3") (* "*") (number_literal "4"))) (, ",") (number_literal "0") () ")"))) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2);" (call_expression "FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" (identifier "FUN_001c6230") (argument_list "("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",\n               param_3,uVar2)" (( "(") (string_literal ""%s: __pos (which is %zu) > this->size() (which is %zu)"" (" """) (string_content "%s: __pos (which is %zu) > this->size() (which is %zu)") (" """)) (, ",") (string_literal ""basic_string::substr"" (" """) (string_content "basic_string::substr") (" """)) (, ",") (identifier "param_3") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}")))

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

type_1 std::wstring::function_1(type_1 var_3,type_1 var_2)

{
  int var_8;
  type_1 var_5;
  type_1 var_1;
  type_1 var_4;
  
  if (var_1 <= *(type_1 *)(var_2 + 4)) {
    var_5 = *(type_1 *)(var_2 + 4) - var_1;
    *(type_1 *)var_3 = var_3 + 8;
    if (var_4 < var_5) {
      var_5 = var_4;
    }
    var_8 = *(int *)var_2 + var_1 * 4;
    var_6<var_7*>(var_3,var_8,var_8 + var_5 * 4,0);
    return var_3;
  }
                    /* WARNING: Subroutine does not return */
  var_9
            ("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr");
}


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

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

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

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  
  uVar2 = param_2[1];
  if (param_3 <= uVar2) {
    *param_1 = (int)(param_1 + 2);
    uVar3 = uVar2 - param_3;
    if (param_4 < uVar2 - param_3) {
      uVar3 = param_4;
    }
    iVar1 = *param_2 + param_3 * 4;
    FUN_00187ac0(param_1,iVar1,iVar1 + uVar3 * 4,0);
    return param_1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_001c6230("%s: __pos (which is %zu) > this->size() (which is %zu)","basic_string::substr",
               param_3,uVar2);
}

