
char * template_in_dir(char *path)

{
  char *pcVar1;
  size_t __n;
  void *__dest;
  char *pcVar2;
  
  pcVar1 = strrchr(path,0x2f);
  if (pcVar1 == (char *)0x0) {
    pcVar1 = (char *)xmalloc(9);
    pcVar2 = pcVar1;
  }
  else {
    __n = (long)pcVar1 - (long)path;
    __dest = (void *)xmalloc(__n + 0xb);
    pcVar2 = (char *)memcpy(__dest,path,__n);
    pcVar2[__n] = '/';
    pcVar1 = pcVar2 + __n + 1;
  }
  builtin_strncpy(pcVar1,"stXXXXXX",9);
  return pcVar2;
}



undefined8 * FUN_00103130(char *param_1)

{
  char *pcVar1;
  size_t __n;
  void *__dest;
  undefined8 *puVar2;
  undefined8 *puVar3;
  
  pcVar1 = strrchr(param_1,0x2f);
  if (pcVar1 == (char *)0x0) {
    puVar3 = (undefined8 *)xmalloc(9);
    puVar2 = puVar3;
  }
  else {
    __n = (long)pcVar1 - (long)param_1;
    __dest = (void *)xmalloc(__n + 0xb);
    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);
    *(undefined1 *)((long)puVar2 + __n) = 0x2f;
    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);
  }
  *(undefined1 *)(puVar3 + 1) = 0;
  *puVar3 = 0x5858585858587473;
  return puVar2;
}


PUSH RBP
MOV ESI,0x2f
MOV RBP,RDI
PUSH RBX
SUB RSP,0x8
CALL 0x001021b0
TEST RAX,RAX
JZ 0x00103190
SUB RAX,RBP
LEA RDI,[RAX + 0xb]
MOV RBX,RAX
CALL 0x00102210
MOV RDX,RBX
MOV RSI,RBP
MOV RDI,RAX
CALL 0x001022c0
MOV RCX,RAX
MOV byte ptr [RAX + RBX*0x1],0x2f
LEA RAX,[RAX + RBX*0x1 + 0x1]
MOV RDX,0x5858585858587473
MOV byte ptr [RAX + 0x8],0x0
MOV qword ptr [RAX],RDX
ADD RSP,0x8
MOV RAX,RCX
POP RBX
POP RBP
RET
MOV EDI,0x9
CALL 0x00102210
MOV RCX,RAX
JMP 0x00103171
(translation_unit "undefined8 * FUN_00103130(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}\n\n" (function_definition "undefined8 * FUN_00103130(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" type_identifier (pointer_declarator "* FUN_00103130(char *param_1)" * (function_declarator "FUN_00103130(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 *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined8 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined8 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" identifier = (call_expression "strrchr(param_1,0x2f)" identifier (argument_list "(param_1,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }" { (expression_statement "puVar3 = (undefined8 *)xmalloc(9);" (assignment_expression "puVar3 = (undefined8 *)xmalloc(9)" identifier = (cast_expression "(undefined8 *)xmalloc(9)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" identifier = identifier) ;) }) (else_clause "else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" else (compound_statement "{\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" { (expression_statement "__n = (long)pcVar1 - (long)param_1;" (assignment_expression "__n = (long)pcVar1 - (long)param_1" identifier = (binary_expression "(long)pcVar1 - (long)param_1" (cast_expression "(long)pcVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (void *)xmalloc(__n + 0xb)" identifier = (cast_expression "(void *)xmalloc(__n + 0xb)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" identifier + number_literal) ))))) ;) (expression_statement "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);" (assignment_expression "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n)" identifier = (cast_expression "(undefined8 *)memcpy(__dest,param_1,__n)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,param_1,__n)" identifier (argument_list "(__dest,param_1,__n)" ( identifier , identifier , identifier ))))) ;) (expression_statement "*(undefined1 *)((long)puVar2 + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((long)puVar2 + __n) = 0x2f" (pointer_expression "*(undefined1 *)((long)puVar2 + __n)" * (cast_expression "(undefined1 *)((long)puVar2 + __n)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar2 + __n)" ( (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "puVar3 = (undefined8 *)((long)puVar2 + __n + 1);" (assignment_expression "puVar3 = (undefined8 *)((long)puVar2 + __n + 1)" identifier = (cast_expression "(undefined8 *)((long)puVar2 + __n + 1)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar2 + __n + 1)" ( (binary_expression "(long)puVar2 + __n + 1" (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) + number_literal) )))) ;) }))) (expression_statement "*(undefined1 *)(puVar3 + 1) = 0;" (assignment_expression "*(undefined1 *)(puVar3 + 1) = 0" (pointer_expression "*(undefined1 *)(puVar3 + 1)" * (cast_expression "(undefined1 *)(puVar3 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 1)" ( (binary_expression "puVar3 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*puVar3 = 0x5858585858587473;" (assignment_expression "*puVar3 = 0x5858585858587473" (pointer_expression "*puVar3" * identifier) = number_literal) ;) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit "char * template_in_dir(char *path)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  char *pcVar2;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    pcVar2 = pcVar1;\n  }\n  else {\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return pcVar2;\n}\n\n" (function_definition "char * template_in_dir(char *path)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  char *pcVar2;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    pcVar2 = pcVar1;\n  }\n  else {\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return pcVar2;\n}" primitive_type (pointer_declarator "* template_in_dir(char *path)" * (function_declarator "template_in_dir(char *path)" identifier (parameter_list "(char *path)" ( (parameter_declaration "char *path" primitive_type (pointer_declarator "*path" * identifier)) )))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  char *pcVar2;\n  \n  pcVar1 = strrchr(path,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    pcVar2 = pcVar1;\n  }\n  else {\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }\n  builtin_strncpy(pcVar1,"stXXXXXX",9);\n  return pcVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (expression_statement "pcVar1 = strrchr(path,0x2f);" (assignment_expression "pcVar1 = strrchr(path,0x2f)" identifier = (call_expression "strrchr(path,0x2f)" identifier (argument_list "(path,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    pcVar1 = (char *)xmalloc(9);\n    pcVar2 = pcVar1;\n  }\n  else {\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    pcVar1 = (char *)xmalloc(9);\n    pcVar2 = pcVar1;\n  }" { (expression_statement "pcVar1 = (char *)xmalloc(9);" (assignment_expression "pcVar1 = (char *)xmalloc(9)" identifier = (cast_expression "(char *)xmalloc(9)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "pcVar2 = pcVar1;" (assignment_expression "pcVar2 = pcVar1" identifier = identifier) ;) }) (else_clause "else {\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }" else (compound_statement "{\n    __n = (long)pcVar1 - (long)path;\n    __dest = (void *)xmalloc(__n + 0xb);\n    pcVar2 = (char *)memcpy(__dest,path,__n);\n    pcVar2[__n] = '/';\n    pcVar1 = pcVar2 + __n + 1;\n  }" { (expression_statement "__n = (long)pcVar1 - (long)path;" (assignment_expression "__n = (long)pcVar1 - (long)path" identifier = (binary_expression "(long)pcVar1 - (long)path" (cast_expression "(long)pcVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)path" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (void *)xmalloc(__n + 0xb)" identifier = (cast_expression "(void *)xmalloc(__n + 0xb)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" identifier + number_literal) ))))) ;) (expression_statement "pcVar2 = (char *)memcpy(__dest,path,__n);" (assignment_expression "pcVar2 = (char *)memcpy(__dest,path,__n)" identifier = (cast_expression "(char *)memcpy(__dest,path,__n)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,path,__n)" identifier (argument_list "(__dest,path,__n)" ( identifier , identifier , identifier ))))) ;) (expression_statement "pcVar2[__n] = '/';" (assignment_expression "pcVar2[__n] = '/'" (subscript_expression "pcVar2[__n]" identifier [ identifier ]) = (char_literal "'/'" ' character ')) ;) (expression_statement "pcVar1 = pcVar2 + __n + 1;" (assignment_expression "pcVar1 = pcVar2 + __n + 1" identifier = (binary_expression "pcVar2 + __n + 1" (binary_expression "pcVar2 + __n" identifier + identifier) + number_literal)) ;) }))) (expression_statement "builtin_strncpy(pcVar1,"stXXXXXX",9);" (call_expression "builtin_strncpy(pcVar1,"stXXXXXX",9)" identifier (argument_list "(pcVar1,"stXXXXXX",9)" ( identifier , (string_literal ""stXXXXXX"" " string_content ") , number_literal ))) ;) (return_statement "return pcVar2;" return identifier ;) })))
(translation_unit "undefined8 * FUN_00103130(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}\n\n" (function_definition "undefined8 * FUN_00103130(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" type_identifier (pointer_declarator "* FUN_00103130(char *param_1)" * (function_declarator "FUN_00103130(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 *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined8 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined8 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" identifier = (call_expression "strrchr(param_1,0x2f)" identifier (argument_list "(param_1,0x2f)" ( identifier , number_literal )))) ;) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" if (parenthesized_expression "(pcVar1 == (char *)0x0)" ( (binary_expression "pcVar1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }" { (expression_statement "puVar3 = (undefined8 *)xmalloc(9);" (assignment_expression "puVar3 = (undefined8 *)xmalloc(9)" identifier = (cast_expression "(undefined8 *)xmalloc(9)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(9)" identifier (argument_list "(9)" ( number_literal ))))) ;) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" identifier = identifier) ;) }) (else_clause "else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" else (compound_statement "{\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" { (expression_statement "__n = (long)pcVar1 - (long)param_1;" (assignment_expression "__n = (long)pcVar1 - (long)param_1" identifier = (binary_expression "(long)pcVar1 - (long)param_1" (cast_expression "(long)pcVar1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "__dest = (void *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (void *)xmalloc(__n + 0xb)" identifier = (cast_expression "(void *)xmalloc(__n + 0xb)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(__n + 0xb)" identifier (argument_list "(__n + 0xb)" ( (binary_expression "__n + 0xb" identifier + number_literal) ))))) ;) (expression_statement "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);" (assignment_expression "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n)" identifier = (cast_expression "(undefined8 *)memcpy(__dest,param_1,__n)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,param_1,__n)" identifier (argument_list "(__dest,param_1,__n)" ( identifier , identifier , identifier ))))) ;) (expression_statement "*(undefined1 *)((long)puVar2 + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((long)puVar2 + __n) = 0x2f" (pointer_expression "*(undefined1 *)((long)puVar2 + __n)" * (cast_expression "(undefined1 *)((long)puVar2 + __n)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar2 + __n)" ( (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "puVar3 = (undefined8 *)((long)puVar2 + __n + 1);" (assignment_expression "puVar3 = (undefined8 *)((long)puVar2 + __n + 1)" identifier = (cast_expression "(undefined8 *)((long)puVar2 + __n + 1)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar2 + __n + 1)" ( (binary_expression "(long)puVar2 + __n + 1" (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) + number_literal) )))) ;) }))) (expression_statement "*(undefined1 *)(puVar3 + 1) = 0;" (assignment_expression "*(undefined1 *)(puVar3 + 1) = 0" (pointer_expression "*(undefined1 *)(puVar3 + 1)" * (cast_expression "(undefined1 *)(puVar3 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 1)" ( (binary_expression "puVar3 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*puVar3 = 0x5858585858587473;" (assignment_expression "*puVar3 = 0x5858585858587473" (pointer_expression "*puVar3" * identifier) = number_literal) ;) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) + LIT) )))) ;) }))) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "undefined8 * FUN_00103130(char *param_1)\n\n{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" (type_identifier "undefined8") (pointer_declarator "* FUN_00103130(char *param_1)" (* "*") (function_declarator "FUN_00103130(char *param_1)" (identifier "FUN_00103130") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  char *pcVar1;\n  size_t __n;\n  void *__dest;\n  undefined8 *puVar2;\n  undefined8 *puVar3;\n  \n  pcVar1 = strrchr(param_1,0x2f);\n  if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }\n  *(undefined1 *)(puVar3 + 1) = 0;\n  *puVar3 = 0x5858585858587473;\n  return puVar2;\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "void *__dest;" (primitive_type "void") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "undefined8 *puVar2;" (type_identifier "undefined8") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "undefined8 *puVar3;" (type_identifier "undefined8") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (expression_statement "pcVar1 = strrchr(param_1,0x2f);" (assignment_expression "pcVar1 = strrchr(param_1,0x2f)" (identifier "pcVar1") (= "=") (call_expression "strrchr(param_1,0x2f)" (identifier "strrchr") (argument_list "(param_1,0x2f)" (( "(") (identifier "param_1") (, ",") (number_literal "0x2f") () ")")))) (; ";")) (if_statement "if (pcVar1 == (char *)0x0) {\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }\n  else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" (if "if") (parenthesized_expression "(pcVar1 == (char *)0x0)" (( "(") (binary_expression "pcVar1 == (char *)0x0" (identifier "pcVar1") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    puVar3 = (undefined8 *)xmalloc(9);\n    puVar2 = puVar3;\n  }" ({ "{") (expression_statement "puVar3 = (undefined8 *)xmalloc(9);" (assignment_expression "puVar3 = (undefined8 *)xmalloc(9)" (identifier "puVar3") (= "=") (cast_expression "(undefined8 *)xmalloc(9)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(9)" (identifier "xmalloc") (argument_list "(9)" (( "(") (number_literal "9") () ")"))))) (; ";")) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" (identifier "puVar2") (= "=") (identifier "puVar3")) (; ";")) (} "}")) (else_clause "else {\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" (else "else") (compound_statement "{\n    __n = (long)pcVar1 - (long)param_1;\n    __dest = (void *)xmalloc(__n + 0xb);\n    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);\n    *(undefined1 *)((long)puVar2 + __n) = 0x2f;\n    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);\n  }" ({ "{") (expression_statement "__n = (long)pcVar1 - (long)param_1;" (assignment_expression "__n = (long)pcVar1 - (long)param_1" (identifier "__n") (= "=") (binary_expression "(long)pcVar1 - (long)param_1" (cast_expression "(long)pcVar1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "pcVar1")) (- "-") (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")))) (; ";")) (expression_statement "__dest = (void *)xmalloc(__n + 0xb);" (assignment_expression "__dest = (void *)xmalloc(__n + 0xb)" (identifier "__dest") (= "=") (cast_expression "(void *)xmalloc(__n + 0xb)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(__n + 0xb)" (identifier "xmalloc") (argument_list "(__n + 0xb)" (( "(") (binary_expression "__n + 0xb" (identifier "__n") (+ "+") (number_literal "0xb")) () ")"))))) (; ";")) (expression_statement "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);" (assignment_expression "puVar2 = (undefined8 *)memcpy(__dest,param_1,__n)" (identifier "puVar2") (= "=") (cast_expression "(undefined8 *)memcpy(__dest,param_1,__n)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "memcpy(__dest,param_1,__n)" (identifier "memcpy") (argument_list "(__dest,param_1,__n)" (( "(") (identifier "__dest") (, ",") (identifier "param_1") (, ",") (identifier "__n") () ")"))))) (; ";")) (expression_statement "*(undefined1 *)((long)puVar2 + __n) = 0x2f;" (assignment_expression "*(undefined1 *)((long)puVar2 + __n) = 0x2f" (pointer_expression "*(undefined1 *)((long)puVar2 + __n)" (* "*") (cast_expression "(undefined1 *)((long)puVar2 + __n)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar2 + __n)" (( "(") (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar2")) (+ "+") (identifier "__n")) () ")")))) (= "=") (number_literal "0x2f")) (; ";")) (expression_statement "puVar3 = (undefined8 *)((long)puVar2 + __n + 1);" (assignment_expression "puVar3 = (undefined8 *)((long)puVar2 + __n + 1)" (identifier "puVar3") (= "=") (cast_expression "(undefined8 *)((long)puVar2 + __n + 1)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar2 + __n + 1)" (( "(") (binary_expression "(long)puVar2 + __n + 1" (binary_expression "(long)puVar2 + __n" (cast_expression "(long)puVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar2")) (+ "+") (identifier "__n")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (} "}")))) (expression_statement "*(undefined1 *)(puVar3 + 1) = 0;" (assignment_expression "*(undefined1 *)(puVar3 + 1) = 0" (pointer_expression "*(undefined1 *)(puVar3 + 1)" (* "*") (cast_expression "(undefined1 *)(puVar3 + 1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + 1)" (( "(") (binary_expression "puVar3 + 1" (identifier "puVar3") (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*puVar3 = 0x5858585858587473;" (assignment_expression "*puVar3 = 0x5858585858587473" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (number_literal "0x5858585858587473")) (; ";")) (return_statement "return puVar2;" (return "return") (identifier "puVar2") (; ";")) (} "}")))

char * function_1(char *path)

{
  char *var_2;
  size_t var_4;
  void *__dest;
  char *var_6;
  
  var_2 = var_1(path,0x2f);
  if (var_2 == (char *)0x0) {
    var_2 = (char *)var_3(9);
    var_6 = var_2;
  }
  else {
    var_4 = (long)var_2 - (long)path;
    __dest = (void *)var_3(var_4 + 0xb);
    var_6 = (char *)var_5(__dest,path,var_4);
    var_6[var_4] = '/';
    var_2 = var_6 + var_4 + 1;
  }
  var_7(var_2,"stXXXXXX",9);
  return var_6;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator 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: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier))))) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)) right: (number_literal))))))))) (expression_statement (assignment_expression left: (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))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement (identifier)))))

undefined8 * MASKED(char *param_1)

{
  char *pcVar1;
  size_t __n;
  void *__dest;
  undefined8 *puVar2;
  undefined8 *puVar3;
  
  pcVar1 = strrchr(param_1,0x2f);
  if (pcVar1 == (char *)0x0) {
    puVar3 = (undefined8 *)xmalloc(9);
    puVar2 = puVar3;
  }
  else {
    __n = (long)pcVar1 - (long)param_1;
    __dest = (void *)xmalloc(__n + 0xb);
    puVar2 = (undefined8 *)memcpy(__dest,param_1,__n);
    *(undefined1 *)((long)puVar2 + __n) = 0x2f;
    puVar3 = (undefined8 *)((long)puVar2 + __n + 1);
  }
  *(undefined1 *)(puVar3 + 1) = 0;
  *puVar3 = 0x5858585858587473;
  return puVar2;
}

