
/* std::wstring::find(wchar_t, unsigned long) const */

long __thiscall std::wstring::find(wstring *this,wchar_t param_1,ulong param_2)

{
  long lVar1;
  wchar_t *pwVar2;
  long lVar3;
  
  lVar1 = *(long *)this;
  lVar3 = -1;
  if (param_2 < *(ulong *)(lVar1 + -0x18)) {
    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);
    if (pwVar2 != (wchar_t *)0x0) {
      lVar3 = (long)pwVar2 - lVar1 >> 2;
    }
  }
  return lVar3;
}



long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)

{
  long lVar1;
  wchar_t *pwVar2;
  long lVar3;
  
  lVar1 = *param_1;
  lVar3 = -1;
  if (param_3 < *(ulong *)(lVar1 + -0x18)) {
    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);
    if (pwVar2 != (wchar_t *)0x0) {
      lVar3 = (long)pwVar2 - lVar1 >> 2;
    }
  }
  return lVar3;
}


PUSH RBP
PUSH RBX
MOV RBX,-0x1
SUB RSP,0x8
MOV RBP,qword ptr [RDI]
MOV RCX,qword ptr [RBP + -0x18]
CMP RDX,RCX
JNC 0x0035519d
MOV RAX,RDX
SUB RCX,RDX
MOV RDX,RCX
LEA RDI,[RBP + RAX*0x4]
CALL 0x001474d0
MOV RDX,RAX
SUB RDX,RBP
SAR RDX,0x2
TEST RAX,RAX
CMOVNZ RBX,RDX
ADD RSP,0x8
MOV RAX,RBX
POP RBX
POP RBP
RET
(translation_unit "long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)" identifier (parameter_list "(long *param_1,wchar_t param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = *param_1;" (assignment_expression "lVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_3 < *(ulong *)(lVar1 + -0x18))" ( (binary_expression "param_3 < *(ulong *)(lVar1 + -0x18)" identifier < (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) ))))) )) (compound_statement "{\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" { (expression_statement "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier = (call_expression "wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier (argument_list "((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" ( (cast_expression "(wchar_t *)(lVar1 + param_3 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + param_3 * 4)" ( (binary_expression "lVar1 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "*(ulong *)(lVar1 + -0x18) - param_3" (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) )))) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" if (parenthesized_expression "(pwVar2 != (wchar_t *)0x0)" ( (binary_expression "pwVar2 != (wchar_t *)0x0" identifier != (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" { (expression_statement "lVar3 = (long)pwVar2 - lVar1 >> 2;" (assignment_expression "lVar3 = (long)pwVar2 - lVar1 >> 2" identifier = (binary_expression "(long)pwVar2 - lVar1 >> 2" (binary_expression "(long)pwVar2 - lVar1" (cast_expression "(long)pwVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "/* std::wstring::find(wchar_t, unsigned long) const */\n\nlong __thiscall std::wstring::find(wstring *this,wchar_t param_1,ulong param_2)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}\n\n" comment (function_definition "long __thiscall std::wstring::find(wstring *this,wchar_t param_1,ulong param_2)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find(wstring *this,wchar_t param_1,ulong param_2)" identifier (parameter_list "(wstring *this,wchar_t param_1,ulong param_2)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t param_1" type_identifier identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = *(long *)this;" (assignment_expression "lVar1 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_2 < *(ulong *)(lVar1 + -0x18))" ( (binary_expression "param_2 < *(ulong *)(lVar1 + -0x18)" identifier < (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) ))))) )) (compound_statement "{\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" { (expression_statement "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2)" identifier = (call_expression "wmemchr((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2)" identifier (argument_list "((wchar_t *)(lVar1 + param_2 * 4),param_1,*(ulong *)(lVar1 + -0x18) - param_2)" ( (cast_expression "(wchar_t *)(lVar1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + param_2 * 4)" ( (binary_expression "lVar1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "*(ulong *)(lVar1 + -0x18) - param_2" (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) )))) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" if (parenthesized_expression "(pwVar2 != (wchar_t *)0x0)" ( (binary_expression "pwVar2 != (wchar_t *)0x0" identifier != (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" { (expression_statement "lVar3 = (long)pwVar2 - lVar1 >> 2;" (assignment_expression "lVar3 = (long)pwVar2 - lVar1 >> 2" identifier = (binary_expression "(long)pwVar2 - lVar1 >> 2" (binary_expression "(long)pwVar2 - lVar1" (cast_expression "(long)pwVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)" identifier (parameter_list "(long *param_1,wchar_t param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = *param_1;" (assignment_expression "lVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_3 < *(ulong *)(lVar1 + -0x18))" ( (binary_expression "param_3 < *(ulong *)(lVar1 + -0x18)" identifier < (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) ))))) )) (compound_statement "{\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" { (expression_statement "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier = (call_expression "wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier (argument_list "((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" ( (cast_expression "(wchar_t *)(lVar1 + param_3 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + param_3 * 4)" ( (binary_expression "lVar1 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "*(ulong *)(lVar1 + -0x18) - param_3" (pointer_expression "*(ulong *)(lVar1 + -0x18)" * (cast_expression "(ulong *)(lVar1 + -0x18)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + -0x18)" ( (binary_expression "lVar1 + -0x18" identifier + number_literal) )))) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" if (parenthesized_expression "(pwVar2 != (wchar_t *)0x0)" ( (binary_expression "pwVar2 != (wchar_t *)0x0" identifier != (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" { (expression_statement "lVar3 = (long)pwVar2 - lVar1 >> 2;" (assignment_expression "lVar3 = (long)pwVar2 - lVar1 >> 2" identifier = (binary_expression "(long)pwVar2 - lVar1 >> 2" (binary_expression "(long)pwVar2 - lVar1" (cast_expression "(long)pwVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) ))) , IDENT , (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) - IDENT) >> LIT)) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "long FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_00355160(long *param_1,wchar_t param_2,ulong param_3)" (identifier "FUN_00355160") (parameter_list "(long *param_1,wchar_t param_2,ulong param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "wchar_t param_2" (type_identifier "wchar_t") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) () ")"))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }\n  return lVar3;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "wchar_t *pwVar2;" (type_identifier "wchar_t") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (expression_statement "lVar1 = *param_1;" (assignment_expression "lVar1 = *param_1" (identifier "lVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "lVar3 = -1;" (assignment_expression "lVar3 = -1" (identifier "lVar3") (= "=") (number_literal "-1")) (; ";")) (if_statement "if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 < *(ulong *)(lVar1 + -0x18))" (( "(") (binary_expression "param_3 < *(ulong *)(lVar1 + -0x18)" (identifier "param_3") (< "<") (pointer_expression "*(ulong *)(lVar1 + -0x18)" (* "*") (cast_expression "(ulong *)(lVar1 + -0x18)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar1 + -0x18)" (( "(") (binary_expression "lVar1 + -0x18" (identifier "lVar1") (+ "+") (number_literal "-0x18")) () ")"))))) () ")")) (compound_statement "{\n    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }\n  }" ({ "{") (expression_statement "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (identifier "pwVar2") (= "=") (call_expression "wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (identifier "wmemchr") (argument_list "((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (( "(") (cast_expression "(wchar_t *)(lVar1 + param_3 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar1 + param_3 * 4)" (( "(") (binary_expression "lVar1 + param_3 * 4" (identifier "lVar1") (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4"))) () ")"))) (, ",") (identifier "param_2") (, ",") (binary_expression "*(ulong *)(lVar1 + -0x18) - param_3" (pointer_expression "*(ulong *)(lVar1 + -0x18)" (* "*") (cast_expression "(ulong *)(lVar1 + -0x18)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar1 + -0x18)" (( "(") (binary_expression "lVar1 + -0x18" (identifier "lVar1") (+ "+") (number_literal "-0x18")) () ")")))) (- "-") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" (if "if") (parenthesized_expression "(pwVar2 != (wchar_t *)0x0)" (( "(") (binary_expression "pwVar2 != (wchar_t *)0x0" (identifier "pwVar2") (!= "!=") (cast_expression "(wchar_t *)0x0" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      lVar3 = (long)pwVar2 - lVar1 >> 2;\n    }" ({ "{") (expression_statement "lVar3 = (long)pwVar2 - lVar1 >> 2;" (assignment_expression "lVar3 = (long)pwVar2 - lVar1 >> 2" (identifier "lVar3") (= "=") (binary_expression "(long)pwVar2 - lVar1 >> 2" (binary_expression "(long)pwVar2 - lVar1" (cast_expression "(long)pwVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "pwVar2")) (- "-") (identifier "lVar1")) (>> ">>") (number_literal "2"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}")))

/* std::wstring::find(wchar_t, unsigned long) const */

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

{
  long var_2;
  type_2 *var_4;
  long lVar3;
  
  var_2 = *(long *)this;
  lVar3 = -1;
  if (var_1 < *(type_3 *)(var_2 + -0x18)) {
    var_4 = var_3((type_2 *)(var_2 + var_1 * 4),param_1,*(type_3 *)(var_2 + -0x18) - var_1);
    if (var_4 != (type_2 *)0x0) {
      lVar3 = (long)var_4 - var_2 >> 2;
    }
  }
  return lVar3;
}


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

long MASKED(long *param_1,wchar_t param_2,ulong param_3)

{
  long lVar1;
  wchar_t *pwVar2;
  long lVar3;
  
  lVar1 = *param_1;
  lVar3 = -1;
  if (param_3 < *(ulong *)(lVar1 + -0x18)) {
    pwVar2 = wmemchr((wchar_t *)(lVar1 + param_3 * 4),param_2,*(ulong *)(lVar1 + -0x18) - param_3);
    if (pwVar2 != (wchar_t *)0x0) {
      lVar3 = (long)pwVar2 - lVar1 >> 2;
    }
  }
  return lVar3;
}

