
/* std::wstring::compare(unsigned int, unsigned int, wchar_t const*) const */

int __thiscall std::wstring::compare(wstring *this,uint param_1,uint param_2,wchar_t *param_3)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  
  iVar3 = *(int *)this;
  uVar1 = *(uint *)(iVar3 + -0xc);
  if (uVar1 < param_1) {
    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)
                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);
    return iVar3;
  }
  if (uVar1 - param_1 <= param_2) {
    param_2 = uVar1 - param_1;
  }
  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3);
  uVar1 = param_2;
  if (uVar2 <= param_2) {
    uVar1 = uVar2;
  }
  if ((uVar1 != 0) &&
     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)) {
    return iVar3;
  }
  return param_2 - uVar2;
}



int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  
  iVar3 = *param_1;
  uVar1 = *(uint *)(iVar3 + -0xc);
  if (uVar1 < param_2) {
    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)
                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);
    return iVar3;
  }
  if (uVar1 - param_2 <= param_3) {
    param_3 = uVar1 - param_2;
  }
  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);
  uVar1 = param_3;
  if (uVar2 <= param_3) {
    uVar1 = uVar2;
  }
  if ((uVar1 != 0) &&
     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {
    return iVar3;
  }
  return param_3 - uVar2;
}


lui gp,0xf
addiu gp,gp,0x722c
addu gp,gp,t9
addiu sp,sp,-0x30
sw s3,0x24(sp)
lw s3,0x0(a0)
sw gp,0x10(sp)
sw s1,0x1c(sp)
sw ra,0x2c(sp)
sw s4,0x28(sp)
sw s2,0x20(sp)
sw s0,0x18(sp)
lw v0,-0xc(s3)
sltu v1,v0,a1
bne v1,zero,0x003d20ec
_or s1,a1,zero
subu v0,v0,a1
lw t9,-0x35b8(gp)
or a0,a3,zero
sltu s0,a2,v0
movz a2,v0,s0
or s4,a3,zero
jalr t9
_or s0,a2,zero
sltu a2,s0,v0
lw gp,0x10(sp)
or s2,v0,zero
or v0,s0,zero
movz v0,s2,a2
bne v0,zero,0x003d20b4
_or a2,v0,zero
lw ra,0x2c(sp)
subu v0,s0,s2
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
sll a0,s1,0x2
lw t9,-0x35cc(gp)
or a1,s4,zero
jalr t9
_addu a0,s3,a0
beq v0,zero,0x003d2094
_lw ra,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
or a2,a1,zero
lw a0,-0x77f0(gp)
lw a1,-0x7f64(gp)
or a3,v0,zero
lw t9,-0x6fe4(gp)
addiu a0,a0,-0xe00
jalr t9
_addiu a1,a1,-0x3a8c
(translation_unit "int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}\n\n" (function_definition "int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" primitive_type (function_declarator "FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)" identifier (parameter_list "(int *param_1,uint param_2,uint param_3,undefined4 param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar1 = *(uint *)(iVar3 + -0xc);" (assignment_expression "uVar1 = *(uint *)(iVar3 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar3 + -0xc)" * (cast_expression "(uint *)(iVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -0xc)" ( (binary_expression "iVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" if (parenthesized_expression "(uVar1 < param_2)" ( (binary_expression "uVar1 < param_2" identifier < identifier) )) (compound_statement "{\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" { (expression_statement "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (assignment_expression "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" identifier = (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,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 + -0x3a8c,param_2,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3a8c" identifier + number_literal) , identifier , identifier )))) ;) (return_statement "return iVar3;" return identifier ;) })) (if_statement "if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }" if (parenthesized_expression "(uVar1 - param_2 <= param_3)" ( (binary_expression "uVar1 - param_2 <= param_3" (binary_expression "uVar1 - param_2" identifier - identifier) <= identifier) )) (compound_statement "{\n    param_3 = uVar1 - param_2;\n  }" { (expression_statement "param_3 = uVar1 - param_2;" (assignment_expression "param_3 = uVar1 - param_2" identifier = (binary_expression "uVar1 - param_2" identifier - identifier)) ;) })) (expression_statement "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);" (assignment_expression "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4)" identifier = (call_expression "(*(code *)PTR_wcslen_004c5c88)(param_4)" (parenthesized_expression "(*(code *)PTR_wcslen_004c5c88)" ( (pointer_expression "*(code *)PTR_wcslen_004c5c88" * (cast_expression "(code *)PTR_wcslen_004c5c88" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) (if_statement "if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n    uVar1 = uVar2;\n  }" { (expression_statement "uVar1 = uVar2;" (assignment_expression "uVar1 = uVar2" identifier = identifier) ;) })) (if_statement "if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }" if (parenthesized_expression "((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0))" ( (binary_expression "(uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" (parenthesized_expression "(uVar1 != 0)" ( (binary_expression "uVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" ( (comma_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0" (assignment_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" identifier = (call_expression "(*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_wmemcmp_004c5c74)" ( (pointer_expression "*(code *)PTR_wmemcmp_004c5c74" * (cast_expression "(code *)PTR_wmemcmp_004c5c74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3 + param_2 * 4,param_4,uVar1)" ( (binary_expression "iVar3 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) , identifier , identifier )))) , (binary_expression "iVar3 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) })) (return_statement "return param_3 - uVar2;" return (binary_expression "param_3 - uVar2" identifier - identifier) ;) })))
(translation_unit "/* std::wstring::compare(unsigned int, unsigned int, wchar_t const*) const */\n\nint __thiscall std::wstring::compare(wstring *this,uint param_1,uint param_2,wchar_t *param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *(int *)this;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_1) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_1 <= param_2) {\n    param_2 = uVar1 - param_1;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3);\n  uVar1 = param_2;\n  if (uVar2 <= param_2) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_2 - uVar2;\n}\n\n" comment (function_definition "int __thiscall std::wstring::compare(wstring *this,uint param_1,uint param_2,wchar_t *param_3)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *(int *)this;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_1) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_1 <= param_2) {\n    param_2 = uVar1 - param_1;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3);\n  uVar1 = param_2;\n  if (uVar2 <= param_2) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_2 - uVar2;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "compare(wstring *this,uint param_1,uint param_2,wchar_t *param_3)" identifier (parameter_list "(wstring *this,uint param_1,uint param_2,wchar_t *param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "wchar_t *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *(int *)this;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_1) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_1 <= param_2) {\n    param_2 = uVar1 - param_1;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3);\n  uVar1 = param_2;\n  if (uVar2 <= param_2) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_2 - uVar2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = *(int *)this;" (assignment_expression "iVar3 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar1 = *(uint *)(iVar3 + -0xc);" (assignment_expression "uVar1 = *(uint *)(iVar3 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar3 + -0xc)" * (cast_expression "(uint *)(iVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -0xc)" ( (binary_expression "iVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (uVar1 < param_1) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n    return iVar3;\n  }" if (parenthesized_expression "(uVar1 < param_1)" ( (binary_expression "uVar1 < param_1" identifier < identifier) )) (compound_statement "{\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n    return iVar3;\n  }" { (expression_statement "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);" (assignment_expression "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1)" identifier = (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,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 + -0x3a8c,param_1,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3a8c" identifier + number_literal) , identifier , identifier )))) ;) (return_statement "return iVar3;" return identifier ;) })) (if_statement "if (uVar1 - param_1 <= param_2) {\n    param_2 = uVar1 - param_1;\n  }" if (parenthesized_expression "(uVar1 - param_1 <= param_2)" ( (binary_expression "uVar1 - param_1 <= param_2" (binary_expression "uVar1 - param_1" identifier - identifier) <= identifier) )) (compound_statement "{\n    param_2 = uVar1 - param_1;\n  }" { (expression_statement "param_2 = uVar1 - param_1;" (assignment_expression "param_2 = uVar1 - param_1" identifier = (binary_expression "uVar1 - param_1" identifier - identifier)) ;) })) (expression_statement "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3);" (assignment_expression "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_3)" identifier = (call_expression "(*(code *)PTR_wcslen_004c5c88)(param_3)" (parenthesized_expression "(*(code *)PTR_wcslen_004c5c88)" ( (pointer_expression "*(code *)PTR_wcslen_004c5c88" * (cast_expression "(code *)PTR_wcslen_004c5c88" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_3)" ( identifier )))) ;) (expression_statement "uVar1 = param_2;" (assignment_expression "uVar1 = param_2" identifier = identifier) ;) (if_statement "if (uVar2 <= param_2) {\n    uVar1 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_2)" ( (binary_expression "uVar2 <= param_2" identifier <= identifier) )) (compound_statement "{\n    uVar1 = uVar2;\n  }" { (expression_statement "uVar1 = uVar2;" (assignment_expression "uVar1 = uVar2" identifier = identifier) ;) })) (if_statement "if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }" if (parenthesized_expression "((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0))" ( (binary_expression "(uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)" (parenthesized_expression "(uVar1 != 0)" ( (binary_expression "uVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0)" ( (comma_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1), iVar3 != 0" (assignment_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1)" identifier = (call_expression "(*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_1 * 4,param_3,uVar1)" (parenthesized_expression "(*(code *)PTR_wmemcmp_004c5c74)" ( (pointer_expression "*(code *)PTR_wmemcmp_004c5c74" * (cast_expression "(code *)PTR_wmemcmp_004c5c74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3 + param_1 * 4,param_3,uVar1)" ( (binary_expression "iVar3 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal)) , identifier , identifier )))) , (binary_expression "iVar3 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) })) (return_statement "return param_2 - uVar2;" return (binary_expression "param_2 - uVar2" identifier - identifier) ;) })))
(translation_unit "int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}\n\n" (function_definition "int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" primitive_type (function_declarator "FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)" identifier (parameter_list "(int *param_1,uint param_2,uint param_3,undefined4 param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar1 = *(uint *)(iVar3 + -0xc);" (assignment_expression "uVar1 = *(uint *)(iVar3 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar3 + -0xc)" * (cast_expression "(uint *)(iVar3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -0xc)" ( (binary_expression "iVar3 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" if (parenthesized_expression "(uVar1 < param_2)" ( (binary_expression "uVar1 < param_2" identifier < identifier) )) (compound_statement "{\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" { (expression_statement "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (assignment_expression "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" identifier = (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,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 + -0x3a8c,param_2,uVar1)" ( (binary_expression "PTR_s__s_004c1a50 + -0xe00" identifier + number_literal) , (binary_expression "PTR_UINT_004c12dc + -0x3a8c" identifier + number_literal) , identifier , identifier )))) ;) (return_statement "return iVar3;" return identifier ;) })) (if_statement "if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }" if (parenthesized_expression "(uVar1 - param_2 <= param_3)" ( (binary_expression "uVar1 - param_2 <= param_3" (binary_expression "uVar1 - param_2" identifier - identifier) <= identifier) )) (compound_statement "{\n    param_3 = uVar1 - param_2;\n  }" { (expression_statement "param_3 = uVar1 - param_2;" (assignment_expression "param_3 = uVar1 - param_2" identifier = (binary_expression "uVar1 - param_2" identifier - identifier)) ;) })) (expression_statement "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);" (assignment_expression "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4)" identifier = (call_expression "(*(code *)PTR_wcslen_004c5c88)(param_4)" (parenthesized_expression "(*(code *)PTR_wcslen_004c5c88)" ( (pointer_expression "*(code *)PTR_wcslen_004c5c88" * (cast_expression "(code *)PTR_wcslen_004c5c88" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) (if_statement "if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }" if (parenthesized_expression "(uVar2 <= param_3)" ( (binary_expression "uVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n    uVar1 = uVar2;\n  }" { (expression_statement "uVar1 = uVar2;" (assignment_expression "uVar1 = uVar2" identifier = identifier) ;) })) (if_statement "if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }" if (parenthesized_expression "((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0))" ( (binary_expression "(uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" (parenthesized_expression "(uVar1 != 0)" ( (binary_expression "uVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "(iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" ( (comma_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0" (assignment_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" identifier = (call_expression "(*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_wmemcmp_004c5c74)" ( (pointer_expression "*(code *)PTR_wmemcmp_004c5c74" * (cast_expression "(code *)PTR_wmemcmp_004c5c74" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(iVar3 + param_2 * 4,param_4,uVar1)" ( (binary_expression "iVar3 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) , identifier , identifier )))) , (binary_expression "iVar3 != 0" identifier != number_literal)) ))) )) (compound_statement "{\n    return iVar3;\n  }" { (return_statement "return iVar3;" return identifier ;) })) (return_statement "return param_3 - uVar2;" return (binary_expression "param_3 - uVar2" identifier - identifier) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE 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 = (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 IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (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 )))) ;) (return_statement return IDENT ;) })) (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 (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + (binary_expression IDENT * LIT)) , IDENT , IDENT )))) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (return_statement return IDENT ;) })) (return_statement return (binary_expression IDENT - IDENT) ;) })))
(function_definition "int FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)\n\n{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" (primitive_type "int") (function_declarator "FUN_003d2014(int *param_1,uint param_2,uint param_3,undefined4 param_4)" (identifier "FUN_003d2014") (parameter_list "(int *param_1,uint param_2,uint param_3,undefined4 param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  uint uVar1;\n  uint uVar2;\n  int iVar3;\n  \n  iVar3 = *param_1;\n  uVar1 = *(uint *)(iVar3 + -0xc);\n  if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }\n  if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }\n  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);\n  uVar1 = param_3;\n  if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }\n  if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }\n  return param_3 - uVar2;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar3 = *param_1;" (assignment_expression "iVar3 = *param_1" (identifier "iVar3") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar1 = *(uint *)(iVar3 + -0xc);" (assignment_expression "uVar1 = *(uint *)(iVar3 + -0xc)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(iVar3 + -0xc)" (* "*") (cast_expression "(uint *)(iVar3 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + -0xc)" (( "(") (binary_expression "iVar3 + -0xc" (identifier "iVar3") (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (uVar1 < param_2) {\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" (if "if") (parenthesized_expression "(uVar1 < param_2)" (( "(") (binary_expression "uVar1 < param_2" (identifier "uVar1") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n    return iVar3;\n  }" ({ "{") (expression_statement "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (assignment_expression "iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" (identifier "iVar3") (= "=") (call_expression "(*(code *)PTR___throw_out_of_range_fmt_004c225c)\n                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,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 + -0x3a8c,param_2,uVar1)" (( "(") (binary_expression "PTR_s__s_004c1a50 + -0xe00" (identifier "PTR_s__s_004c1a50") (+ "+") (number_literal "-0xe00")) (, ",") (binary_expression "PTR_UINT_004c12dc + -0x3a8c" (identifier "PTR_UINT_004c12dc") (+ "+") (number_literal "-0x3a8c")) (, ",") (identifier "param_2") (, ",") (identifier "uVar1") () ")")))) (; ";")) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (if_statement "if (uVar1 - param_2 <= param_3) {\n    param_3 = uVar1 - param_2;\n  }" (if "if") (parenthesized_expression "(uVar1 - param_2 <= param_3)" (( "(") (binary_expression "uVar1 - param_2 <= param_3" (binary_expression "uVar1 - param_2" (identifier "uVar1") (- "-") (identifier "param_2")) (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n    param_3 = uVar1 - param_2;\n  }" ({ "{") (expression_statement "param_3 = uVar1 - param_2;" (assignment_expression "param_3 = uVar1 - param_2" (identifier "param_3") (= "=") (binary_expression "uVar1 - param_2" (identifier "uVar1") (- "-") (identifier "param_2"))) (; ";")) (} "}"))) (expression_statement "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);" (assignment_expression "uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4)" (identifier "uVar2") (= "=") (call_expression "(*(code *)PTR_wcslen_004c5c88)(param_4)" (parenthesized_expression "(*(code *)PTR_wcslen_004c5c88)" (( "(") (pointer_expression "*(code *)PTR_wcslen_004c5c88" (* "*") (cast_expression "(code *)PTR_wcslen_004c5c88" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wcslen_004c5c88"))) () ")")) (argument_list "(param_4)" (( "(") (identifier "param_4") () ")")))) (; ";")) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" (identifier "uVar1") (= "=") (identifier "param_3")) (; ";")) (if_statement "if (uVar2 <= param_3) {\n    uVar1 = uVar2;\n  }" (if "if") (parenthesized_expression "(uVar2 <= param_3)" (( "(") (binary_expression "uVar2 <= param_3" (identifier "uVar2") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n    uVar1 = uVar2;\n  }" ({ "{") (expression_statement "uVar1 = uVar2;" (assignment_expression "uVar1 = uVar2" (identifier "uVar1") (= "=") (identifier "uVar2")) (; ";")) (} "}"))) (if_statement "if ((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {\n    return iVar3;\n  }" (if "if") (parenthesized_expression "((uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0))" (( "(") (binary_expression "(uVar1 != 0) &&\n     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" (parenthesized_expression "(uVar1 != 0)" (( "(") (binary_expression "uVar1 != 0" (identifier "uVar1") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)" (( "(") (comma_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0" (assignment_expression "iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" (identifier "iVar3") (= "=") (call_expression "(*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_wmemcmp_004c5c74)" (( "(") (pointer_expression "*(code *)PTR_wmemcmp_004c5c74" (* "*") (cast_expression "(code *)PTR_wmemcmp_004c5c74" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wmemcmp_004c5c74"))) () ")")) (argument_list "(iVar3 + param_2 * 4,param_4,uVar1)" (( "(") (binary_expression "iVar3 + param_2 * 4" (identifier "iVar3") (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) (, ",") (identifier "param_4") (, ",") (identifier "uVar1") () ")")))) (, ",") (binary_expression "iVar3 != 0" (identifier "iVar3") (!= "!=") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    return iVar3;\n  }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (return_statement "return param_3 - uVar2;" (return "return") (binary_expression "param_3 - uVar2" (identifier "param_3") (- "-") (identifier "uVar2")) (; ";")) (} "}")))

/* std::wstring::compare(unsigned int, unsigned int, wchar_t const*) const */

int __thiscall std::type_1::function_1(type_1 *this,type_2 var_3,type_2 var_6,type_3 *param_3)

{
  type_2 var_2;
  type_2 var_7;
  int var_1;
  
  var_1 = *(int *)this;
  var_2 = *(type_2 *)(var_1 + -0xc);
  if (var_2 < var_3) {
    var_1 = (*(type_4 *)PTR___throw_out_of_range_fmt_004c225c)
                      (var_4 + -0xe00,var_5 + -0x3a8c,var_3,var_2);
    return var_1;
  }
  if (var_2 - var_3 <= var_6) {
    var_6 = var_2 - var_3;
  }
  var_7 = (*(type_4 *)PTR_wcslen_004c5c88)(param_3);
  var_2 = var_6;
  if (var_7 <= var_6) {
    var_2 = var_7;
  }
  if ((var_2 != 0) &&
     (var_1 = (*(type_4 *)PTR_wmemcmp_004c5c74)(var_1 + var_3 * 4,param_3,var_2), var_1 != 0)) {
    return var_1;
  }
  return var_6 - var_7;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (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: (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))))) (return_statement (identifier)))) (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 (assignment_expression left: (identifier) right: (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))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (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: (binary_expression left: (identifier) right: (number_literal))) (identifier) (identifier)))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (return_statement (identifier)))) (return_statement (binary_expression left: (identifier) right: (identifier))))))

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

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  
  iVar3 = *param_1;
  uVar1 = *(uint *)(iVar3 + -0xc);
  if (uVar1 < param_2) {
    iVar3 = (*(code *)PTR___throw_out_of_range_fmt_004c225c)
                      (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);
    return iVar3;
  }
  if (uVar1 - param_2 <= param_3) {
    param_3 = uVar1 - param_2;
  }
  uVar2 = (*(code *)PTR_wcslen_004c5c88)(param_4);
  uVar1 = param_3;
  if (uVar2 <= param_3) {
    uVar1 = uVar2;
  }
  if ((uVar1 != 0) &&
     (iVar3 = (*(code *)PTR_wmemcmp_004c5c74)(iVar3 + param_2 * 4,param_4,uVar1), iVar3 != 0)) {
    return iVar3;
  }
  return param_3 - uVar2;
}

