
/* std::string::find(char, unsigned long) const */

long __thiscall std::string::find(string *this,char param_1,ulong param_2)

{
  long lVar1;
  void *pvVar2;
  long lVar3;
  
  lVar1 = *(long *)this;
  lVar3 = -1;
  if (param_2 < *(ulong *)(lVar1 + -0x18)) {
    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);
    if (pvVar2 != (void *)0x0) {
      lVar3 = (long)pvVar2 - lVar1;
    }
  }
  return lVar3;
}



long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)

{
  long lVar1;
  void *pvVar2;
  long lVar3;
  
  lVar1 = *param_1;
  lVar3 = -1;
  if (param_3 < *(ulong *)(lVar1 + -0x18)) {
    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);
    if (pvVar2 != (void *)0x0) {
      lVar3 = (long)pvVar2 - lVar1;
    }
  }
  return lVar3;
}


PUSH RBP
PUSH RBX
MOV RBX,-0x1
SUB RSP,0x8
MOV RBP,qword ptr [RDI]
MOV RAX,qword ptr [RBP + -0x18]
CMP RDX,RAX
JNC 0x0030cfeb
SUB RAX,RDX
MOV RDI,RDX
MOVSX ESI,SIL
MOV RDX,RAX
ADD RDI,RBP
CALL 0x001471b0
MOV RDX,RAX
SUB RDX,RBP
TEST RAX,RAX
CMOVNZ RBX,RDX
ADD RSP,0x8
MOV RAX,RBX
POP RBX
POP RBP
RET
(translation_unit "long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0030cfb0(long *param_1,char param_2,ulong param_3)" identifier (parameter_list "(long *param_1,char param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * 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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }" { (expression_statement "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier = (call_expression "memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier (argument_list "((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" ( (cast_expression "(void *)(param_3 + lVar1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + lVar1)" ( (binary_expression "param_3 + lVar1" identifier + identifier) ))) , (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }" if (parenthesized_expression "(pvVar2 != (void *)0x0)" ( (binary_expression "pvVar2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pvVar2 - lVar1;\n    }" { (expression_statement "lVar3 = (long)pvVar2 - lVar1;" (assignment_expression "lVar3 = (long)pvVar2 - lVar1" identifier = (binary_expression "(long)pvVar2 - lVar1" (cast_expression "(long)pvVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier)) ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "/* std::string::find(char, unsigned long) const */\n\nlong __thiscall std::string::find(string *this,char param_1,ulong param_2)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}\n\n" comment (function_definition "long __thiscall std::string::find(string *this,char param_1,ulong param_2)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "find(string *this,char param_1,ulong param_2)" identifier (parameter_list "(string *this,char param_1,ulong param_2)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char param_1" primitive_type identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *(long *)this;\n  lVar3 = -1;\n  if (param_2 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * 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    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\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    pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }" { (expression_statement "pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2);" (assignment_expression "pvVar2 = memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2)" identifier = (call_expression "memchr((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2)" identifier (argument_list "((void *)(param_2 + lVar1),(int)param_1,*(ulong *)(lVar1 + -0x18) - param_2)" ( (cast_expression "(void *)(param_2 + lVar1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + lVar1)" ( (binary_expression "param_2 + lVar1" identifier + identifier) ))) , (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) 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 (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }" if (parenthesized_expression "(pvVar2 != (void *)0x0)" ( (binary_expression "pvVar2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pvVar2 - lVar1;\n    }" { (expression_statement "lVar3 = (long)pvVar2 - lVar1;" (assignment_expression "lVar3 = (long)pvVar2 - lVar1" identifier = (binary_expression "(long)pvVar2 - lVar1" (cast_expression "(long)pvVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier)) ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_0030cfb0(long *param_1,char param_2,ulong param_3)" identifier (parameter_list "(long *param_1,char param_2,ulong param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "void *pvVar2;" primitive_type (pointer_declarator "*pvVar2" * 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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }" { (expression_statement "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier = (call_expression "memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" identifier (argument_list "((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" ( (cast_expression "(void *)(param_3 + lVar1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + lVar1)" ( (binary_expression "param_3 + lVar1" identifier + identifier) ))) , (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }" if (parenthesized_expression "(pvVar2 != (void *)0x0)" ( (binary_expression "pvVar2 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      lVar3 = (long)pvVar2 - lVar1;\n    }" { (expression_statement "lVar3 = (long)pvVar2 - lVar1;" (assignment_expression "lVar3 = (long)pvVar2 - lVar1" identifier = (binary_expression "(long)pvVar2 - lVar1" (cast_expression "(long)pvVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - identifier)) ;) })) })) (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 + IDENT) ))) , (cast_expression ( (type_descriptor TYPE) ) 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 (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) - IDENT)) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "long FUN_0030cfb0(long *param_1,char param_2,ulong param_3)\n\n{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_0030cfb0(long *param_1,char param_2,ulong param_3)" (identifier "FUN_0030cfb0") (parameter_list "(long *param_1,char 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 "char param_2" (primitive_type "char") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) () ")"))) (compound_statement "{\n  long lVar1;\n  void *pvVar2;\n  long lVar3;\n  \n  lVar1 = *param_1;\n  lVar3 = -1;\n  if (param_3 < *(ulong *)(lVar1 + -0x18)) {\n    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }\n  return lVar3;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "void *pvVar2;" (primitive_type "void") (pointer_declarator "*pvVar2" (* "*") (identifier "pvVar2")) (; ";")) (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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\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    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);\n    if (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }\n  }" ({ "{") (expression_statement "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);" (assignment_expression "pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (identifier "pvVar2") (= "=") (call_expression "memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (identifier "memchr") (argument_list "((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3)" (( "(") (cast_expression "(void *)(param_3 + lVar1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + lVar1)" (( "(") (binary_expression "param_3 + lVar1" (identifier "param_3") (+ "+") (identifier "lVar1")) () ")"))) (, ",") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (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 (pvVar2 != (void *)0x0) {\n      lVar3 = (long)pvVar2 - lVar1;\n    }" (if "if") (parenthesized_expression "(pvVar2 != (void *)0x0)" (( "(") (binary_expression "pvVar2 != (void *)0x0" (identifier "pvVar2") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      lVar3 = (long)pvVar2 - lVar1;\n    }" ({ "{") (expression_statement "lVar3 = (long)pvVar2 - lVar1;" (assignment_expression "lVar3 = (long)pvVar2 - lVar1" (identifier "lVar3") (= "=") (binary_expression "(long)pvVar2 - lVar1" (cast_expression "(long)pvVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "pvVar2")) (- "-") (identifier "lVar1"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}")))

/* std::string::find(char, unsigned long) const */

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

{
  long var_2;
  void *var_4;
  long lVar3;
  
  var_2 = *(long *)this;
  lVar3 = -1;
  if (var_1 < *(type_2 *)(var_2 + -0x18)) {
    var_4 = var_3((void *)(var_1 + var_2),(int)param_1,*(type_2 *)(var_2 + -0x18) - var_1);
    if (var_4 != (void *)0x0) {
      lVar3 = (long)var_4 - var_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: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) 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: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)))))))) (return_statement (identifier)))))

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

{
  long lVar1;
  void *pvVar2;
  long lVar3;
  
  lVar1 = *param_1;
  lVar3 = -1;
  if (param_3 < *(ulong *)(lVar1 + -0x18)) {
    pvVar2 = memchr((void *)(param_3 + lVar1),(int)param_2,*(ulong *)(lVar1 + -0x18) - param_3);
    if (pvVar2 != (void *)0x0) {
      lVar3 = (long)pvVar2 - lVar1;
    }
  }
  return lVar3;
}

