
char * xstrdup(char *string)

{
  char cVar1;
  char *pcVar2;
  ulong uVar3;
  
  uVar3 = 0xffffffffffffffff;
  pcVar2 = string;
  do {
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    cVar1 = *pcVar2;
    pcVar2 = pcVar2 + 1;
  } while (cVar1 != '\0');
  pcVar2 = (char *)xmemdup(string,~uVar3);
  return pcVar2;
}



void FUN_00106ce0(char *param_1)

{
  char cVar1;
  ulong uVar2;
  char *pcVar3;
  
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_1;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_00106cb7(param_1,~uVar2);
  return;
}


SUB RSP,0x8
MOV RDX,RDI
MOV RCX,-0x1
MOV EAX,0x0
SCASB.REPNE RDI
NOT RCX
MOV RSI,RCX
MOV RDI,RDX
CALL 0x00106cb7
ADD RSP,0x8
RET
(translation_unit "void FUN_00106ce0(char *param_1)\n\n{\n  char cVar1;\n  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}\n\n" (function_definition "void FUN_00106ce0(char *param_1)\n\n{\n  char cVar1;\n  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" primitive_type (function_declarator "FUN_00106ce0(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  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "uVar2 = 0xffffffffffffffff;" (assignment_expression "uVar2 = 0xffffffffffffffff" identifier = number_literal) ;) (expression_statement "pcVar3 = param_1;" (assignment_expression "pcVar3 = param_1" identifier = identifier) ;) (do_statement "do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  }" { (if_statement "if (uVar2 == 0) break;" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "FUN_00106cb7(param_1,~uVar2);" (call_expression "FUN_00106cb7(param_1,~uVar2)" identifier (argument_list "(param_1,~uVar2)" ( identifier , (unary_expression "~uVar2" ~ identifier) ))) ;) (return_statement "return;" return ;) })))
(translation_unit "char * xstrdup(char *string)\n\n{\n  char cVar1;\n  char *pcVar2;\n  ulong uVar3;\n  \n  uVar3 = 0xffffffffffffffff;\n  pcVar2 = string;\n  do {\n    if (uVar3 == 0) break;\n    uVar3 = uVar3 - 1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + 1;\n  } while (cVar1 != '\0');\n  pcVar2 = (char *)xmemdup(string,~uVar3);\n  return pcVar2;\n}\n\n" (function_definition "char * xstrdup(char *string)\n\n{\n  char cVar1;\n  char *pcVar2;\n  ulong uVar3;\n  \n  uVar3 = 0xffffffffffffffff;\n  pcVar2 = string;\n  do {\n    if (uVar3 == 0) break;\n    uVar3 = uVar3 - 1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + 1;\n  } while (cVar1 != '\0');\n  pcVar2 = (char *)xmemdup(string,~uVar3);\n  return pcVar2;\n}" primitive_type (pointer_declarator "* xstrdup(char *string)" * (function_declarator "xstrdup(char *string)" identifier (parameter_list "(char *string)" ( (parameter_declaration "char *string" primitive_type (pointer_declarator "*string" * identifier)) )))) (compound_statement "{\n  char cVar1;\n  char *pcVar2;\n  ulong uVar3;\n  \n  uVar3 = 0xffffffffffffffff;\n  pcVar2 = string;\n  do {\n    if (uVar3 == 0) break;\n    uVar3 = uVar3 - 1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + 1;\n  } while (cVar1 != '\0');\n  pcVar2 = (char *)xmemdup(string,~uVar3);\n  return pcVar2;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "ulong uVar3;" type_identifier identifier ;) (expression_statement "uVar3 = 0xffffffffffffffff;" (assignment_expression "uVar3 = 0xffffffffffffffff" identifier = number_literal) ;) (expression_statement "pcVar2 = string;" (assignment_expression "pcVar2 = string" identifier = identifier) ;) (do_statement "do {\n    if (uVar3 == 0) break;\n    uVar3 = uVar3 - 1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (uVar3 == 0) break;\n    uVar3 = uVar3 - 1;\n    cVar1 = *pcVar2;\n    pcVar2 = pcVar2 + 1;\n  }" { (if_statement "if (uVar3 == 0) break;" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) (expression_statement "cVar1 = *pcVar2;" (assignment_expression "cVar1 = *pcVar2" identifier = (pointer_expression "*pcVar2" * identifier)) ;) (expression_statement "pcVar2 = pcVar2 + 1;" (assignment_expression "pcVar2 = pcVar2 + 1" identifier = (binary_expression "pcVar2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "pcVar2 = (char *)xmemdup(string,~uVar3);" (assignment_expression "pcVar2 = (char *)xmemdup(string,~uVar3)" identifier = (cast_expression "(char *)xmemdup(string,~uVar3)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmemdup(string,~uVar3)" identifier (argument_list "(string,~uVar3)" ( identifier , (unary_expression "~uVar3" ~ identifier) ))))) ;) (return_statement "return pcVar2;" return identifier ;) })))
(translation_unit "void FUN_00106ce0(char *param_1)\n\n{\n  char cVar1;\n  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}\n\n" (function_definition "void FUN_00106ce0(char *param_1)\n\n{\n  char cVar1;\n  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" primitive_type (function_declarator "FUN_00106ce0(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  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "ulong uVar2;" type_identifier identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (expression_statement "uVar2 = 0xffffffffffffffff;" (assignment_expression "uVar2 = 0xffffffffffffffff" identifier = number_literal) ;) (expression_statement "pcVar3 = param_1;" (assignment_expression "pcVar3 = param_1" identifier = identifier) ;) (do_statement "do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');" do (compound_statement "{\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  }" { (if_statement "if (uVar2 == 0) break;" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" identifier = (binary_expression "pcVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "FUN_00106cb7(param_1,~uVar2);" (call_expression "FUN_00106cb7(param_1,~uVar2)" identifier (argument_list "(param_1,~uVar2)" ( identifier , (unary_expression "~uVar2" ~ identifier) ))) ;) (return_statement "return;" return ;) })))
(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 (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (unary_expression ~ IDENT) ))) ;) (return_statement return ;) })))
(function_definition "void FUN_00106ce0(char *param_1)\n\n{\n  char cVar1;\n  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00106ce0(char *param_1)" (identifier "FUN_00106ce0") (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  ulong uVar2;\n  char *pcVar3;\n  \n  uVar2 = 0xffffffffffffffff;\n  pcVar3 = param_1;\n  do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');\n  FUN_00106cb7(param_1,~uVar2);\n  return;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "ulong uVar2;" (type_identifier "ulong") (identifier "uVar2") (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (expression_statement "uVar2 = 0xffffffffffffffff;" (assignment_expression "uVar2 = 0xffffffffffffffff" (identifier "uVar2") (= "=") (number_literal "0xffffffffffffffff")) (; ";")) (expression_statement "pcVar3 = param_1;" (assignment_expression "pcVar3 = param_1" (identifier "pcVar3") (= "=") (identifier "param_1")) (; ";")) (do_statement "do {\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  } while (cVar1 != '\0');" (do "do") (compound_statement "{\n    if (uVar2 == 0) break;\n    uVar2 = uVar2 - 1;\n    cVar1 = *pcVar3;\n    pcVar3 = pcVar3 + 1;\n  }" ({ "{") (if_statement "if (uVar2 == 0) break;" (if "if") (parenthesized_expression "(uVar2 == 0)" (( "(") (binary_expression "uVar2 == 0" (identifier "uVar2") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" (identifier "uVar2") (= "=") (binary_expression "uVar2 - 1" (identifier "uVar2") (- "-") (number_literal "1"))) (; ";")) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" (identifier "cVar1") (= "=") (pointer_expression "*pcVar3" (* "*") (identifier "pcVar3"))) (; ";")) (expression_statement "pcVar3 = pcVar3 + 1;" (assignment_expression "pcVar3 = pcVar3 + 1" (identifier "pcVar3") (= "=") (binary_expression "pcVar3 + 1" (identifier "pcVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (; ";")) (expression_statement "FUN_00106cb7(param_1,~uVar2);" (call_expression "FUN_00106cb7(param_1,~uVar2)" (identifier "FUN_00106cb7") (argument_list "(param_1,~uVar2)" (( "(") (identifier "param_1") (, ",") (unary_expression "~uVar2" (~ "~") (identifier "uVar2")) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

char * function_1(char *string)

{
  char var_3;
  char *var_2;
  type_1 var_1;
  
  var_1 = 0xffffffffffffffff;
  var_2 = string;
  do {
    if (var_1 == 0) break;
    var_1 = var_1 - 1;
    var_3 = *var_2;
    var_2 = var_2 + 1;
  } while (var_3 != '\0');
  var_2 = (char *)var_4(string,~var_1);
  return var_2;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (unary_expression argument: (identifier))))) (return_statement))))

void MASKED(char *param_1)

{
  char cVar1;
  ulong uVar2;
  char *pcVar3;
  
  uVar2 = 0xffffffffffffffff;
  pcVar3 = param_1;
  do {
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    cVar1 = *pcVar3;
    pcVar3 = pcVar3 + 1;
  } while (cVar1 != '\0');
  FUN_00106cb7(param_1,~uVar2);
  return;
}

