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

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

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  undefined2 in_register_00000014;
  
  iVar1 = *(int *)(*(int *)this + -0xc);
  uVar3 = iVar1 - 1;
  if (iVar1 == 0) {
    return 0xffffffff;
  }
  if (uVar3 <= param_2) {
    param_2 = uVar3;
  }
  piVar2 = (int *)(*(int *)this + param_2 * 4);
  do {
    iVar1 = *piVar2;
    piVar2 = piVar2 + -1;
    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {
      return param_2;
    }
    param_2 = param_2 - 1;
  } while (param_2 != 0xffffffff);
  return 0xffffffff;
}



uint FUN_00356c6c(int *param_1,int param_2,uint param_3)

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  
  iVar1 = *(int *)(*param_1 + -0xc);
  uVar3 = iVar1 - 1;
  if (iVar1 == 0) {
    return 0xffffffff;
  }
  if (uVar3 <= param_3) {
    param_3 = uVar3;
  }
  piVar2 = (int *)(*param_1 + param_3 * 4);
  do {
    iVar1 = *piVar2;
    piVar2 = piVar2 + -1;
    if (iVar1 != param_2) {
      return param_3;
    }
    param_3 = param_3 - 1;
  } while (param_3 != 0xffffffff);
  return 0xffffffff;
}


lw v1,0x0(a0)
lw v0,-0xc(v1)
beq v0,zero,0x00356cb8
_addiu a0,v0,-0x1
li a3,-0x1
sltu v0,a2,a0
movz a2,a0,v0
sll a0,a2,0x2
or v0,a2,zero
b 0x00356ca4
_addu v1,v1,a0
addiu v0,v0,-0x1
beq v0,a3,0x00356cc0
_nop
lw a0,0x0(v1)
beq a0,a1,0x00356c98
_addiu v1,v1,-0x4
jr ra
_nop
jr ra
_li v0,-0x1
jr ra
_nop
(translation_unit "uint FUN_00356c6c(int *param_1,int param_2,uint param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}\n\n" (function_definition "uint FUN_00356c6c(int *param_1,int param_2,uint param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_00356c6c(int *param_1,int param_2,uint param_3)" identifier (parameter_list "(int *param_1,int param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar1 = *(int *)(*param_1 + -0xc)" identifier = (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (expression_statement "uVar3 = iVar1 - 1;" (assignment_expression "uVar3 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (iVar1 == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (if_statement "if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }" if (parenthesized_expression "(uVar3 <= param_3)" ( (binary_expression "uVar3 <= param_3" identifier <= identifier) )) (compound_statement "{\n    param_3 = uVar3;\n  }" { (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" identifier = identifier) ;) })) (expression_statement "piVar2 = (int *)(*param_1 + param_3 * 4);" (assignment_expression "piVar2 = (int *)(*param_1 + param_3 * 4)" identifier = (cast_expression "(int *)(*param_1 + param_3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_3 * 4)" ( (binary_expression "*param_1 + param_3 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "param_3 * 4" identifier * number_literal)) )))) ;) (do_statement "do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);" do (compound_statement "{\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  }" { (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "piVar2 = piVar2 + -1;" (assignment_expression "piVar2 = piVar2 + -1" identifier = (binary_expression "piVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar1 != param_2) {\n      return param_3;\n    }" if (parenthesized_expression "(iVar1 != param_2)" ( (binary_expression "iVar1 != param_2" identifier != identifier) )) (compound_statement "{\n      return param_3;\n    }" { (return_statement "return param_3;" return identifier ;) })) (expression_statement "param_3 = param_3 - 1;" (assignment_expression "param_3 = param_3 - 1" identifier = (binary_expression "param_3 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(param_3 != 0xffffffff)" ( (binary_expression "param_3 != 0xffffffff" identifier != number_literal) )) ;) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit "/* std::wstring::find_last_not_of(wchar_t, unsigned int) const */\n\nuint __thiscall std::wstring::find_last_not_of(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined2 in_register_00000014;\n  \n  iVar1 = *(int *)(*(int *)this + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_2) {\n    param_2 = uVar3;\n  }\n  piVar2 = (int *)(*(int *)this + param_2 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }\n    param_2 = param_2 - 1;\n  } while (param_2 != 0xffffffff);\n  return 0xffffffff;\n}\n\n" comment (function_definition "uint __thiscall std::wstring::find_last_not_of(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined2 in_register_00000014;\n  \n  iVar1 = *(int *)(*(int *)this + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_2) {\n    param_2 = uVar3;\n  }\n  piVar2 = (int *)(*(int *)this + param_2 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }\n    param_2 = param_2 - 1;\n  } while (param_2 != 0xffffffff);\n  return 0xffffffff;\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)" identifier (parameter_list "(wstring *this,wchar_t param_1,uint param_2)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  undefined2 in_register_00000014;\n  \n  iVar1 = *(int *)(*(int *)this + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_2) {\n    param_2 = uVar3;\n  }\n  piVar2 = (int *)(*(int *)this + param_2 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }\n    param_2 = param_2 - 1;\n  } while (param_2 != 0xffffffff);\n  return 0xffffffff;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined2 in_register_00000014;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(*(int *)this + -0xc);" (assignment_expression "iVar1 = *(int *)(*(int *)this + -0xc)" identifier = (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (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) ))))) ;) (expression_statement "uVar3 = iVar1 - 1;" (assignment_expression "uVar3 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (iVar1 == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (if_statement "if (uVar3 <= param_2) {\n    param_2 = uVar3;\n  }" if (parenthesized_expression "(uVar3 <= param_2)" ( (binary_expression "uVar3 <= param_2" identifier <= identifier) )) (compound_statement "{\n    param_2 = uVar3;\n  }" { (expression_statement "param_2 = uVar3;" (assignment_expression "param_2 = uVar3" identifier = identifier) ;) })) (expression_statement "piVar2 = (int *)(*(int *)this + param_2 * 4);" (assignment_expression "piVar2 = (int *)(*(int *)this + param_2 * 4)" identifier = (cast_expression "(int *)(*(int *)this + param_2 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + param_2 * 4)" ( (binary_expression "*(int *)this + param_2 * 4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (binary_expression "param_2 * 4" identifier * number_literal)) )))) ;) (do_statement "do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }\n    param_2 = param_2 - 1;\n  } while (param_2 != 0xffffffff);" do (compound_statement "{\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }\n    param_2 = param_2 - 1;\n  }" { (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "piVar2 = piVar2 + -1;" (assignment_expression "piVar2 = piVar2 + -1" identifier = (binary_expression "piVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar1 != CONCAT22(in_register_00000014,param_1)) {\n      return param_2;\n    }" if (parenthesized_expression "(iVar1 != CONCAT22(in_register_00000014,param_1))" ( (binary_expression "iVar1 != CONCAT22(in_register_00000014,param_1)" identifier != (call_expression "CONCAT22(in_register_00000014,param_1)" identifier (argument_list "(in_register_00000014,param_1)" ( identifier , identifier )))) )) (compound_statement "{\n      return param_2;\n    }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "param_2 = param_2 - 1;" (assignment_expression "param_2 = param_2 - 1" identifier = (binary_expression "param_2 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(param_2 != 0xffffffff)" ( (binary_expression "param_2 != 0xffffffff" identifier != number_literal) )) ;) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit "uint FUN_00356c6c(int *param_1,int param_2,uint param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}\n\n" (function_definition "uint FUN_00356c6c(int *param_1,int param_2,uint param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_00356c6c(int *param_1,int param_2,uint param_3)" identifier (parameter_list "(int *param_1,int param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar1 = *(int *)(*param_1 + -0xc)" identifier = (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (expression_statement "uVar3 = iVar1 - 1;" (assignment_expression "uVar3 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (iVar1 == 0) {\n    return 0xffffffff;\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    return 0xffffffff;\n  }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (if_statement "if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }" if (parenthesized_expression "(uVar3 <= param_3)" ( (binary_expression "uVar3 <= param_3" identifier <= identifier) )) (compound_statement "{\n    param_3 = uVar3;\n  }" { (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" identifier = identifier) ;) })) (expression_statement "piVar2 = (int *)(*param_1 + param_3 * 4);" (assignment_expression "piVar2 = (int *)(*param_1 + param_3 * 4)" identifier = (cast_expression "(int *)(*param_1 + param_3 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + param_3 * 4)" ( (binary_expression "*param_1 + param_3 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "param_3 * 4" identifier * number_literal)) )))) ;) (do_statement "do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);" do (compound_statement "{\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  }" { (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" identifier = (pointer_expression "*piVar2" * identifier)) ;) (expression_statement "piVar2 = piVar2 + -1;" (assignment_expression "piVar2 = piVar2 + -1" identifier = (binary_expression "piVar2 + -1" identifier + number_literal)) ;) (if_statement "if (iVar1 != param_2) {\n      return param_3;\n    }" if (parenthesized_expression "(iVar1 != param_2)" ( (binary_expression "iVar1 != param_2" identifier != identifier) )) (compound_statement "{\n      return param_3;\n    }" { (return_statement "return param_3;" return identifier ;) })) (expression_statement "param_3 = param_3 - 1;" (assignment_expression "param_3 = param_3 - 1" identifier = (binary_expression "param_3 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(param_3 != 0xffffffff)" ( (binary_expression "param_3 != 0xffffffff" identifier != number_literal) )) ;) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * 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) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (binary_expression IDENT * LIT)) )))) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) (return_statement return LIT ;) })))
(function_definition "uint FUN_00356c6c(int *param_1,int param_2,uint param_3)\n\n{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" (type_identifier "uint") (function_declarator "FUN_00356c6c(int *param_1,int param_2,uint param_3)" (identifier "FUN_00356c6c") (parameter_list "(int *param_1,int param_2,uint param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  uint uVar3;\n  \n  iVar1 = *(int *)(*param_1 + -0xc);\n  uVar3 = iVar1 - 1;\n  if (iVar1 == 0) {\n    return 0xffffffff;\n  }\n  if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }\n  piVar2 = (int *)(*param_1 + param_3 * 4);\n  do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);\n  return 0xffffffff;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (expression_statement "iVar1 = *(int *)(*param_1 + -0xc);" (assignment_expression "iVar1 = *(int *)(*param_1 + -0xc)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (expression_statement "uVar3 = iVar1 - 1;" (assignment_expression "uVar3 = iVar1 - 1" (identifier "uVar3") (= "=") (binary_expression "iVar1 - 1" (identifier "iVar1") (- "-") (number_literal "1"))) (; ";")) (if_statement "if (iVar1 == 0) {\n    return 0xffffffff;\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    return 0xffffffff;\n  }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (if_statement "if (uVar3 <= param_3) {\n    param_3 = uVar3;\n  }" (if "if") (parenthesized_expression "(uVar3 <= param_3)" (( "(") (binary_expression "uVar3 <= param_3" (identifier "uVar3") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n    param_3 = uVar3;\n  }" ({ "{") (expression_statement "param_3 = uVar3;" (assignment_expression "param_3 = uVar3" (identifier "param_3") (= "=") (identifier "uVar3")) (; ";")) (} "}"))) (expression_statement "piVar2 = (int *)(*param_1 + param_3 * 4);" (assignment_expression "piVar2 = (int *)(*param_1 + param_3 * 4)" (identifier "piVar2") (= "=") (cast_expression "(int *)(*param_1 + param_3 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + param_3 * 4)" (( "(") (binary_expression "*param_1 + param_3 * 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4"))) () ")")))) (; ";")) (do_statement "do {\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  } while (param_3 != 0xffffffff);" (do "do") (compound_statement "{\n    iVar1 = *piVar2;\n    piVar2 = piVar2 + -1;\n    if (iVar1 != param_2) {\n      return param_3;\n    }\n    param_3 = param_3 - 1;\n  }" ({ "{") (expression_statement "iVar1 = *piVar2;" (assignment_expression "iVar1 = *piVar2" (identifier "iVar1") (= "=") (pointer_expression "*piVar2" (* "*") (identifier "piVar2"))) (; ";")) (expression_statement "piVar2 = piVar2 + -1;" (assignment_expression "piVar2 = piVar2 + -1" (identifier "piVar2") (= "=") (binary_expression "piVar2 + -1" (identifier "piVar2") (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (iVar1 != param_2) {\n      return param_3;\n    }" (if "if") (parenthesized_expression "(iVar1 != param_2)" (( "(") (binary_expression "iVar1 != param_2" (identifier "iVar1") (!= "!=") (identifier "param_2")) () ")")) (compound_statement "{\n      return param_3;\n    }" ({ "{") (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}"))) (expression_statement "param_3 = param_3 - 1;" (assignment_expression "param_3 = param_3 - 1" (identifier "param_3") (= "=") (binary_expression "param_3 - 1" (identifier "param_3") (- "-") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_3 != 0xffffffff)" (( "(") (binary_expression "param_3 != 0xffffffff" (identifier "param_3") (!= "!=") (number_literal "0xffffffff")) () ")")) (; ";")) (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}")))

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

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

{
  int var_1;
  int *var_4;
  type_1 var_2;
  type_4 in_register_00000014;
  
  var_1 = *(int *)(*(int *)this + -0xc);
  var_2 = var_1 - 1;
  if (var_1 == 0) {
    return 0xffffffff;
  }
  if (var_2 <= var_3) {
    var_3 = var_2;
  }
  var_4 = (int *)(*(int *)this + var_3 * 4);
  do {
    var_1 = *var_4;
    var_4 = var_4 + -1;
    if (var_1 != var_5(in_register_00000014,param_1)) {
      return var_3;
    }
    var_3 = var_3 - 1;
  } while (var_3 != 0xffffffff);
  return 0xffffffff;
}


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

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

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  
  iVar1 = *(int *)(*param_1 + -0xc);
  uVar3 = iVar1 - 1;
  if (iVar1 == 0) {
    return 0xffffffff;
  }
  if (uVar3 <= param_3) {
    param_3 = uVar3;
  }
  piVar2 = (int *)(*param_1 + param_3 * 4);
  do {
    iVar1 = *piVar2;
    piVar2 = piVar2 + -1;
    if (iVar1 != param_2) {
      return param_3;
    }
    param_3 = param_3 - 1;
  } while (param_3 != 0xffffffff);
  return 0xffffffff;
}

