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

uint __thiscall std::string::find(string *this,char *param_1,uint param_2,uint param_3)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  void *pvVar4;
  int iVar5;
  uint uVar6;
  size_t __n;
  
  iVar2 = *(int *)this;
  uVar3 = *(uint *)(iVar2 + -0xc);
  if (param_3 == 0) {
    uVar6 = 0xffffffff;
    if (param_2 <= uVar3) {
      uVar6 = param_2;
    }
    return uVar6;
  }
  if (param_2 < uVar3) {
    pvVar4 = (void *)(iVar2 + param_2);
    if (param_3 <= uVar3 - param_2) {
      __n = (uVar3 - param_2) + (1 - param_3);
      if (__n != 0) {
        cVar1 = *param_1;
        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {
          iVar5 = memcmp(pvVar4,param_1,param_3);
          if (iVar5 == 0) {
            return (int)pvVar4 - iVar2;
          }
          pvVar4 = (void *)((int)pvVar4 + 1);
          uVar6 = (iVar2 + uVar3) - (int)pvVar4;
          if (uVar6 < param_3) {
            return 0xffffffff;
          }
          __n = uVar6 + (1 - param_3);
          if (__n == 0) {
            return 0xffffffff;
          }
        }
      }
    }
  }
  return 0xffffffff;
}



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

uint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  void *pvVar4;
  int iVar5;
  uint uVar6;
  size_t __n;
  
  iVar2 = *param_1;
  uVar3 = *(uint *)(iVar2 + -0xc);
  if (param_4 == 0) {
    uVar6 = 0xffffffff;
    if (param_3 <= uVar3) {
      uVar6 = param_3;
    }
    return uVar6;
  }
  if (param_3 < uVar3) {
    pvVar4 = (void *)(iVar2 + param_3);
    if (param_4 <= uVar3 - param_3) {
      __n = (uVar3 - param_3) + (1 - param_4);
      if (__n != 0) {
        cVar1 = *param_2;
        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {
          iVar5 = memcmp(pvVar4,param_2,param_4);
          if (iVar5 == 0) {
            return (int)pvVar4 - iVar2;
          }
          pvVar4 = (void *)((int)pvVar4 + 1);
          uVar6 = (iVar2 + uVar3) - (int)pvVar4;
          if (uVar6 < param_4) {
            return 0xffffffff;
          }
          __n = uVar6 + (1 - param_4);
          if (__n == 0) {
            return 0xffffffff;
          }
        }
      }
    }
  }
  return 0xffffffff;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x171357
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x30]
MOV ESI,dword ptr [ESP + 0x3c]
MOV ECX,dword ptr [ESP + 0x38]
MOV EDI,dword ptr [EAX]
MOV EBP,dword ptr [EDI + -0xc]
TEST ESI,ESI
JZ 0x0021dd50
MOV EAX,0xffffffff
CMP EBP,ECX
JBE 0x0021dd47
LEA EDX,[EDI + ECX*0x1]
MOV dword ptr [ESP + 0x8],EDX
LEA EDX,[EDI + EBP*0x1]
SUB EBP,ECX
MOV dword ptr [ESP],EDX
CMP ESI,EBP
JA 0x0021dd47
MOV ECX,0x1
SUB ECX,ESI
ADD EBP,ECX
MOV dword ptr [ESP + 0x4],ECX
MOV ECX,EBP
JZ 0x0021dd47
MOV EAX,dword ptr [ESP + 0x34]
MOV EDX,dword ptr [ESP + 0x8]
MOV dword ptr [ESP + 0xc],EDI
MOVSX EBP,byte ptr [EAX]
SUB ESP,0x4
PUSH ECX
PUSH EBP
PUSH EDX
CALL 0x00029970
ADD ESP,0x10
MOV EDI,EAX
TEST EAX,EAX
JZ 0x0021dd42
SUB ESP,0x4
PUSH ESI
PUSH dword ptr [ESP + 0x3c]
PUSH EAX
CALL 0x00029130
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0021dd68
MOV ECX,dword ptr [ESP]
LEA EDX,[EDI + 0x1]
SUB ECX,EDX
CMP ESI,ECX
JA 0x0021dd42
ADD ECX,dword ptr [ESP + 0x4]
JNZ 0x0021dd07
MOV EAX,0xffffffff
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
CMP EBP,ECX
MOV EAX,0xffffffff
CMOVNC EAX,ECX
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EBP,EDI
MOV EDI,dword ptr [ESP + 0xc]
MOV EAX,EBP
SUB EAX,EDI
JMP 0x0021dd47
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}\n\n" comment (function_definition "uint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,char *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar3 = *(uint *)(iVar2 + -0xc);" (assignment_expression "uVar3 = *(uint *)(iVar2 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" if (parenthesized_expression "(param_4 == 0)" ( (binary_expression "param_4 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" { (expression_statement "uVar6 = 0xffffffff;" (assignment_expression "uVar6 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }" if (parenthesized_expression "(param_3 <= uVar3)" ( (binary_expression "param_3 <= uVar3" identifier <= identifier) )) (compound_statement "{\n      uVar6 = param_3;\n    }" { (expression_statement "uVar6 = param_3;" (assignment_expression "uVar6 = param_3" identifier = identifier) ;) })) (return_statement "return uVar6;" return identifier ;) })) (if_statement "if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" if (parenthesized_expression "(param_3 < uVar3)" ( (binary_expression "param_3 < uVar3" identifier < identifier) )) (compound_statement "{\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" { (expression_statement "pvVar4 = (void *)(iVar2 + param_3);" (assignment_expression "pvVar4 = (void *)(iVar2 + param_3)" identifier = (cast_expression "(void *)(iVar2 + param_3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + param_3)" ( (binary_expression "iVar2 + param_3" identifier + identifier) )))) ;) (if_statement "if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" if (parenthesized_expression "(param_4 <= uVar3 - param_3)" ( (binary_expression "param_4 <= uVar3 - param_3" identifier <= (binary_expression "uVar3 - param_3" identifier - identifier)) )) (compound_statement "{\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" { (expression_statement "__n = (uVar3 - param_3) + (1 - param_4);" (assignment_expression "__n = (uVar3 - param_3) + (1 - param_4)" identifier = (binary_expression "(uVar3 - param_3) + (1 - param_4)" (parenthesized_expression "(uVar3 - param_3)" ( (binary_expression "uVar3 - param_3" identifier - identifier) )) + (parenthesized_expression "(1 - param_4)" ( (binary_expression "1 - param_4" number_literal - identifier) )))) ;) (if_statement "if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" { (expression_statement "cVar1 = *param_2;" (assignment_expression "cVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (while_statement "while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" while (parenthesized_expression "(pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0)" ( (comma_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0" (assignment_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n)" identifier = (call_expression "memchr(pvVar4,(int)cVar1,__n)" identifier (argument_list "(pvVar4,(int)cVar1,__n)" ( identifier , (cast_expression "(int)cVar1" ( (type_descriptor "int" primitive_type) ) identifier) , identifier )))) , (binary_expression "pvVar4 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) )) (compound_statement "{\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" { (expression_statement "iVar5 = memcmp(pvVar4,param_2,param_4);" (assignment_expression "iVar5 = memcmp(pvVar4,param_2,param_4)" identifier = (call_expression "memcmp(pvVar4,param_2,param_4)" identifier (argument_list "(pvVar4,param_2,param_4)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n            return (int)pvVar4 - iVar2;\n          }" { (return_statement "return (int)pvVar4 - iVar2;" return (binary_expression "(int)pvVar4 - iVar2" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) ;) })) (expression_statement "pvVar4 = (void *)((int)pvVar4 + 1);" (assignment_expression "pvVar4 = (void *)((int)pvVar4 + 1)" identifier = (cast_expression "(void *)((int)pvVar4 + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar4 + 1)" ( (binary_expression "(int)pvVar4 + 1" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "uVar6 = (iVar2 + uVar3) - (int)pvVar4;" (assignment_expression "uVar6 = (iVar2 + uVar3) - (int)pvVar4" identifier = (binary_expression "(iVar2 + uVar3) - (int)pvVar4" (parenthesized_expression "(iVar2 + uVar3)" ( (binary_expression "iVar2 + uVar3" identifier + identifier) )) - (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (uVar6 < param_4) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(uVar6 < param_4)" ( (binary_expression "uVar6 < param_4" identifier < identifier) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "__n = uVar6 + (1 - param_4);" (assignment_expression "__n = uVar6 + (1 - param_4)" identifier = (binary_expression "uVar6 + (1 - param_4)" identifier + (parenthesized_expression "(1 - param_4)" ( (binary_expression "1 - param_4" number_literal - identifier) )))) ;) (if_statement "if (__n == 0) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) })) })) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::string::find(char const*, unsigned int, unsigned int) const */\n\nuint __thiscall std::string::find(string *this,char *param_1,uint param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *(int *)this;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_3 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }\n    return uVar6;\n  }\n  if (param_2 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_2);\n    if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}\n\n" comment comment (function_definition "uint __thiscall std::string::find(string *this,char *param_1,uint param_2,uint param_3)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *(int *)this;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_3 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }\n    return uVar6;\n  }\n  if (param_2 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_2);\n    if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "find(string *this,char *param_1,uint param_2,uint param_3)" identifier (parameter_list "(string *this,char *param_1,uint param_2,uint param_3)" ( (parameter_declaration "string *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *(int *)this;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_3 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }\n    return uVar6;\n  }\n  if (param_2 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_2);\n    if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (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 "uVar3 = *(uint *)(iVar2 + -0xc);" (assignment_expression "uVar3 = *(uint *)(iVar2 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (param_3 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }\n    return uVar6;\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar6 = 0xffffffff;\n    if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }\n    return uVar6;\n  }" { (expression_statement "uVar6 = 0xffffffff;" (assignment_expression "uVar6 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_2 <= uVar3) {\n      uVar6 = param_2;\n    }" if (parenthesized_expression "(param_2 <= uVar3)" ( (binary_expression "param_2 <= uVar3" identifier <= identifier) )) (compound_statement "{\n      uVar6 = param_2;\n    }" { (expression_statement "uVar6 = param_2;" (assignment_expression "uVar6 = param_2" identifier = identifier) ;) })) (return_statement "return uVar6;" return identifier ;) })) (if_statement "if (param_2 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_2);\n    if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" if (parenthesized_expression "(param_2 < uVar3)" ( (binary_expression "param_2 < uVar3" identifier < identifier) )) (compound_statement "{\n    pvVar4 = (void *)(iVar2 + param_2);\n    if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" { (expression_statement "pvVar4 = (void *)(iVar2 + param_2);" (assignment_expression "pvVar4 = (void *)(iVar2 + param_2)" identifier = (cast_expression "(void *)(iVar2 + param_2)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + param_2)" ( (binary_expression "iVar2 + param_2" identifier + identifier) )))) ;) (if_statement "if (param_3 <= uVar3 - param_2) {\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" if (parenthesized_expression "(param_3 <= uVar3 - param_2)" ( (binary_expression "param_3 <= uVar3 - param_2" identifier <= (binary_expression "uVar3 - param_2" identifier - identifier)) )) (compound_statement "{\n      __n = (uVar3 - param_2) + (1 - param_3);\n      if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" { (expression_statement "__n = (uVar3 - param_2) + (1 - param_3);" (assignment_expression "__n = (uVar3 - param_2) + (1 - param_3)" identifier = (binary_expression "(uVar3 - param_2) + (1 - param_3)" (parenthesized_expression "(uVar3 - param_2)" ( (binary_expression "uVar3 - param_2" identifier - identifier) )) + (parenthesized_expression "(1 - param_3)" ( (binary_expression "1 - param_3" number_literal - identifier) )))) ;) (if_statement "if (__n != 0) {\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n        cVar1 = *param_1;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" { (expression_statement "cVar1 = *param_1;" (assignment_expression "cVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (while_statement "while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" while (parenthesized_expression "(pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0)" ( (comma_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0" (assignment_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n)" identifier = (call_expression "memchr(pvVar4,(int)cVar1,__n)" identifier (argument_list "(pvVar4,(int)cVar1,__n)" ( identifier , (cast_expression "(int)cVar1" ( (type_descriptor "int" primitive_type) ) identifier) , identifier )))) , (binary_expression "pvVar4 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) )) (compound_statement "{\n          iVar5 = memcmp(pvVar4,param_1,param_3);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_3) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_3);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" { (expression_statement "iVar5 = memcmp(pvVar4,param_1,param_3);" (assignment_expression "iVar5 = memcmp(pvVar4,param_1,param_3)" identifier = (call_expression "memcmp(pvVar4,param_1,param_3)" identifier (argument_list "(pvVar4,param_1,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n            return (int)pvVar4 - iVar2;\n          }" { (return_statement "return (int)pvVar4 - iVar2;" return (binary_expression "(int)pvVar4 - iVar2" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) ;) })) (expression_statement "pvVar4 = (void *)((int)pvVar4 + 1);" (assignment_expression "pvVar4 = (void *)((int)pvVar4 + 1)" identifier = (cast_expression "(void *)((int)pvVar4 + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar4 + 1)" ( (binary_expression "(int)pvVar4 + 1" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "uVar6 = (iVar2 + uVar3) - (int)pvVar4;" (assignment_expression "uVar6 = (iVar2 + uVar3) - (int)pvVar4" identifier = (binary_expression "(iVar2 + uVar3) - (int)pvVar4" (parenthesized_expression "(iVar2 + uVar3)" ( (binary_expression "iVar2 + uVar3" identifier + identifier) )) - (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (uVar6 < param_3) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(uVar6 < param_3)" ( (binary_expression "uVar6 < param_3" identifier < identifier) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "__n = uVar6 + (1 - param_3);" (assignment_expression "__n = uVar6 + (1 - param_3)" identifier = (binary_expression "uVar6 + (1 - param_3)" identifier + (parenthesized_expression "(1 - param_3)" ( (binary_expression "1 - param_3" number_literal - identifier) )))) ;) (if_statement "if (__n == 0) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) })) })) (return_statement "return 0xffffffff;" return number_literal ;) })))
(translation_unit "uint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}\n\n" (function_definition "uint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" type_identifier (function_declarator "FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)" identifier (parameter_list "(int *param_1,char *param_2,uint param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "void *pvVar4;" primitive_type (pointer_declarator "*pvVar4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar3 = *(uint *)(iVar2 + -0xc);" (assignment_expression "uVar3 = *(uint *)(iVar2 + -0xc)" identifier = (pointer_expression "*(uint *)(iVar2 + -0xc)" * (cast_expression "(uint *)(iVar2 + -0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -0xc)" ( (binary_expression "iVar2 + -0xc" identifier + number_literal) ))))) ;) (if_statement "if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" if (parenthesized_expression "(param_4 == 0)" ( (binary_expression "param_4 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" { (expression_statement "uVar6 = 0xffffffff;" (assignment_expression "uVar6 = 0xffffffff" identifier = number_literal) ;) (if_statement "if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }" if (parenthesized_expression "(param_3 <= uVar3)" ( (binary_expression "param_3 <= uVar3" identifier <= identifier) )) (compound_statement "{\n      uVar6 = param_3;\n    }" { (expression_statement "uVar6 = param_3;" (assignment_expression "uVar6 = param_3" identifier = identifier) ;) })) (return_statement "return uVar6;" return identifier ;) })) (if_statement "if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" if (parenthesized_expression "(param_3 < uVar3)" ( (binary_expression "param_3 < uVar3" identifier < identifier) )) (compound_statement "{\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" { (expression_statement "pvVar4 = (void *)(iVar2 + param_3);" (assignment_expression "pvVar4 = (void *)(iVar2 + param_3)" identifier = (cast_expression "(void *)(iVar2 + param_3)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + param_3)" ( (binary_expression "iVar2 + param_3" identifier + identifier) )))) ;) (if_statement "if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" if (parenthesized_expression "(param_4 <= uVar3 - param_3)" ( (binary_expression "param_4 <= uVar3 - param_3" identifier <= (binary_expression "uVar3 - param_3" identifier - identifier)) )) (compound_statement "{\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" { (expression_statement "__n = (uVar3 - param_3) + (1 - param_4);" (assignment_expression "__n = (uVar3 - param_3) + (1 - param_4)" identifier = (binary_expression "(uVar3 - param_3) + (1 - param_4)" (parenthesized_expression "(uVar3 - param_3)" ( (binary_expression "uVar3 - param_3" identifier - identifier) )) + (parenthesized_expression "(1 - param_4)" ( (binary_expression "1 - param_4" number_literal - identifier) )))) ;) (if_statement "if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" { (expression_statement "cVar1 = *param_2;" (assignment_expression "cVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (while_statement "while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" while (parenthesized_expression "(pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0)" ( (comma_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0" (assignment_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n)" identifier = (call_expression "memchr(pvVar4,(int)cVar1,__n)" identifier (argument_list "(pvVar4,(int)cVar1,__n)" ( identifier , (cast_expression "(int)cVar1" ( (type_descriptor "int" primitive_type) ) identifier) , identifier )))) , (binary_expression "pvVar4 != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) )) (compound_statement "{\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" { (expression_statement "iVar5 = memcmp(pvVar4,param_2,param_4);" (assignment_expression "iVar5 = memcmp(pvVar4,param_2,param_4)" identifier = (call_expression "memcmp(pvVar4,param_2,param_4)" identifier (argument_list "(pvVar4,param_2,param_4)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n            return (int)pvVar4 - iVar2;\n          }" { (return_statement "return (int)pvVar4 - iVar2;" return (binary_expression "(int)pvVar4 - iVar2" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) - identifier) ;) })) (expression_statement "pvVar4 = (void *)((int)pvVar4 + 1);" (assignment_expression "pvVar4 = (void *)((int)pvVar4 + 1)" identifier = (cast_expression "(void *)((int)pvVar4 + 1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)pvVar4 + 1)" ( (binary_expression "(int)pvVar4 + 1" (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "uVar6 = (iVar2 + uVar3) - (int)pvVar4;" (assignment_expression "uVar6 = (iVar2 + uVar3) - (int)pvVar4" identifier = (binary_expression "(iVar2 + uVar3) - (int)pvVar4" (parenthesized_expression "(iVar2 + uVar3)" ( (binary_expression "iVar2 + uVar3" identifier + identifier) )) - (cast_expression "(int)pvVar4" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (uVar6 < param_4) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(uVar6 < param_4)" ( (binary_expression "uVar6 < param_4" identifier < identifier) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) (expression_statement "__n = uVar6 + (1 - param_4);" (assignment_expression "__n = uVar6 + (1 - param_4)" identifier = (binary_expression "uVar6 + (1 - param_4)" identifier + (parenthesized_expression "(1 - param_4)" ( (binary_expression "1 - param_4" number_literal - identifier) )))) ;) (if_statement "if (__n == 0) {\n            return 0xffffffff;\n          }" if (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) (compound_statement "{\n            return 0xffffffff;\n          }" { (return_statement "return 0xffffffff;" return number_literal ;) })) })) })) })) })) (return_statement "return 0xffffffff;" return number_literal ;) })))
(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 IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + (parenthesized_expression ( (binary_expression LIT - IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE) ) IDENT) , IDENT )))) , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT + IDENT) )) - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (parenthesized_expression ( (binary_expression LIT - IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) })) })) })) })) (return_statement return LIT ;) })))
(function_definition "uint FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" (type_identifier "uint") (function_declarator "FUN_0021dca0(int *param_1,char *param_2,uint param_3,uint param_4)" (identifier "FUN_0021dca0") (parameter_list "(int *param_1,char *param_2,uint param_3,uint param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  void *pvVar4;\n  int iVar5;\n  uint uVar6;\n  size_t __n;\n  \n  iVar2 = *param_1;\n  uVar3 = *(uint *)(iVar2 + -0xc);\n  if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }\n  if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }\n  return 0xffffffff;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "void *pvVar4;" (primitive_type "void") (pointer_declarator "*pvVar4" (* "*") (identifier "pvVar4")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar3 = *(uint *)(iVar2 + -0xc);" (assignment_expression "uVar3 = *(uint *)(iVar2 + -0xc)" (identifier "uVar3") (= "=") (pointer_expression "*(uint *)(iVar2 + -0xc)" (* "*") (cast_expression "(uint *)(iVar2 + -0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -0xc)" (( "(") (binary_expression "iVar2 + -0xc" (identifier "iVar2") (+ "+") (number_literal "-0xc")) () ")"))))) (; ";")) (if_statement "if (param_4 == 0) {\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" (if "if") (parenthesized_expression "(param_4 == 0)" (( "(") (binary_expression "param_4 == 0" (identifier "param_4") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar6 = 0xffffffff;\n    if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }\n    return uVar6;\n  }" ({ "{") (expression_statement "uVar6 = 0xffffffff;" (assignment_expression "uVar6 = 0xffffffff" (identifier "uVar6") (= "=") (number_literal "0xffffffff")) (; ";")) (if_statement "if (param_3 <= uVar3) {\n      uVar6 = param_3;\n    }" (if "if") (parenthesized_expression "(param_3 <= uVar3)" (( "(") (binary_expression "param_3 <= uVar3" (identifier "param_3") (<= "<=") (identifier "uVar3")) () ")")) (compound_statement "{\n      uVar6 = param_3;\n    }" ({ "{") (expression_statement "uVar6 = param_3;" (assignment_expression "uVar6 = param_3" (identifier "uVar6") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (return_statement "return uVar6;" (return "return") (identifier "uVar6") (; ";")) (} "}"))) (if_statement "if (param_3 < uVar3) {\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" (if "if") (parenthesized_expression "(param_3 < uVar3)" (( "(") (binary_expression "param_3 < uVar3" (identifier "param_3") (< "<") (identifier "uVar3")) () ")")) (compound_statement "{\n    pvVar4 = (void *)(iVar2 + param_3);\n    if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }\n  }" ({ "{") (expression_statement "pvVar4 = (void *)(iVar2 + param_3);" (assignment_expression "pvVar4 = (void *)(iVar2 + param_3)" (identifier "pvVar4") (= "=") (cast_expression "(void *)(iVar2 + param_3)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + param_3)" (( "(") (binary_expression "iVar2 + param_3" (identifier "iVar2") (+ "+") (identifier "param_3")) () ")")))) (; ";")) (if_statement "if (param_4 <= uVar3 - param_3) {\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" (if "if") (parenthesized_expression "(param_4 <= uVar3 - param_3)" (( "(") (binary_expression "param_4 <= uVar3 - param_3" (identifier "param_4") (<= "<=") (binary_expression "uVar3 - param_3" (identifier "uVar3") (- "-") (identifier "param_3"))) () ")")) (compound_statement "{\n      __n = (uVar3 - param_3) + (1 - param_4);\n      if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }\n    }" ({ "{") (expression_statement "__n = (uVar3 - param_3) + (1 - param_4);" (assignment_expression "__n = (uVar3 - param_3) + (1 - param_4)" (identifier "__n") (= "=") (binary_expression "(uVar3 - param_3) + (1 - param_4)" (parenthesized_expression "(uVar3 - param_3)" (( "(") (binary_expression "uVar3 - param_3" (identifier "uVar3") (- "-") (identifier "param_3")) () ")")) (+ "+") (parenthesized_expression "(1 - param_4)" (( "(") (binary_expression "1 - param_4" (number_literal "1") (- "-") (identifier "param_4")) () ")")))) (; ";")) (if_statement "if (__n != 0) {\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        cVar1 = *param_2;\n        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }\n      }" ({ "{") (expression_statement "cVar1 = *param_2;" (assignment_expression "cVar1 = *param_2" (identifier "cVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (while_statement "while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" (while "while") (parenthesized_expression "(pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0)" (( "(") (comma_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0" (assignment_expression "pvVar4 = memchr(pvVar4,(int)cVar1,__n)" (identifier "pvVar4") (= "=") (call_expression "memchr(pvVar4,(int)cVar1,__n)" (identifier "memchr") (argument_list "(pvVar4,(int)cVar1,__n)" (( "(") (identifier "pvVar4") (, ",") (cast_expression "(int)cVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "cVar1")) (, ",") (identifier "__n") () ")")))) (, ",") (binary_expression "pvVar4 != (void *)0x0" (identifier "pvVar4") (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")")) (compound_statement "{\n          iVar5 = memcmp(pvVar4,param_2,param_4);\n          if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }\n          pvVar4 = (void *)((int)pvVar4 + 1);\n          uVar6 = (iVar2 + uVar3) - (int)pvVar4;\n          if (uVar6 < param_4) {\n            return 0xffffffff;\n          }\n          __n = uVar6 + (1 - param_4);\n          if (__n == 0) {\n            return 0xffffffff;\n          }\n        }" ({ "{") (expression_statement "iVar5 = memcmp(pvVar4,param_2,param_4);" (assignment_expression "iVar5 = memcmp(pvVar4,param_2,param_4)" (identifier "iVar5") (= "=") (call_expression "memcmp(pvVar4,param_2,param_4)" (identifier "memcmp") (argument_list "(pvVar4,param_2,param_4)" (( "(") (identifier "pvVar4") (, ",") (identifier "param_2") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (iVar5 == 0) {\n            return (int)pvVar4 - iVar2;\n          }" (if "if") (parenthesized_expression "(iVar5 == 0)" (( "(") (binary_expression "iVar5 == 0" (identifier "iVar5") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n            return (int)pvVar4 - iVar2;\n          }" ({ "{") (return_statement "return (int)pvVar4 - iVar2;" (return "return") (binary_expression "(int)pvVar4 - iVar2" (cast_expression "(int)pvVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar4")) (- "-") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "pvVar4 = (void *)((int)pvVar4 + 1);" (assignment_expression "pvVar4 = (void *)((int)pvVar4 + 1)" (identifier "pvVar4") (= "=") (cast_expression "(void *)((int)pvVar4 + 1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)pvVar4 + 1)" (( "(") (binary_expression "(int)pvVar4 + 1" (cast_expression "(int)pvVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar4")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "uVar6 = (iVar2 + uVar3) - (int)pvVar4;" (assignment_expression "uVar6 = (iVar2 + uVar3) - (int)pvVar4" (identifier "uVar6") (= "=") (binary_expression "(iVar2 + uVar3) - (int)pvVar4" (parenthesized_expression "(iVar2 + uVar3)" (( "(") (binary_expression "iVar2 + uVar3" (identifier "iVar2") (+ "+") (identifier "uVar3")) () ")")) (- "-") (cast_expression "(int)pvVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pvVar4")))) (; ";")) (if_statement "if (uVar6 < param_4) {\n            return 0xffffffff;\n          }" (if "if") (parenthesized_expression "(uVar6 < param_4)" (( "(") (binary_expression "uVar6 < param_4" (identifier "uVar6") (< "<") (identifier "param_4")) () ")")) (compound_statement "{\n            return 0xffffffff;\n          }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (expression_statement "__n = uVar6 + (1 - param_4);" (assignment_expression "__n = uVar6 + (1 - param_4)" (identifier "__n") (= "=") (binary_expression "uVar6 + (1 - param_4)" (identifier "uVar6") (+ "+") (parenthesized_expression "(1 - param_4)" (( "(") (binary_expression "1 - param_4" (number_literal "1") (- "-") (identifier "param_4")) () ")")))) (; ";")) (if_statement "if (__n == 0) {\n            return 0xffffffff;\n          }" (if "if") (parenthesized_expression "(__n == 0)" (( "(") (binary_expression "__n == 0" (identifier "__n") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n            return 0xffffffff;\n          }" ({ "{") (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}"))) (} "}"))) (} "}"))) (} "}"))) (} "}"))) (return_statement "return 0xffffffff;" (return "return") (number_literal "0xffffffff") (; ";")) (} "}")))

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

type_1 __thiscall std::type_2::function_1(type_2 *this,char *param_1,type_1 var_3,type_1 var_2)

{
  char cVar1;
  int var_1;
  type_1 var_4;
  void *var_7;
  int var_9;
  type_1 var_10;
  size_t var_5;
  
  var_1 = *(int *)this;
  var_4 = *(type_1 *)(var_1 + -0xc);
  if (var_2 == 0) {
    var_10 = 0xffffffff;
    if (var_3 <= var_4) {
      var_10 = var_3;
    }
    return var_10;
  }
  if (var_3 < var_4) {
    var_7 = (void *)(var_1 + var_3);
    if (var_2 <= var_4 - var_3) {
      var_5 = (var_4 - var_3) + (1 - var_2);
      if (var_5 != 0) {
        cVar1 = *param_1;
        while (var_7 = var_6(var_7,(int)cVar1,var_5), var_7 != (void *)0x0) {
          var_9 = var_8(var_7,param_1,var_2);
          if (var_9 == 0) {
            return (int)var_7 - var_1;
          }
          var_7 = (void *)((int)var_7 + 1);
          var_10 = (var_1 + var_4) - (int)var_7;
          if (var_10 < var_2) {
            return 0xffffffff;
          }
          var_5 = var_10 + (1 - var_2);
          if (var_5 == 0) {
            return 0xffffffff;
          }
        }
      }
    }
  }
  return 0xffffffff;
}


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

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

uint MASKED(int *param_1,char *param_2,uint param_3,uint param_4)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  void *pvVar4;
  int iVar5;
  uint uVar6;
  size_t __n;
  
  iVar2 = *param_1;
  uVar3 = *(uint *)(iVar2 + -0xc);
  if (param_4 == 0) {
    uVar6 = 0xffffffff;
    if (param_3 <= uVar3) {
      uVar6 = param_3;
    }
    return uVar6;
  }
  if (param_3 < uVar3) {
    pvVar4 = (void *)(iVar2 + param_3);
    if (param_4 <= uVar3 - param_3) {
      __n = (uVar3 - param_3) + (1 - param_4);
      if (__n != 0) {
        cVar1 = *param_2;
        while (pvVar4 = memchr(pvVar4,(int)cVar1,__n), pvVar4 != (void *)0x0) {
          iVar5 = memcmp(pvVar4,param_2,param_4);
          if (iVar5 == 0) {
            return (int)pvVar4 - iVar2;
          }
          pvVar4 = (void *)((int)pvVar4 + 1);
          uVar6 = (iVar2 + uVar3) - (int)pvVar4;
          if (uVar6 < param_4) {
            return 0xffffffff;
          }
          __n = uVar6 + (1 - param_4);
          if (__n == 0) {
            return 0xffffffff;
          }
        }
      }
    }
  }
  return 0xffffffff;
}

