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

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

{
  uint uVar1;
  
  uVar1 = 0xffffffff;
  if (*(int *)(this + 4) != 0) {
    uVar1 = *(int *)(this + 4) - 1;
    if (param_2 < uVar1) {
      uVar1 = param_2;
    }
    do {
      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {
        return uVar1;
      }
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0xffffffff);
  }
  return uVar1;
}



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

{
  uint uVar1;
  
  uVar1 = 0xffffffff;
  if (param_1[1] != 0) {
    uVar1 = param_1[1] - 1;
    if (param_3 < uVar1) {
      uVar1 = param_3;
    }
    do {
      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {
        return uVar1;
      }
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0xffffffff);
  }
  return uVar1;
}


PUSH ESI
MOV EAX,0xffffffff
PUSH EBX
MOV EBX,dword ptr [ESP + 0xc]
MOV EDX,dword ptr [ESP + 0x10]
MOV ESI,dword ptr [ESP + 0x14]
MOV ECX,dword ptr [EBX + 0x4]
TEST ECX,ECX
JZ 0x001ed475
LEA EAX,[ECX + -0x1]
MOV ECX,dword ptr [EBX]
CMP EAX,ESI
CMOVA EAX,ESI
LEA ESI,[ESI]
CMP dword ptr [ECX + EAX*0x4],EDX
JZ 0x001ed475
SUB EAX,0x1
CMP EAX,-0x1
JNZ 0x001ed468
POP EBX
POP ESI
RET
(translation_unit "uint FUN_001ed440(int *param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}\n\n" (function_definition "uint FUN_001ed440(int *param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" type_identifier (function_declarator "FUN_001ed440(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  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" if (parenthesized_expression "(param_1[1] != 0)" ( (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" { (expression_statement "uVar1 = param_1[1] - 1;" (assignment_expression "uVar1 = param_1[1] - 1" identifier = (binary_expression "param_1[1] - 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - number_literal)) ;) (if_statement "if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }" if (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) (compound_statement "{\n      uVar1 = param_3;\n    }" { (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) })) (do_statement "do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);" do (compound_statement "{\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    }" { (if_statement "if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }" if (parenthesized_expression "(*(int *)(*param_1 + uVar1 * 4) == param_2)" ( (binary_expression "*(int *)(*param_1 + uVar1 * 4) == param_2" (pointer_expression "*(int *)(*param_1 + uVar1 * 4)" * (cast_expression "(int *)(*param_1 + uVar1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar1 * 4)" ( (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) == identifier) )) (compound_statement "{\n        return uVar1;\n      }" { (return_statement "return uVar1;" return identifier ;) })) (expression_statement "uVar1 = uVar1 - 1;" (assignment_expression "uVar1 = uVar1 - 1" identifier = (binary_expression "uVar1 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar1 != 0xffffffff)" ( (binary_expression "uVar1 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "/* std::wstring::rfind(wchar_t, unsigned int) const */\n\nuint __thiscall std::wstring::rfind(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }\n    do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}\n\n" comment (function_definition "uint __thiscall std::wstring::rfind(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }\n    do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "rfind(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  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }\n    do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }\n    do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 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    uVar1 = *(int *)(this + 4) - 1;\n    if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }\n    do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" { (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)) ;) (if_statement "if (param_2 < uVar1) {\n      uVar1 = param_2;\n    }" if (parenthesized_expression "(param_2 < uVar1)" ( (binary_expression "param_2 < uVar1" identifier < identifier) )) (compound_statement "{\n      uVar1 = param_2;\n    }" { (expression_statement "uVar1 = param_2;" (assignment_expression "uVar1 = param_2" identifier = identifier) ;) })) (do_statement "do {\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);" do (compound_statement "{\n      if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    }" { (if_statement "if (*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1) {\n        return uVar1;\n      }" if (parenthesized_expression "(*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1)" ( (binary_expression "*(wchar_t *)(*(int *)this + uVar1 * 4) == param_1" (pointer_expression "*(wchar_t *)(*(int *)this + uVar1 * 4)" * (cast_expression "(wchar_t *)(*(int *)this + uVar1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar1 * 4)" ( (binary_expression "*(int *)this + uVar1 * 4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) == identifier) )) (compound_statement "{\n        return uVar1;\n      }" { (return_statement "return uVar1;" return identifier ;) })) (expression_statement "uVar1 = uVar1 - 1;" (assignment_expression "uVar1 = uVar1 - 1" identifier = (binary_expression "uVar1 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar1 != 0xffffffff)" ( (binary_expression "uVar1 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "uint FUN_001ed440(int *param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}\n\n" (function_definition "uint FUN_001ed440(int *param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" type_identifier (function_declarator "FUN_001ed440(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  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" if (parenthesized_expression "(param_1[1] != 0)" ( (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" { (expression_statement "uVar1 = param_1[1] - 1;" (assignment_expression "uVar1 = param_1[1] - 1" identifier = (binary_expression "param_1[1] - 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) - number_literal)) ;) (if_statement "if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }" if (parenthesized_expression "(param_3 < uVar1)" ( (binary_expression "param_3 < uVar1" identifier < identifier) )) (compound_statement "{\n      uVar1 = param_3;\n    }" { (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" identifier = identifier) ;) })) (do_statement "do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);" do (compound_statement "{\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    }" { (if_statement "if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }" if (parenthesized_expression "(*(int *)(*param_1 + uVar1 * 4) == param_2)" ( (binary_expression "*(int *)(*param_1 + uVar1 * 4) == param_2" (pointer_expression "*(int *)(*param_1 + uVar1 * 4)" * (cast_expression "(int *)(*param_1 + uVar1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar1 * 4)" ( (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) == identifier) )) (compound_statement "{\n        return uVar1;\n      }" { (return_statement "return uVar1;" return identifier ;) })) (expression_statement "uVar1 = uVar1 - 1;" (assignment_expression "uVar1 = uVar1 - 1" identifier = (binary_expression "uVar1 - 1" identifier - number_literal)) ;) }) while (parenthesized_expression "(uVar1 != 0xffffffff)" ( (binary_expression "uVar1 != 0xffffffff" identifier != number_literal) )) ;) })) (return_statement "return uVar1;" 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 ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - 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) + (binary_expression IDENT * LIT)) )))) == 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_001ed440(int *param_1,int param_2,uint param_3)\n\n{\n  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" (type_identifier "uint") (function_declarator "FUN_001ed440(int *param_1,int param_2,uint param_3)" (identifier "FUN_001ed440") (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  uint uVar1;\n  \n  uVar1 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }\n  return uVar1;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" (identifier "uVar1") (= "=") (number_literal "0xffffffff")) (; ";")) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" (if "if") (parenthesized_expression "(param_1[1] != 0)" (( "(") (binary_expression "param_1[1] != 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar1 = param_1[1] - 1;\n    if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }\n    do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);\n  }" ({ "{") (expression_statement "uVar1 = param_1[1] - 1;" (assignment_expression "uVar1 = param_1[1] - 1" (identifier "uVar1") (= "=") (binary_expression "param_1[1] - 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (number_literal "1"))) (; ";")) (if_statement "if (param_3 < uVar1) {\n      uVar1 = param_3;\n    }" (if "if") (parenthesized_expression "(param_3 < uVar1)" (( "(") (binary_expression "param_3 < uVar1" (identifier "param_3") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n      uVar1 = param_3;\n    }" ({ "{") (expression_statement "uVar1 = param_3;" (assignment_expression "uVar1 = param_3" (identifier "uVar1") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (do_statement "do {\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    } while (uVar1 != 0xffffffff);" (do "do") (compound_statement "{\n      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }\n      uVar1 = uVar1 - 1;\n    }" ({ "{") (if_statement "if (*(int *)(*param_1 + uVar1 * 4) == param_2) {\n        return uVar1;\n      }" (if "if") (parenthesized_expression "(*(int *)(*param_1 + uVar1 * 4) == param_2)" (( "(") (binary_expression "*(int *)(*param_1 + uVar1 * 4) == param_2" (pointer_expression "*(int *)(*param_1 + uVar1 * 4)" (* "*") (cast_expression "(int *)(*param_1 + uVar1 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + uVar1 * 4)" (( "(") (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (binary_expression "uVar1 * 4" (identifier "uVar1") (* "*") (number_literal "4"))) () ")")))) (== "==") (identifier "param_2")) () ")")) (compound_statement "{\n        return uVar1;\n      }" ({ "{") (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}"))) (expression_statement "uVar1 = uVar1 - 1;" (assignment_expression "uVar1 = uVar1 - 1" (identifier "uVar1") (= "=") (binary_expression "uVar1 - 1" (identifier "uVar1") (- "-") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar1 != 0xffffffff)" (( "(") (binary_expression "uVar1 != 0xffffffff" (identifier "uVar1") (!= "!=") (number_literal "0xffffffff")) () ")")) (; ";")) (} "}"))) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

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

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

{
  type_1 var_3;
  
  var_3 = 0xffffffff;
  if (*(int *)(var_1 + 4) != 0) {
    var_3 = *(int *)(var_1 + 4) - 1;
    if (var_2 < var_3) {
      var_3 = var_2;
    }
    do {
      if (*(type_3 *)(*(int *)var_1 + var_3 * 4) == 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: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) 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: (binary_expression left: (identifier) right: (number_literal)))))) 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,int param_2,uint param_3)

{
  uint uVar1;
  
  uVar1 = 0xffffffff;
  if (param_1[1] != 0) {
    uVar1 = param_1[1] - 1;
    if (param_3 < uVar1) {
      uVar1 = param_3;
    }
    do {
      if (*(int *)(*param_1 + uVar1 * 4) == param_2) {
        return uVar1;
      }
      uVar1 = uVar1 - 1;
    } while (uVar1 != 0xffffffff);
  }
  return uVar1;
}

