
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

size_t dir_len(char *file)

{
  char cVar1;
  int iVar2;
  char *pcVar3;
  uint uVar4;
  uint uVar5;
  
  cVar1 = *file;
  pcVar3 = last_component(file);
  uVar4 = (int)pcVar3 - (int)file;
  if (((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')) {
    do {
      uVar5 = uVar4 - 1;
      if ((cVar1 == '/') == uVar5) {
        return uVar5;
      }
      iVar2 = uVar4 - 2;
      uVar4 = uVar5;
    } while (file[iVar2] == '/');
    return uVar5;
  }
  return uVar4;
}



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

uint FUN_0001cca0(char *param_1)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  
  cVar1 = *param_1;
  iVar2 = FUN_0001cd80(param_1);
  uVar3 = iVar2 - (int)param_1;
  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {
    do {
      uVar4 = uVar3 - 1;
      if ((cVar1 == '/') == uVar4) {
        return uVar4;
      }
      iVar2 = uVar3 - 2;
      uVar3 = uVar4;
    } while (param_1[iVar2] == '/');
    return uVar4;
  }
  return uVar3;
}


PUSH EDI
XOR EAX,EAX
PUSH ESI
PUSH EBX
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x000132d0
ADD EBX,0x1c352
CMP byte ptr [ESI],0x2f
SETZ AL
SUB ESP,0xc
PUSH ESI
MOV EDI,EAX
CALL 0x0001cd80
ADD ESP,0x10
MOV ECX,EAX
SUB ECX,ESI
CMP ECX,EDI
JBE 0x0001cd00
CMP byte ptr [EAX + -0x1],0x2f
LEA EDX,[ECX + -0x1]
JZ 0x0001ccec
JMP 0x0001cd00
CMP byte ptr [ESI + EDX*0x1 + -0x1],0x2f
LEA EAX,[EDX + -0x1]
JNZ 0x0001ccf0
MOV EDX,EAX
CMP EDI,EDX
JNZ 0x0001cce0
POP EBX
MOV EAX,EDX
POP ESI
POP EDI
RET
MOV EDX,ECX
POP EBX
POP ESI
MOV EAX,EDX
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint FUN_0001cca0(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}\n\n" comment (function_definition "uint FUN_0001cca0(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_0001cca0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "cVar1 = *param_1;" (assignment_expression "cVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "iVar2 = FUN_0001cd80(param_1);" (assignment_expression "iVar2 = FUN_0001cd80(param_1)" identifier = (call_expression "FUN_0001cd80(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "uVar3 = iVar2 - (int)param_1;" (assignment_expression "uVar3 = iVar2 - (int)param_1" identifier = (binary_expression "iVar2 - (int)param_1" identifier - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" if (parenthesized_expression "(((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/'))" ( (binary_expression "((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')" (parenthesized_expression "((cVar1 == '/') < uVar3)" ( (binary_expression "(cVar1 == '/') < uVar3" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) < identifier) )) && (parenthesized_expression "(*(char *)(iVar2 + -1) == '/')" ( (binary_expression "*(char *)(iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar2 + -1)" * (cast_expression "(char *)(iVar2 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -1)" ( (binary_expression "iVar2 + -1" identifier + number_literal) )))) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" { (do_statement "do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');" do (compound_statement "{\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    }" { (expression_statement "uVar4 = uVar3 - 1;" (assignment_expression "uVar4 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (if_statement "if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }" if (parenthesized_expression "((cVar1 == '/') == uVar4)" ( (binary_expression "(cVar1 == '/') == uVar4" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) == identifier) )) (compound_statement "{\n        return uVar4;\n      }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "iVar2 = uVar3 - 2;" (assignment_expression "iVar2 = uVar3 - 2" identifier = (binary_expression "uVar3 - 2" identifier - number_literal)) ;) (expression_statement "uVar3 = uVar4;" (assignment_expression "uVar3 = uVar4" identifier = identifier) ;) }) while (parenthesized_expression "(param_1[iVar2] == '/')" ( (binary_expression "param_1[iVar2] == '/'" (subscript_expression "param_1[iVar2]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) )) ;) (return_statement "return uVar4;" return identifier ;) })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nsize_t dir_len(char *file)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  uint uVar5;\n  \n  cVar1 = *file;\n  pcVar3 = last_component(file);\n  uVar4 = (int)pcVar3 - (int)file;\n  if (((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')) {\n    do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');\n    return uVar5;\n  }\n  return uVar4;\n}\n\n" comment comment (function_definition "size_t dir_len(char *file)\n\n{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  uint uVar5;\n  \n  cVar1 = *file;\n  pcVar3 = last_component(file);\n  uVar4 = (int)pcVar3 - (int)file;\n  if (((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')) {\n    do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');\n    return uVar5;\n  }\n  return uVar4;\n}" primitive_type (function_declarator "dir_len(char *file)" identifier (parameter_list "(char *file)" ( (parameter_declaration "char *file" primitive_type (pointer_declarator "*file" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  uint uVar5;\n  \n  cVar1 = *file;\n  pcVar3 = last_component(file);\n  uVar4 = (int)pcVar3 - (int)file;\n  if (((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')) {\n    do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');\n    return uVar5;\n  }\n  return uVar4;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "cVar1 = *file;" (assignment_expression "cVar1 = *file" identifier = (pointer_expression "*file" * identifier)) ;) (expression_statement "pcVar3 = last_component(file);" (assignment_expression "pcVar3 = last_component(file)" identifier = (call_expression "last_component(file)" identifier (argument_list "(file)" ( identifier )))) ;) (expression_statement "uVar4 = (int)pcVar3 - (int)file;" (assignment_expression "uVar4 = (int)pcVar3 - (int)file" identifier = (binary_expression "(int)pcVar3 - (int)file" (cast_expression "(int)pcVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)file" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')) {\n    do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');\n    return uVar5;\n  }" if (parenthesized_expression "(((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/'))" ( (binary_expression "((cVar1 == '/') < uVar4) && (pcVar3[-1] == '/')" (parenthesized_expression "((cVar1 == '/') < uVar4)" ( (binary_expression "(cVar1 == '/') < uVar4" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) < identifier) )) && (parenthesized_expression "(pcVar3[-1] == '/')" ( (binary_expression "pcVar3[-1] == '/'" (subscript_expression "pcVar3[-1]" identifier [ number_literal ]) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');\n    return uVar5;\n  }" { (do_statement "do {\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    } while (file[iVar2] == '/');" do (compound_statement "{\n      uVar5 = uVar4 - 1;\n      if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }\n      iVar2 = uVar4 - 2;\n      uVar4 = uVar5;\n    }" { (expression_statement "uVar5 = uVar4 - 1;" (assignment_expression "uVar5 = uVar4 - 1" identifier = (binary_expression "uVar4 - 1" identifier - number_literal)) ;) (if_statement "if ((cVar1 == '/') == uVar5) {\n        return uVar5;\n      }" if (parenthesized_expression "((cVar1 == '/') == uVar5)" ( (binary_expression "(cVar1 == '/') == uVar5" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) == identifier) )) (compound_statement "{\n        return uVar5;\n      }" { (return_statement "return uVar5;" return identifier ;) })) (expression_statement "iVar2 = uVar4 - 2;" (assignment_expression "iVar2 = uVar4 - 2" identifier = (binary_expression "uVar4 - 2" identifier - number_literal)) ;) (expression_statement "uVar4 = uVar5;" (assignment_expression "uVar4 = uVar5" identifier = identifier) ;) }) while (parenthesized_expression "(file[iVar2] == '/')" ( (binary_expression "file[iVar2] == '/'" (subscript_expression "file[iVar2]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) )) ;) (return_statement "return uVar5;" return identifier ;) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "uint FUN_0001cca0(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}\n\n" (function_definition "uint FUN_0001cca0(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_0001cca0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "cVar1 = *param_1;" (assignment_expression "cVar1 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "iVar2 = FUN_0001cd80(param_1);" (assignment_expression "iVar2 = FUN_0001cd80(param_1)" identifier = (call_expression "FUN_0001cd80(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "uVar3 = iVar2 - (int)param_1;" (assignment_expression "uVar3 = iVar2 - (int)param_1" identifier = (binary_expression "iVar2 - (int)param_1" identifier - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (if_statement "if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" if (parenthesized_expression "(((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/'))" ( (binary_expression "((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')" (parenthesized_expression "((cVar1 == '/') < uVar3)" ( (binary_expression "(cVar1 == '/') < uVar3" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) < identifier) )) && (parenthesized_expression "(*(char *)(iVar2 + -1) == '/')" ( (binary_expression "*(char *)(iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar2 + -1)" * (cast_expression "(char *)(iVar2 + -1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + -1)" ( (binary_expression "iVar2 + -1" identifier + number_literal) )))) == (char_literal "'/'" ' character ')) ))) )) (compound_statement "{\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" { (do_statement "do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');" do (compound_statement "{\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    }" { (expression_statement "uVar4 = uVar3 - 1;" (assignment_expression "uVar4 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (if_statement "if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }" if (parenthesized_expression "((cVar1 == '/') == uVar4)" ( (binary_expression "(cVar1 == '/') == uVar4" (parenthesized_expression "(cVar1 == '/')" ( (binary_expression "cVar1 == '/'" identifier == (char_literal "'/'" ' character ')) )) == identifier) )) (compound_statement "{\n        return uVar4;\n      }" { (return_statement "return uVar4;" return identifier ;) })) (expression_statement "iVar2 = uVar3 - 2;" (assignment_expression "iVar2 = uVar3 - 2" identifier = (binary_expression "uVar3 - 2" identifier - number_literal)) ;) (expression_statement "uVar3 = uVar4;" (assignment_expression "uVar3 = uVar4" identifier = identifier) ;) }) while (parenthesized_expression "(param_1[iVar2] == '/')" ( (binary_expression "param_1[iVar2] == '/'" (subscript_expression "param_1[iVar2]" identifier [ identifier ]) == (char_literal "'/'" ' character ')) )) ;) (return_statement "return uVar4;" return identifier ;) })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (char_literal ' character ')) )) < IDENT) )) && (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == (char_literal ' character ')) ))) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (char_literal ' character ')) )) == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ IDENT ]) == (char_literal ' character ')) )) ;) (return_statement return IDENT ;) })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_0001cca0(char *param_1)\n\n{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\n}" (type_identifier "uint") (function_declarator "FUN_0001cca0(char *param_1)" (identifier "FUN_0001cca0") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  cVar1 = *param_1;\n  iVar2 = FUN_0001cd80(param_1);\n  uVar3 = iVar2 - (int)param_1;\n  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }\n  return uVar3;\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 "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "cVar1 = *param_1;" (assignment_expression "cVar1 = *param_1" (identifier "cVar1") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "iVar2 = FUN_0001cd80(param_1);" (assignment_expression "iVar2 = FUN_0001cd80(param_1)" (identifier "iVar2") (= "=") (call_expression "FUN_0001cd80(param_1)" (identifier "FUN_0001cd80") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "uVar3 = iVar2 - (int)param_1;" (assignment_expression "uVar3 = iVar2 - (int)param_1" (identifier "uVar3") (= "=") (binary_expression "iVar2 - (int)param_1" (identifier "iVar2") (- "-") (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")))) (; ";")) (if_statement "if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" (if "if") (parenthesized_expression "(((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/'))" (( "(") (binary_expression "((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')" (parenthesized_expression "((cVar1 == '/') < uVar3)" (( "(") (binary_expression "(cVar1 == '/') < uVar3" (parenthesized_expression "(cVar1 == '/')" (( "(") (binary_expression "cVar1 == '/'" (identifier "cVar1") (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (< "<") (identifier "uVar3")) () ")")) (&& "&&") (parenthesized_expression "(*(char *)(iVar2 + -1) == '/')" (( "(") (binary_expression "*(char *)(iVar2 + -1) == '/'" (pointer_expression "*(char *)(iVar2 + -1)" (* "*") (cast_expression "(char *)(iVar2 + -1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + -1)" (( "(") (binary_expression "iVar2 + -1" (identifier "iVar2") (+ "+") (number_literal "-1")) () ")")))) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")"))) () ")")) (compound_statement "{\n    do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');\n    return uVar4;\n  }" ({ "{") (do_statement "do {\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    } while (param_1[iVar2] == '/');" (do "do") (compound_statement "{\n      uVar4 = uVar3 - 1;\n      if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }\n      iVar2 = uVar3 - 2;\n      uVar3 = uVar4;\n    }" ({ "{") (expression_statement "uVar4 = uVar3 - 1;" (assignment_expression "uVar4 = uVar3 - 1" (identifier "uVar4") (= "=") (binary_expression "uVar3 - 1" (identifier "uVar3") (- "-") (number_literal "1"))) (; ";")) (if_statement "if ((cVar1 == '/') == uVar4) {\n        return uVar4;\n      }" (if "if") (parenthesized_expression "((cVar1 == '/') == uVar4)" (( "(") (binary_expression "(cVar1 == '/') == uVar4" (parenthesized_expression "(cVar1 == '/')" (( "(") (binary_expression "cVar1 == '/'" (identifier "cVar1") (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (== "==") (identifier "uVar4")) () ")")) (compound_statement "{\n        return uVar4;\n      }" ({ "{") (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}"))) (expression_statement "iVar2 = uVar3 - 2;" (assignment_expression "iVar2 = uVar3 - 2" (identifier "iVar2") (= "=") (binary_expression "uVar3 - 2" (identifier "uVar3") (- "-") (number_literal "2"))) (; ";")) (expression_statement "uVar3 = uVar4;" (assignment_expression "uVar3 = uVar4" (identifier "uVar3") (= "=") (identifier "uVar4")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_1[iVar2] == '/')" (( "(") (binary_expression "param_1[iVar2] == '/'" (subscript_expression "param_1[iVar2]" (identifier "param_1") ([ "[") (identifier "iVar2") (] "]")) (== "==") (char_literal "'/'" (' "'") (character "/") (' "'"))) () ")")) (; ";")) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}"))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

size_t function_1(char *file)

{
  char var_2;
  int iVar2;
  char *pcVar3;
  type_1 var_3;
  type_1 var_4;
  
  var_2 = *file;
  pcVar3 = var_1(file);
  var_3 = (int)pcVar3 - (int)file;
  if (((var_2 == '/') < var_3) && (pcVar3[-1] == '/')) {
    do {
      var_4 = var_3 - 1;
      if ((var_2 == '/') == var_4) {
        return var_4;
      }
      iVar2 = var_3 - 2;
      var_3 = var_4;
    } while (file[iVar2] == '/');
    return var_4;
  }
  return var_3;
}


(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))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (character)))) right: (identifier))) right: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (char_literal (character)))))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (character)))) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (char_literal (character))))) (return_statement (identifier)))) (return_statement (identifier)))))

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

uint MASKED(char *param_1)

{
  char cVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  
  cVar1 = *param_1;
  iVar2 = FUN_0001cd80(param_1);
  uVar3 = iVar2 - (int)param_1;
  if (((cVar1 == '/') < uVar3) && (*(char *)(iVar2 + -1) == '/')) {
    do {
      uVar4 = uVar3 - 1;
      if ((cVar1 == '/') == uVar4) {
        return uVar4;
      }
      iVar2 = uVar3 - 2;
      uVar3 = uVar4;
    } while (param_1[iVar2] == '/');
    return uVar4;
  }
  return uVar3;
}

