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

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

{
  uint uVar1;
  int iVar2;
  int iVar3;
  
  if (*(int *)(this + 4) == 0) {
    return 0xffffffff;
  }
  uVar1 = *(int *)(this + 4) - 1;
  iVar3 = *(int *)this;
  if (uVar1 <= param_2) {
    param_2 = uVar1;
  }
  while( true ) {
    if (param_3 == 0) {
      return param_2;
    }
    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);
    if (iVar2 == 0) break;
    param_2 = param_2 - 1;
    if (param_2 == 0xffffffff) {
      return 0xffffffff;
    }
  }
  return param_2;
}



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

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

{
  uint uVar1;
  int iVar2;
  int iVar3;
  
  if (*(int *)(this + 4) == 0) {
    return 0xffffffff;
  }
  uVar1 = *(int *)(this + 4) - 1;
  iVar3 = *(int *)this;
  if (uVar1 <= param_2) {
    param_2 = uVar1;
  }
  while( true ) {
    if (param_3 == 0) {
      return param_2;
    }
    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);
    if (iVar2 == 0) break;
    param_2 = param_2 - 1;
    if (param_2 == 0xffffffff) {
      return 0xffffffff;
    }
  }
  return param_2;
}


lui gp,0x19
addiu gp,gp,-0x260
addu gp,gp,t9
addiu sp,sp,-0x30
lw v0,0x4(a0)
sw gp,0x10(sp)
sw ra,0x2c(sp)
sw s4,0x28(sp)
sw s3,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
beq v0,zero,0x0033954c
_sw s0,0x18(sp)
addiu v0,v0,-0x1
lw s3,0x0(a0)
li s4,-0x1
sltu s0,a2,v0
movz a2,v0,s0
or s1,a3,zero
or s2,a1,zero
or s0,a2,zero
sll v0,s0,0x2
lw t9,-0x3530(gp)
beq s1,zero,0x00339528
_or a2,s1,zero
addu v0,s3,v0
or a0,s2,zero
jalr t9
_lw a1,0x0(v0)
beq v0,zero,0x00339528
_lw gp,0x10(sp)
addiu s0,s0,-0x1
bne s0,s4,0x003394f8
_sll v0,s0,0x2
lw ra,0x2c(sp)
or v0,s0,zero
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
lw ra,0x2c(sp)
li s0,-0x1
lw s4,0x28(sp)
or v0,s0,zero
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
(translation_unit "/* std::wstring::find_last_not_of(wchar_t const*, unsigned int, unsigned int) const */\n\nuint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}\n\n" comment (function_definition "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" identifier (parameter_list "(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(*(int *)(this + 4) == 0)" ( (binary_expression "*(int *)(this + 4) == 0" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "uVar1 = *(int *)(this + 4) - 1;" (assignment_expression "uVar1 = *(int *)(this + 4) - 1" identifier = (binary_expression "*(int *)(this + 4) - 1" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) - number_literal)) ;) (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))) ;) (if_statement "if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }" if (parenthesized_expression "(uVar1 <= param_2)" ( (binary_expression "uVar1 <= param_2" identifier <= identifier) )) (compound_statement "{\n    param_2 = uVar1;\n  }" { (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" identifier = identifier) ;) })) (while_statement "while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" { (if_statement "if (param_3 == 0) {\n      return param_2;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      return param_2;\n    }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);" (assignment_expression "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" identifier = (call_expression "(*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (parenthesized_expression "(*(code *)PTR_wmemchr_004c5d10)" ( (pointer_expression "*(code *)PTR_wmemchr_004c5d10" * (cast_expression "(code *)PTR_wmemchr_004c5d10" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" ( identifier , (pointer_expression "*(undefined4 *)(iVar3 + param_2 * 4)" * (cast_expression "(undefined4 *)(iVar3 + param_2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + param_2 * 4)" ( (binary_expression "iVar3 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (iVar2 == 0) break;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "param_2 = param_2 - 1;" (assignment_expression "param_2 = param_2 - 1" identifier = (binary_expression "param_2 - 1" identifier - number_literal)) ;) (if_statement "if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(param_2 == 0xffffffff)" ( (binary_expression "param_2 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) (return_statement "return param_2;" return identifier ;) })))
(translation_unit "/* std::wstring::find_last_not_of(wchar_t const*, unsigned int, unsigned int) const */\n\nuint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}\n\n" comment (function_definition "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" identifier (parameter_list "(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(*(int *)(this + 4) == 0)" ( (binary_expression "*(int *)(this + 4) == 0" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "uVar1 = *(int *)(this + 4) - 1;" (assignment_expression "uVar1 = *(int *)(this + 4) - 1" identifier = (binary_expression "*(int *)(this + 4) - 1" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) - number_literal)) ;) (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))) ;) (if_statement "if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }" if (parenthesized_expression "(uVar1 <= param_2)" ( (binary_expression "uVar1 <= param_2" identifier <= identifier) )) (compound_statement "{\n    param_2 = uVar1;\n  }" { (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" identifier = identifier) ;) })) (while_statement "while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" { (if_statement "if (param_3 == 0) {\n      return param_2;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      return param_2;\n    }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);" (assignment_expression "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" identifier = (call_expression "(*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (parenthesized_expression "(*(code *)PTR_wmemchr_004c5d10)" ( (pointer_expression "*(code *)PTR_wmemchr_004c5d10" * (cast_expression "(code *)PTR_wmemchr_004c5d10" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" ( identifier , (pointer_expression "*(undefined4 *)(iVar3 + param_2 * 4)" * (cast_expression "(undefined4 *)(iVar3 + param_2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + param_2 * 4)" ( (binary_expression "iVar3 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (iVar2 == 0) break;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "param_2 = param_2 - 1;" (assignment_expression "param_2 = param_2 - 1" identifier = (binary_expression "param_2 - 1" identifier - number_literal)) ;) (if_statement "if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(param_2 == 0xffffffff)" ( (binary_expression "param_2 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) (return_statement "return param_2;" return identifier ;) })))
(translation_unit "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}\n\n" (function_definition "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" identifier (parameter_list "(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(*(int *)(this + 4) == 0)" ( (binary_expression "*(int *)(this + 4) == 0" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "uVar1 = *(int *)(this + 4) - 1;" (assignment_expression "uVar1 = *(int *)(this + 4) - 1" identifier = (binary_expression "*(int *)(this + 4) - 1" (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) - number_literal)) ;) (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))) ;) (if_statement "if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }" if (parenthesized_expression "(uVar1 <= param_2)" ( (binary_expression "uVar1 <= param_2" identifier <= identifier) )) (compound_statement "{\n    param_2 = uVar1;\n  }" { (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" identifier = identifier) ;) })) (while_statement "while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" { (if_statement "if (param_3 == 0) {\n      return param_2;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      return param_2;\n    }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);" (assignment_expression "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" identifier = (call_expression "(*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (parenthesized_expression "(*(code *)PTR_wmemchr_004c5d10)" ( (pointer_expression "*(code *)PTR_wmemchr_004c5d10" * (cast_expression "(code *)PTR_wmemchr_004c5d10" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" ( identifier , (pointer_expression "*(undefined4 *)(iVar3 + param_2 * 4)" * (cast_expression "(undefined4 *)(iVar3 + param_2 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + param_2 * 4)" ( (binary_expression "iVar3 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (iVar2 == 0) break;" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "param_2 = param_2 - 1;" (assignment_expression "param_2 = param_2 - 1" identifier = (binary_expression "param_2 - 1" identifier - number_literal)) ;) (if_statement "if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }" if (parenthesized_expression "(param_2 == 0xffffffff)" ( (binary_expression "param_2 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n      return 0xffffffff;\n    }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) (return_statement "return param_2;" return identifier ;) })))
(translation_unit (function_definition TYPE (ms_call_modifier __thiscall) (ERROR IDENT : : IDENT : :) (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 ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" (type_identifier "uint") (ms_call_modifier "__thiscall" (__thiscall "__thiscall")) (ERROR "std::wstring::" (identifier "std") (: ":") (: ":") (identifier "wstring") (: ":") (: ":")) (function_declarator "find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" (identifier "find_last_not_of") (parameter_list "(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" (( "(") (parameter_declaration "wstring *this" (type_identifier "wstring") (pointer_declarator "*this" (* "*") (identifier "this"))) (, ",") (parameter_declaration "wchar_t *param_1" (type_identifier "wchar_t") (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")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  int iVar3;\n  \n  if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }\n  uVar1 = *(int *)(this + 4) - 1;\n  iVar3 = *(int *)this;\n  if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }\n  while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }\n  return param_2;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (if_statement "if (*(int *)(this + 4) == 0) {\n    return 0xffffffff;\n  }" (if "if") (parenthesized_expression "(*(int *)(this + 4) == 0)" (( "(") (binary_expression "*(int *)(this + 4) == 0" (pointer_expression "*(int *)(this + 4)" (* "*") (cast_expression "(int *)(this + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 4)" (( "(") (binary_expression "this + 4" (identifier "this") (+ "+") (number_literal "4")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return 0xffffffff;\n  }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (expression_statement "uVar1 = *(int *)(this + 4) - 1;" (assignment_expression "uVar1 = *(int *)(this + 4) - 1" (identifier "uVar1") (= "=") (binary_expression "*(int *)(this + 4) - 1" (pointer_expression "*(int *)(this + 4)" (* "*") (cast_expression "(int *)(this + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(this + 4)" (( "(") (binary_expression "this + 4" (identifier "this") (+ "+") (number_literal "4")) () ")")))) (- "-") (number_literal "1"))) (; ";")) (expression_statement "iVar3 = *(int *)this;" (assignment_expression "iVar3 = *(int *)this" (identifier "iVar3") (= "=") (pointer_expression "*(int *)this" (* "*") (cast_expression "(int *)this" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")))) (; ";")) (if_statement "if (uVar1 <= param_2) {\n    param_2 = uVar1;\n  }" (if "if") (parenthesized_expression "(uVar1 <= param_2)" (( "(") (binary_expression "uVar1 <= param_2" (identifier "uVar1") (<= "<=") (identifier "param_2")) () ")")) (compound_statement "{\n    param_2 = uVar1;\n  }" ({ "{") (expression_statement "param_2 = uVar1;" (assignment_expression "param_2 = uVar1" (identifier "param_2") (= "=") (identifier "uVar1")) (; ";")) (} "}"))) (while_statement "while( true ) {\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    if (param_3 == 0) {\n      return param_2;\n    }\n    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);\n    if (iVar2 == 0) break;\n    param_2 = param_2 - 1;\n    if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }\n  }" ({ "{") (if_statement "if (param_3 == 0) {\n      return param_2;\n    }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      return param_2;\n    }" ({ "{") (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (expression_statement "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);" (assignment_expression "iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (identifier "iVar2") (= "=") (call_expression "(*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (parenthesized_expression "(*(code *)PTR_wmemchr_004c5d10)" (( "(") (pointer_expression "*(code *)PTR_wmemchr_004c5d10" (* "*") (cast_expression "(code *)PTR_wmemchr_004c5d10" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_wmemchr_004c5d10"))) () ")")) (argument_list "(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3)" (( "(") (identifier "param_1") (, ",") (pointer_expression "*(undefined4 *)(iVar3 + param_2 * 4)" (* "*") (cast_expression "(undefined4 *)(iVar3 + param_2 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + param_2 * 4)" (( "(") (binary_expression "iVar3 + param_2 * 4" (identifier "iVar3") (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4"))) () ")")))) (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) break;" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "param_2 = param_2 - 1;" (assignment_expression "param_2 = param_2 - 1" (identifier "param_2") (= "=") (binary_expression "param_2 - 1" (identifier "param_2") (- "-") (number_literal "1"))) (; ";")) (if_statement "if (param_2 == 0xffffffff) {\n      return 0xffffffff;\n    }" (if "if") (parenthesized_expression "(param_2 == 0xffffffff)" (( "(") (binary_expression "param_2 == 0xffffffff" (identifier "param_2") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n      return 0xffffffff;\n    }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (} "}"))) (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}")))

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

type_1 __thiscall
std::type_2::function_1(type_2 *var_1,type_3 *param_1,type_1 var_3,type_1 var_4)

{
  type_1 var_2;
  int var_6;
  int var_5;
  
  if (*(int *)(var_1 + 4) == 0) {
    return 0xffffffff;
  }
  var_2 = *(int *)(var_1 + 4) - 1;
  var_5 = *(int *)var_1;
  if (var_2 <= var_3) {
    var_3 = var_2;
  }
  while( true ) {
    if (var_4 == 0) {
      return var_3;
    }
    var_6 = (*(type_4 *)PTR_wmemchr_004c5d10)(param_1,*(type_5 *)(var_5 + var_3 * 4),var_4);
    if (var_6 == 0) break;
    var_3 = var_3 - 1;
    if (var_3 == 0xffffffff) {
      return 0xffffffff;
    }
  }
  return var_3;
}


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

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

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

{
  uint uVar1;
  int iVar2;
  int iVar3;
  
  if (*(int *)(this + 4) == 0) {
    return 0xffffffff;
  }
  uVar1 = *(int *)(this + 4) - 1;
  iVar3 = *(int *)this;
  if (uVar1 <= param_2) {
    param_2 = uVar1;
  }
  while( true ) {
    if (param_3 == 0) {
      return param_2;
    }
    iVar2 = (*(code *)PTR_wmemchr_004c5d10)(param_1,*(undefined4 *)(iVar3 + param_2 * 4),param_3);
    if (iVar2 == 0) break;
    param_2 = param_2 - 1;
    if (param_2 == 0xffffffff) {
      return 0xffffffff;
    }
  }
  return param_2;
}

