
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::find(wchar_t, unsigned int) const */

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

{
  int iVar1;
  wchar_t *pwVar2;
  int iVar3;
  
  iVar3 = -1;
  if (param_2 < *(uint *)(this + 4)) {
    iVar1 = *(int *)this;
    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);
    if (pwVar2 != (wchar_t *)0x0) {
      iVar3 = (int)pwVar2 - iVar1 >> 2;
    }
  }
  return iVar3;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

int FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)

{
  int iVar1;
  wchar_t *pwVar2;
  int iVar3;
  
  iVar3 = -1;
  if (param_3 < (uint)param_1[1]) {
    iVar1 = *param_1;
    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);
    if (pwVar2 != (wchar_t *)0x0) {
      iVar3 = (int)pwVar2 - iVar1 >> 2;
    }
  }
  return iVar3;
}


PUSH EDI
PUSH ESI
MOV ESI,0xffffffff
PUSH EBX
MOV ECX,dword ptr [ESP + 0x10]
CALL 0x00035840
ADD EBX,0x1a1cef
MOV EDX,dword ptr [ESP + 0x18]
MOV EAX,dword ptr [ECX + 0x4]
CMP EDX,EAX
JNC 0x001ed346
MOV EDI,dword ptr [ECX]
SUB ESP,0x4
SUB EAX,EDX
PUSH EAX
LEA EAX,[EDI + EDX*0x4]
PUSH dword ptr [ESP + 0x1c]
PUSH EAX
CALL 0x000290d0
ADD ESP,0x10
MOV EDX,EAX
SUB EDX,EDI
SAR EDX,0x2
TEST EAX,EAX
CMOVNZ ESI,EDX
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)" identifier (parameter_list "(int *param_1,wchar_t param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_3 < (uint)param_1[1])" ( (binary_expression "param_3 < (uint)param_1[1]" identifier < (cast_expression "(uint)param_1[1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" { (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" identifier = (call_expression "wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" identifier (argument_list "((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" ( (cast_expression "(wchar_t *)(iVar1 + param_3 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + param_3 * 4)" ( (binary_expression "iVar1 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "param_1[1] - param_3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 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      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }" { (expression_statement "iVar3 = (int)pwVar2 - iVar1 >> 2;" (assignment_expression "iVar3 = (int)pwVar2 - iVar1 >> 2" identifier = (binary_expression "(int)pwVar2 - iVar1 >> 2" (binary_expression "(int)pwVar2 - iVar1" (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::find(wchar_t, unsigned int) const */\n\nint __thiscall std::wstring::find(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_2 < *(uint *)(this + 4)) {\n    iVar1 = *(int *)this;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}\n\n" comment comment (function_definition "int __thiscall std::wstring::find(wstring *this,wchar_t param_1,uint param_2)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_2 < *(uint *)(this + 4)) {\n    iVar1 = *(int *)this;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find(wstring *this,wchar_t param_1,uint param_2)" identifier (parameter_list "(wstring *this,wchar_t param_1,uint param_2)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_2 < *(uint *)(this + 4)) {\n    iVar1 = *(int *)this;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_2 < *(uint *)(this + 4)) {\n    iVar1 = *(int *)this;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_2 < *(uint *)(this + 4))" ( (binary_expression "param_2 < *(uint *)(this + 4)" identifier < (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) )) (compound_statement "{\n    iVar1 = *(int *)this;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" { (expression_statement "iVar1 = *(int *)this;" (assignment_expression "iVar1 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2)" identifier = (call_expression "wmemchr((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2)" identifier (argument_list "((wchar_t *)(iVar1 + param_2 * 4),param_1,*(uint *)(this + 4) - param_2)" ( (cast_expression "(wchar_t *)(iVar1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + param_2 * 4)" ( (binary_expression "iVar1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "*(uint *)(this + 4) - param_2" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 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      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }" { (expression_statement "iVar3 = (int)pwVar2 - iVar1 >> 2;" (assignment_expression "iVar3 = (int)pwVar2 - iVar1 >> 2" identifier = (binary_expression "(int)pwVar2 - iVar1 >> 2" (binary_expression "(int)pwVar2 - iVar1" (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "int FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}\n\n" (function_definition "int FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)" identifier (parameter_list "(int *param_1,wchar_t param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" identifier = number_literal) ;) (if_statement "if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" if (parenthesized_expression "(param_3 < (uint)param_1[1])" ( (binary_expression "param_3 < (uint)param_1[1]" identifier < (cast_expression "(uint)param_1[1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" { (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" identifier = (call_expression "wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" identifier (argument_list "((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" ( (cast_expression "(wchar_t *)(iVar1 + param_3 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + param_3 * 4)" ( (binary_expression "iVar1 + param_3 * 4" identifier + (binary_expression "param_3 * 4" identifier * number_literal)) ))) , identifier , (binary_expression "param_1[1] - param_3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) )))) ;) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 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      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }" { (expression_statement "iVar3 = (int)pwVar2 - iVar1 >> 2;" (assignment_expression "iVar3 = (int)pwVar2 - iVar1 >> 2" identifier = (binary_expression "(int)pwVar2 - iVar1 >> 2" (binary_expression "(int)pwVar2 - iVar1" (cast_expression "(int)pwVar2" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) >> number_literal)) ;) })) })) (return_statement "return iVar3;" 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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (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 (subscript_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 TYPE) ) IDENT) - IDENT) >> LIT)) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)\n\n{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "FUN_001ed300(int *param_1,wchar_t param_2,uint param_3)" (identifier "FUN_001ed300") (parameter_list "(int *param_1,wchar_t param_2,uint param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "wchar_t param_2" (type_identifier "wchar_t") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  wchar_t *pwVar2;\n  int iVar3;\n  \n  iVar3 = -1;\n  if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }\n  return iVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "wchar_t *pwVar2;" (type_identifier "wchar_t") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (expression_statement "iVar3 = -1;" (assignment_expression "iVar3 = -1" (identifier "iVar3") (= "=") (number_literal "-1")) (; ";")) (if_statement "if (param_3 < (uint)param_1[1]) {\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 < (uint)param_1[1])" (( "(") (binary_expression "param_3 < (uint)param_1[1]" (identifier "param_3") (< "<") (cast_expression "(uint)param_1[1]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (compound_statement "{\n    iVar1 = *param_1;\n    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);\n    if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }\n  }" ({ "{") (expression_statement "iVar1 = *param_1;" (assignment_expression "iVar1 = *param_1" (identifier "iVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);" (assignment_expression "pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" (identifier "pwVar2") (= "=") (call_expression "wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" (identifier "wmemchr") (argument_list "((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3)" (( "(") (cast_expression "(wchar_t *)(iVar1 + param_3 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + param_3 * 4)" (( "(") (binary_expression "iVar1 + param_3 * 4" (identifier "iVar1") (+ "+") (binary_expression "param_3 * 4" (identifier "param_3") (* "*") (number_literal "4"))) () ")"))) (, ",") (identifier "param_2") (, ",") (binary_expression "param_1[1] - param_3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if (pwVar2 != (wchar_t *)0x0) {\n      iVar3 = (int)pwVar2 - iVar1 >> 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      iVar3 = (int)pwVar2 - iVar1 >> 2;\n    }" ({ "{") (expression_statement "iVar3 = (int)pwVar2 - iVar1 >> 2;" (assignment_expression "iVar3 = (int)pwVar2 - iVar1 >> 2" (identifier "iVar3") (= "=") (binary_expression "(int)pwVar2 - iVar1 >> 2" (binary_expression "(int)pwVar2 - iVar1" (cast_expression "(int)pwVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pwVar2")) (- "-") (identifier "iVar1")) (>> ">>") (number_literal "2"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::wstring::find(wchar_t, unsigned int) const */

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

{
  int var_4;
  type_2 *var_5;
  int iVar3;
  
  iVar3 = -1;
  if (var_1 < *(type_3 *)(var_2 + 4)) {
    var_4 = *(int *)var_2;
    var_5 = var_3((type_2 *)(var_4 + var_1 * 4),param_1,*(type_3 *)(var_2 + 4) - var_1);
    if (var_5 != (type_2 *)0x0) {
      iVar3 = (int)var_5 - var_4 >> 2;
    }
  }
  return iVar3;
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

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

{
  int iVar1;
  wchar_t *pwVar2;
  int iVar3;
  
  iVar3 = -1;
  if (param_3 < (uint)param_1[1]) {
    iVar1 = *param_1;
    pwVar2 = wmemchr((wchar_t *)(iVar1 + param_3 * 4),param_2,param_1[1] - param_3);
    if (pwVar2 != (wchar_t *)0x0) {
      iVar3 = (int)pwVar2 - iVar1 >> 2;
    }
  }
  return iVar3;
}

