
/* std::string::compare(unsigned int, unsigned int, std::string const&) const */

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

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(*(int *)this + -0xc);
  if (param_1 <= uVar1) {
    if (uVar1 - param_1 <= param_2) {
      param_2 = uVar1 - param_1;
    }
    uVar3 = *(uint *)(*(int *)param_3 + -0xc);
    uVar1 = param_2;
    if (uVar3 <= param_2) {
      uVar1 = uVar3;
    }
    if ((uVar1 == 0) ||
       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),
       iVar2 == 0)) {
      iVar2 = param_2 - uVar3;
    }
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  __throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);
}



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

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (param_2 <= uVar1) {
    if (uVar1 - param_2 <= param_3) {
      param_3 = uVar1 - param_2;
    }
    uVar3 = *(uint *)(*param_4 + -0xc);
    uVar1 = param_3;
    if (uVar3 <= param_3) {
      uVar1 = uVar3;
    }
    if ((uVar1 == 0) ||
       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {
      iVar2 = param_3 - uVar3;
    }
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  std::__throw_out_of_range_fmt
            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);
}


lui gp,0x15
addiu gp,gp,0x2c0c
addu gp,gp,t9
lw a0,0x0(a0)
addiu sp,sp,-0x28
sw gp,0x10(sp)
sw ra,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
lw v0,-0xc(a0)
sltu v1,v0,a1
bne v1,zero,0x003766c4
_lw t9,-0x6fe4(gp)
subu v0,v0,a1
lw v1,0x0(a3)
sltu s0,a2,v0
movz a2,v0,s0
lw s1,-0xc(v1)
or s0,a2,zero
or v0,a2,zero
sltu a2,a2,s1
movz v0,s1,a2
beq v0,zero,0x003766ac
_or a2,v0,zero
lw t9,-0x354c(gp)
addu a0,a0,a1
jalr t9
_or a1,v1,zero
bne v0,zero,0x003766b4
_lw ra,0x24(sp)
subu v0,s0,s1
lw ra,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
or a2,a1,zero
lw a0,-0x77f0(gp)
lw a1,-0x7f64(gp)
or a3,v0,zero
addiu a0,a0,-0xe00
bal 0x003898a4
_addiu a1,a1,-0x3a8c
(translation_unit "int FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}\n\n" (function_definition "int FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" primitive_type (function_declarator "FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)" identifier (parameter_list "(int *param_1,uint param_2,uint param_3,int *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 "int *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_1 + -0xc)" * (cast_expression "(uint *)(*param_1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" if (parenthesized_expression "(param_2 <= uVar1)" ( (binary_expression "param_2 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" { (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 "uVar3 = *(uint *)(*param_4 + -0xc);" (assignment_expression "uVar3 = *(uint *)(*param_4 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_4 + -0xc)" * (cast_expression "(uint *)(*param_4 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_4 + -0xc)" ( (binary_expression "*param_4 + -0xc" (pointer_expression "*param_4" * identifier) + number_literal) ))))) ;) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) (if_statement "if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }" if (parenthesized_expression "(uVar3 <= param_3)" ( (binary_expression "uVar3 <= param_3" identifier <= identifier) )) (compound_statement "{\n      uVar1 = uVar3;\n    }" { (expression_statement "uVar1 = uVar3;" (assignment_expression "uVar1 = uVar3" identifier = identifier) ;) })) (if_statement "if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }" if (parenthesized_expression "((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0))" ( (binary_expression "(uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" ( (comma_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0" (assignment_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" identifier = (call_expression "(*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcmp_004c5cf4)" ( (pointer_expression "*(code *)PTR_memcmp_004c5cf4" * (cast_expression "(code *)PTR_memcmp_004c5cf4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*param_1 + param_2,*param_4,uVar1)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) , (pointer_expression "*param_4" * identifier) , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar2 = param_3 - uVar3;\n    }" { (expression_statement "iVar2 = param_3 - uVar3;" (assignment_expression "iVar2 = param_3 - uVar3" identifier = (binary_expression "param_3 - uVar3" identifier - identifier)) ;) })) (return_statement "return iVar2;" return identifier ;) })) comment (labeled_statement "std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" statement_identifier : (ERROR ":" :) (expression_statement "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (call_expression "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" 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 ))) ;)) })))
(translation_unit "/* std::string::compare(unsigned int, unsigned int, std::string const&) const */\n\nint __thiscall std::string::compare(string *this,uint param_1,uint param_2,string *param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (param_1 <= uVar1) {\n    if (uVar1 - param_1 <= param_2) {\n      param_2 = uVar1 - param_1;\n    }\n    uVar3 = *(uint *)(*(int *)param_3 + -0xc);\n    uVar1 = param_2;\n    if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n}\n\n" comment (function_definition "int __thiscall std::string::compare(string *this,uint param_1,uint param_2,string *param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (param_1 <= uVar1) {\n    if (uVar1 - param_1 <= param_2) {\n      param_2 = uVar1 - param_1;\n    }\n    uVar3 = *(uint *)(*(int *)param_3 + -0xc);\n    uVar1 = param_2;\n    if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "compare(string *this,uint param_1,uint param_2,string *param_3)" identifier (parameter_list "(string *this,uint param_1,uint param_2,string *param_3)" ( (parameter_declaration "string *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 "string *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*(int *)this + -0xc);\n  if (param_1 <= uVar1) {\n    if (uVar1 - param_1 <= param_2) {\n      param_2 = uVar1 - param_1;\n    }\n    uVar3 = *(uint *)(*(int *)param_3 + -0xc);\n    uVar1 = param_2;\n    if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*(int *)this + -0xc);" (assignment_expression "uVar1 = *(uint *)(*(int *)this + -0xc)" identifier = (pointer_expression "*(uint *)(*(int *)this + -0xc)" * (cast_expression "(uint *)(*(int *)this + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (param_1 <= uVar1) {\n    if (uVar1 - param_1 <= param_2) {\n      param_2 = uVar1 - param_1;\n    }\n    uVar3 = *(uint *)(*(int *)param_3 + -0xc);\n    uVar1 = param_2;\n    if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }\n    return iVar2;\n  }" if (parenthesized_expression "(param_1 <= uVar1)" ( (binary_expression "param_1 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    if (uVar1 - param_1 <= param_2) {\n      param_2 = uVar1 - param_1;\n    }\n    uVar3 = *(uint *)(*(int *)param_3 + -0xc);\n    uVar1 = param_2;\n    if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }\n    return iVar2;\n  }" { (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 "uVar3 = *(uint *)(*(int *)param_3 + -0xc);" (assignment_expression "uVar3 = *(uint *)(*(int *)param_3 + -0xc)" identifier = (pointer_expression "*(uint *)(*(int *)param_3 + -0xc)" * (cast_expression "(uint *)(*(int *)param_3 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)param_3 + -0xc)" ( (binary_expression "*(int *)param_3 + -0xc" (pointer_expression "*(int *)param_3" * (cast_expression "(int *)param_3" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (expression_statement "uVar1 = param_2;" (assignment_expression "uVar1 = param_2" identifier = identifier) ;) (if_statement "if (uVar3 <= param_2) {\n      uVar1 = uVar3;\n    }" if (parenthesized_expression "(uVar3 <= param_2)" ( (binary_expression "uVar3 <= param_2" identifier <= identifier) )) (compound_statement "{\n      uVar1 = uVar3;\n    }" { (expression_statement "uVar1 = uVar3;" (assignment_expression "uVar1 = uVar3" identifier = identifier) ;) })) (if_statement "if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)) {\n      iVar2 = param_2 - uVar3;\n    }" if (parenthesized_expression "((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0))" ( (binary_expression "(uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)" (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0)" ( (comma_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1),\n       iVar2 == 0" (assignment_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1)" identifier = (call_expression "(*(code *)PTR_memcmp_004c5cf4)(*(int *)this + param_1,*(int *)param_3,uVar1)" (parenthesized_expression "(*(code *)PTR_memcmp_004c5cf4)" ( (pointer_expression "*(code *)PTR_memcmp_004c5cf4" * (cast_expression "(code *)PTR_memcmp_004c5cf4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*(int *)this + param_1,*(int *)param_3,uVar1)" ( (binary_expression "*(int *)this + param_1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) , (pointer_expression "*(int *)param_3" * (cast_expression "(int *)param_3" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar2 = param_2 - uVar3;\n    }" { (expression_statement "iVar2 = param_2 - uVar3;" (assignment_expression "iVar2 = param_2 - uVar3" identifier = (binary_expression "param_2 - uVar3" identifier - identifier)) ;) })) (return_statement "return iVar2;" return identifier ;) })) comment (expression_statement "__throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1);" (call_expression "__throw_out_of_range_fmt(PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_1,uVar1)" 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 ))) ;) })))
(translation_unit "int FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    \n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}\n\n" (function_definition "int FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    \n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" primitive_type (function_declarator "FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)" identifier (parameter_list "(int *param_1,uint param_2,uint param_3,int *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 "int *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    \n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_1 + -0xc)" * (cast_expression "(uint *)(*param_1 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" if (parenthesized_expression "(param_2 <= uVar1)" ( (binary_expression "param_2 <= uVar1" identifier <= identifier) )) (compound_statement "{\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" { (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 "uVar3 = *(uint *)(*param_4 + -0xc);" (assignment_expression "uVar3 = *(uint *)(*param_4 + -0xc)" identifier = (pointer_expression "*(uint *)(*param_4 + -0xc)" * (cast_expression "(uint *)(*param_4 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_4 + -0xc)" ( (binary_expression "*param_4 + -0xc" (pointer_expression "*param_4" * identifier) + number_literal) ))))) ;) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) (if_statement "if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }" if (parenthesized_expression "(uVar3 <= param_3)" ( (binary_expression "uVar3 <= param_3" identifier <= identifier) )) (compound_statement "{\n      uVar1 = uVar3;\n    }" { (expression_statement "uVar1 = uVar3;" (assignment_expression "uVar1 = uVar3" identifier = identifier) ;) })) (if_statement "if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }" if (parenthesized_expression "((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0))" ( (binary_expression "(uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) || (parenthesized_expression "(iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" ( (comma_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0" (assignment_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" identifier = (call_expression "(*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcmp_004c5cf4)" ( (pointer_expression "*(code *)PTR_memcmp_004c5cf4" * (cast_expression "(code *)PTR_memcmp_004c5cf4" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(*param_1 + param_2,*param_4,uVar1)" ( (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" * identifier) + identifier) , (pointer_expression "*param_4" * identifier) , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      iVar2 = param_3 - uVar3;\n    }" { (expression_statement "iVar2 = param_3 - uVar3;" (assignment_expression "iVar2 = param_3 - uVar3" identifier = (binary_expression "param_3 - uVar3" identifier - identifier)) ;) })) (return_statement "return iVar2;" return identifier ;) })) (labeled_statement "std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" statement_identifier : (ERROR ":" :) (expression_statement "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (call_expression "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" 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 ))) ;)) })))
(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 (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (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 (pointer_expression * IDENT) + IDENT) , (pointer_expression * IDENT) , IDENT )))) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) })) (return_statement return IDENT ;) })) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , (binary_expression IDENT + LIT) , IDENT , IDENT ))) ;)) })))
(function_definition "int FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    \n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" (primitive_type "int") (function_declarator "FUN_00376634(int *param_1,uint param_2,uint param_3,int *param_4)" (identifier "FUN_00376634") (parameter_list "(int *param_1,uint param_2,uint param_3,int *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 "int *param_4" (primitive_type "int") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  uint uVar3;\n  \n  uVar1 = *(uint *)(*param_1 + -0xc);\n  if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }\n                    \n  std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (expression_statement "uVar1 = *(uint *)(*param_1 + -0xc);" (assignment_expression "uVar1 = *(uint *)(*param_1 + -0xc)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(*param_1 + -0xc)" (* "*") (cast_expression "(uint *)(*param_1 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (param_2 <= uVar1) {\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" (if "if") (parenthesized_expression "(param_2 <= uVar1)" (( "(") (binary_expression "param_2 <= uVar1" (identifier "param_2") (<= "<=") (identifier "uVar1")) () ")")) (compound_statement "{\n    if (uVar1 - param_2 <= param_3) {\n      param_3 = uVar1 - param_2;\n    }\n    uVar3 = *(uint *)(*param_4 + -0xc);\n    uVar1 = param_3;\n    if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }\n    if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }\n    return iVar2;\n  }" ({ "{") (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 "uVar3 = *(uint *)(*param_4 + -0xc);" (assignment_expression "uVar3 = *(uint *)(*param_4 + -0xc)" (identifier "uVar3") (= "=") (pointer_expression "*(uint *)(*param_4 + -0xc)" (* "*") (cast_expression "(uint *)(*param_4 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_4 + -0xc)" (( "(") (binary_expression "*param_4 + -0xc" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" (identifier "uVar1") (= "=") (identifier "param_3")) (; ";")) (if_statement "if (uVar3 <= param_3) {\n      uVar1 = uVar3;\n    }" (if "if") (parenthesized_expression "(uVar3 <= param_3)" (( "(") (binary_expression "uVar3 <= param_3" (identifier "uVar3") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n      uVar1 = uVar3;\n    }" ({ "{") (expression_statement "uVar1 = uVar3;" (assignment_expression "uVar1 = uVar3" (identifier "uVar1") (= "=") (identifier "uVar3")) (; ";")) (} "}"))) (if_statement "if ((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {\n      iVar2 = param_3 - uVar3;\n    }" (if "if") (parenthesized_expression "((uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0))" (( "(") (binary_expression "(uVar1 == 0) ||\n       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" (parenthesized_expression "(uVar1 == 0)" (( "(") (binary_expression "uVar1 == 0" (identifier "uVar1") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)" (( "(") (comma_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0" (assignment_expression "iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1)" (parenthesized_expression "(*(code *)PTR_memcmp_004c5cf4)" (( "(") (pointer_expression "*(code *)PTR_memcmp_004c5cf4" (* "*") (cast_expression "(code *)PTR_memcmp_004c5cf4" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memcmp_004c5cf4"))) () ")")) (argument_list "(*param_1 + param_2,*param_4,uVar1)" (( "(") (binary_expression "*param_1 + param_2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "param_2")) (, ",") (pointer_expression "*param_4" (* "*") (identifier "param_4")) (, ",") (identifier "uVar1") () ")")))) (, ",") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n      iVar2 = param_3 - uVar3;\n    }" ({ "{") (expression_statement "iVar2 = param_3 - uVar3;" (assignment_expression "iVar2 = param_3 - uVar3" (identifier "iVar2") (= "=") (binary_expression "param_3 - uVar3" (identifier "param_3") (- "-") (identifier "uVar3"))) (; ";")) (} "}"))) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (labeled_statement "std::__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (expression_statement "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);" (call_expression "__throw_out_of_range_fmt\n            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1)" (identifier "__throw_out_of_range_fmt") (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") () ")"))) (; ";"))) (} "}")))

/* std::string::compare(unsigned int, unsigned int, std::string const&) const */

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

{
  type_2 var_2;
  int var_5;
  type_2 var_4;
  
  var_2 = *(type_2 *)(*(int *)this + -0xc);
  if (var_1 <= var_2) {
    if (var_2 - var_1 <= var_3) {
      var_3 = var_2 - var_1;
    }
    var_4 = *(type_2 *)(*(int *)param_3 + -0xc);
    var_2 = var_3;
    if (var_4 <= var_3) {
      var_2 = var_4;
    }
    if ((var_2 == 0) ||
       (var_5 = (*(type_3 *)PTR_memcmp_004c5cf4)(*(int *)this + var_1,*(int *)param_3,var_2),
       var_5 == 0)) {
      var_5 = var_3 - var_4;
    }
    return var_5;
  }
                    /* WARNING: Subroutine does not return */
  var_6(var_7 + -0xe00,var_8 + -0x3a8c,var_1,var_2);
}


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

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

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  
  uVar1 = *(uint *)(*param_1 + -0xc);
  if (param_2 <= uVar1) {
    if (uVar1 - param_2 <= param_3) {
      param_3 = uVar1 - param_2;
    }
    uVar3 = *(uint *)(*param_4 + -0xc);
    uVar1 = param_3;
    if (uVar3 <= param_3) {
      uVar1 = uVar3;
    }
    if ((uVar1 == 0) ||
       (iVar2 = (*(code *)PTR_memcmp_004c5cf4)(*param_1 + param_2,*param_4,uVar1), iVar2 == 0)) {
      iVar2 = param_3 - uVar3;
    }
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  std::__throw_out_of_range_fmt
            (PTR_s__s_004c1a50 + -0xe00,PTR_UINT_004c12dc + -0x3a8c,param_2,uVar1);
}

