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

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

{
  uint uVar1;
  int iVar2;
  wchar_t *pwVar3;
  uint uVar4;
  
  uVar4 = 0xffffffff;
  if (*(int *)(this + 4) != 0) {
    uVar1 = *(int *)(this + 4) - 1;
    iVar2 = *(int *)this;
    uVar4 = param_2;
    if (uVar1 <= param_2) {
      uVar4 = uVar1;
    }
    while (param_3 != 0) {
      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);
      if (pwVar3 == (wchar_t *)0x0) {
        return uVar4;
      }
      uVar4 = uVar4 - 1;
      if (uVar4 == 0xffffffff) {
        return 0xffffffff;
      }
    }
  }
  return uVar4;
}



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

uint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)

{
  uint uVar1;
  int iVar2;
  wchar_t *pwVar3;
  uint uVar4;
  
  uVar4 = 0xffffffff;
  if (param_1[1] != 0) {
    uVar1 = param_1[1] - 1;
    iVar2 = *param_1;
    uVar4 = param_3;
    if (uVar1 <= param_3) {
      uVar4 = uVar1;
    }
    while (param_4 != 0) {
      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);
      if (pwVar3 == (wchar_t *)0x0) {
        return uVar4;
      }
      uVar4 = uVar4 - 1;
      if (uVar4 == 0xffffffff) {
        return 0xffffffff;
      }
    }
  }
  return uVar4;
}


PUSH EBP
PUSH EDI
MOV EDI,0xffffffff
PUSH ESI
PUSH EBX
CALL 0x00036db0
ADD EBX,0x1a65b2
SUB ESP,0xc
MOV ECX,dword ptr [ESP + 0x20]
MOV EBP,dword ptr [ESP + 0x28]
MOV ESI,dword ptr [ESP + 0x2c]
MOV EAX,dword ptr [ECX + 0x4]
TEST EAX,EAX
JZ 0x00203a9a
LEA EDX,[EAX + -0x1]
MOV EDI,EBP
CMP EDX,EBP
MOV EBP,dword ptr [ECX]
CMOVBE EDI,EDX
TEST ESI,ESI
JZ 0x00203a9a
SUB ESP,0x4
PUSH ESI
PUSH dword ptr [EBP + EDI*0x4]
PUSH dword ptr [ESP + 0x30]
CALL 0x0002a0d0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00203a9a
SUB EDI,0x1
CMP EDI,-0x1
JNZ 0x00203a76
ADD ESP,0xc
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}\n\n" comment (function_definition "uint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" type_identifier (function_declarator "FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" identifier (parameter_list "(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "size_t param_4" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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)) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar4 = param_3;" (assignment_expression "uVar4 = param_3" identifier = identifier) ;) (if_statement "if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }" if (parenthesized_expression "(uVar1 <= param_3)" ( (binary_expression "uVar1 <= param_3" identifier <= identifier) )) (compound_statement "{\n      uVar4 = uVar1;\n    }" { (expression_statement "uVar4 = uVar1;" (assignment_expression "uVar4 = uVar1" identifier = identifier) ;) })) (while_statement "while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" while (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" { (expression_statement "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);" (assignment_expression "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" identifier = (call_expression "wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" identifier (argument_list "(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" ( identifier , (pointer_expression "*(wchar_t *)(iVar2 + uVar4 * 4)" * (cast_expression "(wchar_t *)(iVar2 + uVar4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4 * 4)" ( (binary_expression "iVar2 + uVar4 * 4" identifier + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }" if (parenthesized_expression "(pwVar3 == (wchar_t *)0x0)" ( (binary_expression "pwVar3 == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return uVar4;\n      }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "uVar4 = uVar4 - 1;" (assignment_expression "uVar4 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return 0xffffffff;\n      }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::wstring::find_last_not_of(wchar_t const*, unsigned int, unsigned int) const */\n\nuint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    iVar2 = *(int *)this;\n    uVar4 = param_2;\n    if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }\n    while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}\n\n" comment comment (function_definition "uint __thiscall\nstd::wstring::find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    iVar2 = *(int *)this;\n    uVar4 = param_2;\n    if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }\n    while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "find_last_not_of(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" identifier (parameter_list "(wstring *this,wchar_t *param_1,uint param_2,uint param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    iVar2 = *(int *)this;\n    uVar4 = param_2;\n    if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }\n    while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (*(int *)(this + 4) != 0) {\n    uVar1 = *(int *)(this + 4) - 1;\n    iVar2 = *(int *)this;\n    uVar4 = param_2;\n    if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }\n    while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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    iVar2 = *(int *)this;\n    uVar4 = param_2;\n    if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }\n    while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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)) ;) (expression_statement "iVar2 = *(int *)this;" (assignment_expression "iVar2 = *(int *)this" identifier = (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar4 = param_2;" (assignment_expression "uVar4 = param_2" identifier = identifier) ;) (if_statement "if (uVar1 <= param_2) {\n      uVar4 = uVar1;\n    }" if (parenthesized_expression "(uVar1 <= param_2)" ( (binary_expression "uVar1 <= param_2" identifier <= identifier) )) (compound_statement "{\n      uVar4 = uVar1;\n    }" { (expression_statement "uVar4 = uVar1;" (assignment_expression "uVar4 = uVar1" identifier = identifier) ;) })) (while_statement "while (param_3 != 0) {\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" while (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" { (expression_statement "pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3);" (assignment_expression "pwVar3 = wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3)" identifier = (call_expression "wmemchr(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3)" identifier (argument_list "(param_1,*(wchar_t *)(iVar2 + uVar4 * 4),param_3)" ( identifier , (pointer_expression "*(wchar_t *)(iVar2 + uVar4 * 4)" * (cast_expression "(wchar_t *)(iVar2 + uVar4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4 * 4)" ( (binary_expression "iVar2 + uVar4 * 4" identifier + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }" if (parenthesized_expression "(pwVar3 == (wchar_t *)0x0)" ( (binary_expression "pwVar3 == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return uVar4;\n      }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "uVar4 = uVar4 - 1;" (assignment_expression "uVar4 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return 0xffffffff;\n      }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "uint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}\n\n" (function_definition "uint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" type_identifier (function_declarator "FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" identifier (parameter_list "(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "size_t param_4" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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)) ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar4 = param_3;" (assignment_expression "uVar4 = param_3" identifier = identifier) ;) (if_statement "if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }" if (parenthesized_expression "(uVar1 <= param_3)" ( (binary_expression "uVar1 <= param_3" identifier <= identifier) )) (compound_statement "{\n      uVar4 = uVar1;\n    }" { (expression_statement "uVar4 = uVar1;" (assignment_expression "uVar4 = uVar1" identifier = identifier) ;) })) (while_statement "while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" while (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" { (expression_statement "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);" (assignment_expression "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" identifier = (call_expression "wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" identifier (argument_list "(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" ( identifier , (pointer_expression "*(wchar_t *)(iVar2 + uVar4 * 4)" * (cast_expression "(wchar_t *)(iVar2 + uVar4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + uVar4 * 4)" ( (binary_expression "iVar2 + uVar4 * 4" identifier + (binary_expression "uVar4 * 4" identifier * number_literal)) )))) , identifier )))) ;) (if_statement "if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }" if (parenthesized_expression "(pwVar3 == (wchar_t *)0x0)" ( (binary_expression "pwVar3 == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        return uVar4;\n      }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "uVar4 = uVar4 - 1;" (assignment_expression "uVar4 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return 0xffffffff;\n      }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (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)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (while_statement while (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (binary_expression IDENT * LIT)) )))) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) })) })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)\n\n{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" (type_identifier "uint") (function_declarator "FUN_00203a40(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" (identifier "FUN_00203a40") (parameter_list "(int *param_1,wchar_t *param_2,uint param_3,size_t param_4)" (( "(") (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") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "size_t param_4" (primitive_type "size_t") (identifier "param_4")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  wchar_t *pwVar3;\n  uint uVar4;\n  \n  uVar4 = 0xffffffff;\n  if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\n  }\n  return uVar4;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "wchar_t *pwVar3;" (type_identifier "wchar_t") (pointer_declarator "*pwVar3" (* "*") (identifier "pwVar3")) (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "uVar4 = 0xffffffff;" (assignment_expression "uVar4 = 0xffffffff" (identifier "uVar4") (= "=") (number_literal "0xffffffff")) (; ";")) (if_statement "if (param_1[1] != 0) {\n    uVar1 = param_1[1] - 1;\n    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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    iVar2 = *param_1;\n    uVar4 = param_3;\n    if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }\n    while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }\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"))) (; ";")) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar4 = param_3;" (assignment_expression "uVar4 = param_3" (identifier "uVar4") (= "=") (identifier "param_3")) (; ";")) (if_statement "if (uVar1 <= param_3) {\n      uVar4 = uVar1;\n    }" (if "if") (parenthesized_expression "(uVar1 <= param_3)" (( "(") (binary_expression "uVar1 <= param_3" (identifier "uVar1") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n      uVar4 = uVar1;\n    }" ({ "{") (expression_statement "uVar4 = uVar1;" (assignment_expression "uVar4 = uVar1" (identifier "uVar4") (= "=") (identifier "uVar1")) (; ";")) (} "}"))) (while_statement "while (param_4 != 0) {\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" (while "while") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);\n      if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }\n      uVar4 = uVar4 - 1;\n      if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }\n    }" ({ "{") (expression_statement "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);" (assignment_expression "pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" (identifier "pwVar3") (= "=") (call_expression "wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" (identifier "wmemchr") (argument_list "(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4)" (( "(") (identifier "param_2") (, ",") (pointer_expression "*(wchar_t *)(iVar2 + uVar4 * 4)" (* "*") (cast_expression "(wchar_t *)(iVar2 + uVar4 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + uVar4 * 4)" (( "(") (binary_expression "iVar2 + uVar4 * 4" (identifier "iVar2") (+ "+") (binary_expression "uVar4 * 4" (identifier "uVar4") (* "*") (number_literal "4"))) () ")")))) (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (pwVar3 == (wchar_t *)0x0) {\n        return uVar4;\n      }" (if "if") (parenthesized_expression "(pwVar3 == (wchar_t *)0x0)" (( "(") (binary_expression "pwVar3 == (wchar_t *)0x0" (identifier "pwVar3") (== "==") (cast_expression "(wchar_t *)0x0" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        return uVar4;\n      }" ({ "{") (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}"))) (expression_statement "uVar4 = uVar4 - 1;" (assignment_expression "uVar4 = uVar4 - 1" (identifier "uVar4") (= "=") (binary_expression "uVar4 - 1" (identifier "uVar4") (- "-") (number_literal "1"))) (; ";")) (if_statement "if (uVar4 == 0xffffffff) {\n        return 0xffffffff;\n      }" (if "if") (parenthesized_expression "(uVar4 == 0xffffffff)" (( "(") (binary_expression "uVar4 == 0xffffffff" (identifier "uVar4") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n        return 0xffffffff;\n      }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (} "}"))) (} "}"))) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}")))

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

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

{
  type_1 var_2;
  int var_6;
  type_3 *var_8;
  type_1 var_7;
  
  var_7 = 0xffffffff;
  if (*(int *)(var_1 + 4) != 0) {
    var_2 = *(int *)(var_1 + 4) - 1;
    var_6 = *(int *)var_1;
    var_7 = var_3;
    if (var_2 <= var_3) {
      var_7 = var_2;
    }
    while (var_4 != 0) {
      var_8 = var_5(param_1,*(type_3 *)(var_6 + var_7 * 4),var_4);
      if (var_8 == (type_3 *)0x0) {
        return var_7;
      }
      var_7 = var_7 - 1;
      if (var_7 == 0xffffffff) {
        return 0xffffffff;
      }
    }
  }
  return var_7;
}


(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (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)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (pointer_expression argument: (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))))) (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 (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))))))) (return_statement (identifier)))))

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

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

{
  uint uVar1;
  int iVar2;
  wchar_t *pwVar3;
  uint uVar4;
  
  uVar4 = 0xffffffff;
  if (param_1[1] != 0) {
    uVar1 = param_1[1] - 1;
    iVar2 = *param_1;
    uVar4 = param_3;
    if (uVar1 <= param_3) {
      uVar4 = uVar1;
    }
    while (param_4 != 0) {
      pwVar3 = wmemchr(param_2,*(wchar_t *)(iVar2 + uVar4 * 4),param_4);
      if (pwVar3 == (wchar_t *)0x0) {
        return uVar4;
      }
      uVar4 = uVar4 - 1;
      if (uVar4 == 0xffffffff) {
        return 0xffffffff;
      }
    }
  }
  return uVar4;
}

