
/* std::string::find_last_not_of(char, unsigned int) const */

uint __thiscall std::string::find_last_not_of(string *this,char param_1,uint param_2)

{
  int iVar1;
  uint uVar2;
  
  uVar2 = 0xffffffff;
  iVar1 = *(int *)(*(int *)this + -0xc);
  if (iVar1 != 0) {
    uVar2 = iVar1 - 1;
    if (param_2 < uVar2) {
      uVar2 = param_2;
    }
    do {
      if (*(char *)(*(int *)this + uVar2) != param_1) {
        return uVar2;
      }
      uVar2 = uVar2 - 1;
    } while (uVar2 != 0xffffffff);
  }
  return uVar2;
}



uint FUN_003e5670(int *param_1,char param_2,uint param_3)

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


PUSH ESI
PUSH EBX
MOV EAX,dword ptr [ESP + 0xc]
MOV ESI,dword ptr [ESP + 0x14]
MOVZX ECX,byte ptr [ESP + 0x10]
MOV EDX,dword ptr [EAX]
MOV EAX,0xffffffff
MOV EBX,dword ptr [EDX + -0xc]
TEST EBX,EBX
JZ 0x003e56ad
LEA EAX,[EBX + -0x1]
CMP EAX,ESI
CMOVA EAX,ESI
JMP 0x003e56a8
SUB EAX,0x1
CMP EAX,-0x1
JZ 0x003e56ad
CMP byte ptr [EDX + EAX*0x1],CL
JZ 0x003e56a0
POP EBX
POP ESI
RET
(translation_unit "uint FUN_003e5670(int *param_1,char param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_003e5670(int *param_1,char param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_003e5670(int *param_1,char param_2,uint param_3)" identifier (parameter_list "(int *param_1,char param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) (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) ))))) ;) (if_statement "if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" { (expression_statement "uVar2 = iVar1 - 1;" (assignment_expression "uVar2 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }" if (parenthesized_expression "(param_3 < uVar2)" ( (binary_expression "param_3 < uVar2" identifier < identifier) )) (compound_statement "{\n      uVar2 = param_3;\n    }" { (expression_statement "uVar2 = param_3;" (assignment_expression "uVar2 = param_3" identifier = identifier) ;) })) (do_statement "do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);" do (compound_statement "{\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    }" { (if_statement "if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }" if (parenthesized_expression "(*(char *)(*param_1 + uVar2) != param_2)" ( (binary_expression "*(char *)(*param_1 + uVar2) != param_2" (pointer_expression "*(char *)(*param_1 + uVar2)" * (cast_expression "(char *)(*param_1 + uVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar2)" ( (binary_expression "*param_1 + uVar2" (pointer_expression "*param_1" * identifier) + identifier) )))) != identifier) )) (compound_statement "{\n        return uVar2;\n      }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar2 != 0xffffffff)" ( (binary_expression "uVar2 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "/* std::string::find_last_not_of(char, unsigned int) const */\n\nuint __thiscall std::string::find_last_not_of(string *this,char param_1,uint param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*(int *)this + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }\n    do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}\n\n" comment (function_definition "uint __thiscall std::string::find_last_not_of(string *this,char param_1,uint param_2)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*(int *)this + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }\n    do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "find_last_not_of(string *this,char param_1,uint param_2)" identifier (parameter_list "(string *this,char param_1,uint param_2)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*(int *)this + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }\n    do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) (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) ))))) ;) (if_statement "if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }\n    do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar2 = iVar1 - 1;\n    if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }\n    do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" { (expression_statement "uVar2 = iVar1 - 1;" (assignment_expression "uVar2 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (param_2 < uVar2) {\n      uVar2 = param_2;\n    }" if (parenthesized_expression "(param_2 < uVar2)" ( (binary_expression "param_2 < uVar2" identifier < identifier) )) (compound_statement "{\n      uVar2 = param_2;\n    }" { (expression_statement "uVar2 = param_2;" (assignment_expression "uVar2 = param_2" identifier = identifier) ;) })) (do_statement "do {\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);" do (compound_statement "{\n      if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    }" { (if_statement "if (*(char *)(*(int *)this + uVar2) != param_1) {\n        return uVar2;\n      }" if (parenthesized_expression "(*(char *)(*(int *)this + uVar2) != param_1)" ( (binary_expression "*(char *)(*(int *)this + uVar2) != param_1" (pointer_expression "*(char *)(*(int *)this + uVar2)" * (cast_expression "(char *)(*(int *)this + uVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar2)" ( (binary_expression "*(int *)this + uVar2" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + identifier) )))) != identifier) )) (compound_statement "{\n        return uVar2;\n      }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar2 != 0xffffffff)" ( (binary_expression "uVar2 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "uint FUN_003e5670(int *param_1,char param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_003e5670(int *param_1,char param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_003e5670(int *param_1,char param_2,uint param_3)" identifier (parameter_list "(int *param_1,char param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" identifier = number_literal) ;) (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) ))))) ;) (if_statement "if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" { (expression_statement "uVar2 = iVar1 - 1;" (assignment_expression "uVar2 = iVar1 - 1" identifier = (binary_expression "iVar1 - 1" identifier - number_literal)) ;) (if_statement "if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }" if (parenthesized_expression "(param_3 < uVar2)" ( (binary_expression "param_3 < uVar2" identifier < identifier) )) (compound_statement "{\n      uVar2 = param_3;\n    }" { (expression_statement "uVar2 = param_3;" (assignment_expression "uVar2 = param_3" identifier = identifier) ;) })) (do_statement "do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);" do (compound_statement "{\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    }" { (if_statement "if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }" if (parenthesized_expression "(*(char *)(*param_1 + uVar2) != param_2)" ( (binary_expression "*(char *)(*param_1 + uVar2) != param_2" (pointer_expression "*(char *)(*param_1 + uVar2)" * (cast_expression "(char *)(*param_1 + uVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar2)" ( (binary_expression "*param_1 + uVar2" (pointer_expression "*param_1" * identifier) + identifier) )))) != identifier) )) (compound_statement "{\n        return uVar2;\n      }" { (return_statement "return uVar2;" return identifier ;) })) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar2 != 0xffffffff)" ( (binary_expression "uVar2 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar2;" return 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) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (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 != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + 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 IDENT ;) })))
(function_definition "uint FUN_003e5670(int *param_1,char param_2,uint param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" (type_identifier "uint") (function_declarator "FUN_003e5670(int *param_1,char param_2,uint param_3)" (identifier "FUN_003e5670") (parameter_list "(int *param_1,char param_2,uint param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char param_2" (primitive_type "char") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  \n  uVar2 = 0xffffffff;\n  iVar1 = *(int *)(*param_1 + -0xc);\n  if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (expression_statement "uVar2 = 0xffffffff;" (assignment_expression "uVar2 = 0xffffffff" (identifier "uVar2") (= "=") (number_literal "0xffffffff")) (; ";")) (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")) () ")"))))) (; ";")) (if_statement "if (iVar1 != 0) {\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar2 = iVar1 - 1;\n    if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }\n    do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);\n  }" ({ "{") (expression_statement "uVar2 = iVar1 - 1;" (assignment_expression "uVar2 = iVar1 - 1" (identifier "uVar2") (= "=") (binary_expression "iVar1 - 1" (identifier "iVar1") (- "-") (number_literal "1"))) (; ";")) (if_statement "if (param_3 < uVar2) {\n      uVar2 = param_3;\n    }" (if "if") (parenthesized_expression "(param_3 < uVar2)" (( "(") (binary_expression "param_3 < uVar2" (identifier "param_3") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n      uVar2 = param_3;\n    }" ({ "{") (expression_statement "uVar2 = param_3;" (assignment_expression "uVar2 = param_3" (identifier "uVar2") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (do_statement "do {\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    } while (uVar2 != 0xffffffff);" (do "do") (compound_statement "{\n      if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }\n      uVar2 = uVar2 - 1;\n    }" ({ "{") (if_statement "if (*(char *)(*param_1 + uVar2) != param_2) {\n        return uVar2;\n      }" (if "if") (parenthesized_expression "(*(char *)(*param_1 + uVar2) != param_2)" (( "(") (binary_expression "*(char *)(*param_1 + uVar2) != param_2" (pointer_expression "*(char *)(*param_1 + uVar2)" (* "*") (cast_expression "(char *)(*param_1 + uVar2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + uVar2)" (( "(") (binary_expression "*param_1 + uVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (identifier "uVar2")) () ")")))) (!= "!=") (identifier "param_2")) () ")")) (compound_statement "{\n        return uVar2;\n      }" ({ "{") (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" (identifier "uVar2") (= "=") (binary_expression "uVar2 - 1" (identifier "uVar2") (- "-") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar2 != 0xffffffff)" (( "(") (binary_expression "uVar2 != 0xffffffff" (identifier "uVar2") (!= "!=") (number_literal "0xffffffff")) () ")")) (; ";")) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

/* std::string::find_last_not_of(char, unsigned int) const */

type_1 __thiscall std::type_2::function_1(type_2 *this,char var_4,type_1 var_2)

{
  int var_1;
  type_1 var_3;
  
  var_3 = 0xffffffff;
  var_1 = *(int *)(*(int *)this + -0xc);
  if (var_1 != 0) {
    var_3 = var_1 - 1;
    if (var_2 < var_3) {
      var_3 = var_2;
    }
    do {
      if (*(char *)(*(int *)this + var_3) != var_4) {
        return var_3;
      }
      var_3 = var_3 - 1;
    } while (var_3 != 0xffffffff);
  }
  return var_3;
}


(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: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) 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: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_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: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (do_statement body: (compound_statement (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: (pointer_expression argument: (identifier)) right: (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 (identifier)))))

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

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

