decompiled_code:
int __fastcall print_stretchy_bin_of_bins(__int64 a1, const char *a2)
{
int result; // eax
__int64 v3; // rbx
char v4[2072]; // [rsp+0h] [rbp-818h] BYREF

result = printf("Bin (%s) has capacity %d and %d items.\n", a2, *(unsigned int *)(a1 + 8), *(unsigned int *)(a1 + 12));
if ( *(_DWORD *)(a1 + 12) )
{
v3 = 0LL;
do
{
sprintf(v4, "%s (part %d)", a2, (unsigned int)v3);
result = print_stretchy_bin(*(unsigned int *)(*(_QWORD *)a1 + 4 * v3++), v4);
}
while ( *(_DWORD *)(a1 + 12) > (unsigned int)v3 );
}
return result;
}

canonical_decompiled_code:
int __fastcall func12(__int64 a1, const char *a2)
{
int result; // eax
__int64 v3; // rbx
char v4[2072]; // [rsp+0h] [rbp-818h] BYREF

result = printf("Bin (%s) has capacity %d and %d items.\n", a2, *(unsigned int *)(a1 + 8), *(unsigned int *)(a1 + 12));
if ( *(_DWORD *)(a1 + 12) )
{
v3 = 0LL;
do
{
sprintf(v4, "%s (part %d)", a2, (unsigned int)v3);
result = func11(*(unsigned int *)(*(_QWORD *)a1 + 4 * v3++), v4);
}
while ( *(_DWORD *)(a1 + 12) > (unsigned int)v3 );
}
return result;
}

original_code:
void print_stretchy_bin_of_bins(stretchy_bin_t *bin,char *desc){
  int i;
  char newdesc[2048];
  printf("Bin (%s) has capacity %d and %d items.\n",desc,bin->capacity,bin->fill);
  for (i=0;i<bin->fill;i++){
    sprintf(newdesc,"%s (part %d)",desc,i);
    print_stretchy_bin((stretchy_bin_t *)bin->elts[i],newdesc);
  }
}

canonical_original_code:
void print_stretchy_bin_of_bins(struct stretchy_bin_t *bin, char *desc){
  int i;
  char newdesc[2048];
  printf("Bin (%s) has capacity %d and %d items.\n",desc,bin->capacity,bin->fill);
  for (i=0;i<bin->fill;i++){
    sprintf(newdesc,"%s (part %d)",desc,i);
    print_stretchy_bin((struct stretchy_bin_t *)bin->elts[i],newdesc);
  }
}

variable_types:
newdesc
char [2048]


repo: libbybeer/graphstats

decompiled_code:
void __fastcall free_stretchy_bin(void **a1)
{
free(*a1);
}

canonical_decompiled_code:
void __fastcall func13(void **a1)
{
free(*a1);
}

original_code:
void free_stretchy_bin(stretchy_bin_t *bin){
  free(bin->elts);
}

canonical_original_code:
void free_stretchy_bin(struct stretchy_bin_t *bin){
  free(bin->elts);
}

variable_types: struct stretchy_bin_t { unsigned int *elts; unsigned int capacity; unsigned int fill; } *

return_type: void


decompiled_code:
void __fastcall free_stretchy_bin_of_bins(__int64 a1)
{
__int64 v1; // rbx

if ( *(_DWORD *)(a1 + 12) )
{
v1 = 0LL;
do
{
free_stretchy_bin((void **)*(unsigned int *)(*(_QWORD *)a1 + 4 * v1));
free((void *)*(unsigned int *)(*(_QWORD *)a1 + 4 * v1++));
}
while ( *(_DWORD *)(a1 + 12) > (unsigned int)v1 );
}
free(*(void **)a1);
}

canonical_decompiled_code:
void __fastcall func14(__int64 a1)
{
__int64 v1; // rbx

if ( *(_DWORD *)(a1 + 12) )
{
v1 = 0LL;
do
{
func13((void **)*(unsigned int *)(*(_QWORD *)a1 + 4 * v1));
free((void *)*(unsigned int *)(*(_QWORD *)a1 + 4 * v1++));
}
while ( *(_DWORD *)(a1 + 12) > (unsigned int)v1 );
}
free(*(void **)a1);
}

original_code:
void free_stretchy_bin_of_bins(stretchy_bin_t *bin){
  int i;
  for(i=0;i<bin->fill;i++){
    free_stretchy_bin((stretchy_bin_t *)(bin->elts[i]));
    free((stretchy_bin_t *)bin->elts[i]);
  }
  free(bin->elts);
}

canonical_original_code:
void free_stretchy_bin_of_bins(struct stretchy_bin_t *bin){
  int i;
  for(i=0;i<bin->fill;i++){
    free_stretchy_bin((struct stretchy_bin_t *)(bin->elts[i]));
    free((struct stretchy_bin_t *)bin->elts[i]);
  }
  free(bin->elts);
}

variable_types: i int

user_defined_types: struct stretchy_bin_t { unsigned int *elts; unsigned int capacity; unsigned int fill; }


decompiled_code:
void test_stretchy_bin()
{
int i; // ebx
void *v1[3]; // [rsp+0h] [rbp-18h] BYREF

init_stretchy_bin((__int64)v1, 1u);
for ( i = 0; i != 10; ++i )
add_to_stretchy_bin((__int64)v1, i);
print_stretchy_bin((__int64)v1, "testbin");
free_stretchy_bin(v1);
}

original_code:
void test_stretchy_bin(){
  stretchy_bin_t testbin;
  uint32_t i;
  init_stretchy_bin(&testbin,1);
  for (i=0;i<10;i++){
    add_to_stretchy_bin(&testbin,i);
  }
  print_stretchy_bin(&testbin,"testbin");
  free_stretchy_bin(&testbin);
}

canonical_original_code:
void test_stretchy_bin(){
  struct stretchy_bin_t testbin;
  unsigned int i;
  init_stretchy_bin(&testbin,1);
  for (i=0;i<10;i++){
    add_to_stretchy_bin(&testbin,i);
  }
  print_stretchy_bin(&testbin,"testbin");
  free_stretchy_bin(&testbin);
}

variable_types: struct stretchy_bin_t { unsigned int *elts; unsigned int capacity; unsigned int fill; }

variable_types:
i
unsigned int


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
printf("Int is %d bits on this system.\n", 32LL);
process_file();
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
printf("Int is %d bits on this system.\n", 32LL);
func16();
return 0;
}

original_code:
int main(int argc, char **argv){
  printf("Int is %d bits on this system.\n",8*sizeof(int));
  process_file();
  return 0;
}

variable_types: argc int

variable_types:
argv
char **

return_type: int


repo: libdx/AigDownloader

decompiled_code:
__int64 dl_download_widget_get_type_once()
{
__int64 v0; // rbx
__int64 v1; // rax

v0 = g_intern_static_string("DLDownloadWidget");
v1 = gtk_vbox_get_type();
return g_type_register_static_simple(
v1,
v0,
824LL,
dl_download_widget_class_intern_init,
136LL,
dl_download_widget_init,
0LL);
}

canonical_decompiled_code:
__int64 func1()
{
__int64 v0; // rbx
__int64 v1; // rax

v0 = g_intern_static_string("DLDownloadWidget");
v1 = gtk_vbox_get_type();
return g_type_register_static_simple(
v1,
v0,
824LL,
dl_download_widget_class_intern_init,
136LL,
dl_download_widget_init,
0LL);
}

original_code: __attribute__((noinline)) static GType dl_download_widget_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple ((gtk_vbox_get_type ()), g_intern_static_string ("DLDownloadWidget"), sizeof (DLDownloadWidgetClass), (GClassInitFunc)(void (*)(void)) dl_download_widget_class_intern_init, sizeof (DLDownloadWidget), (GInstanceInitFunc)(void (*)(void)) dl_download_widget_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }

canonical_original_code: static unsigned long dl_download_widget_get_type_once() { unsigned long g_define_type_id = g_type_register_static_simple ((gtk_vbox_get_type ()), g_intern_static_string ("DLDownloadWidget"), sizeof (DLDownloadWidgetClass), (GClassInitFunc)(void (*)(void)) dl_download_widget_class_intern_init, sizeof (DLDownloadWidget), (GInstanceInitFunc)(void (*)(void)) dl_download_widget_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }

return_type: unsigned long


decompiled_code:
__int64 dl_download_widget_get_type()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = dl_download_widget_get_type_once();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

canonical_decompiled_code:
__int64 func5()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = func1();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

original_code: GType dl_download_widget_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); guint64 gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (gpointer) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { GType g_define_type_id = dl_download_widget_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }

canonical_original_code: unsigned long dl_download_widget_get_type() { static unsigned long g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); unsigned long gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (void *) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { unsigned long g_define_type_id = dl_download_widget_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }


decompiled_code:
__int64 dl_download_widget_controller_get_type_once()
{
__int64 v0; // rax

v0 = g_intern_static_string("DLDownloadWidgetController");
return g_type_register_static_simple(
80LL,
v0,
24LL,
dl_download_widget_controller_class_intern_init,
24LL,
dl_download_widget_controller_init,
0LL);
}

canonical_decompiled_code:
__int64 func2()
{
__int64 v0; // rax

v0 = g_intern_static_string("DLDownloadWidgetController");
return g_type_register_static_simple(
80LL,
v0,
24LL,
dl_download_widget_controller_class_intern_init,
24LL,
dl_download_widget_controller_init,
0LL);
}

original_code: __attribute__((noinline)) static GType dl_download_widget_controller_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple (((GType) ((20) << (2))), g_intern_static_string ("DLDownloadWidgetController"), sizeof (DLDownloadWidgetControllerClass), (GClassInitFunc)(void (*)(void)) dl_download_widget_controller_class_intern_init, sizeof (DLDownloadWidgetController), (GInstanceInitFunc)(void (*)(void)) dl_download_widget_controller_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }

canonical_original_code: static unsigned long dl_download_widget_controller_get_type_once() { unsigned long g_define_type_id = g_type_register_static_simple (((GType) ((20) << (2))), g_intern_static_string ("DLDownloadWidgetController"), sizeof (DLDownloadWidgetControllerClass), (GClassInitFunc)(void (*)(void)) dl_download_widget_controller_class_intern_init, sizeof (DLDownloadWidgetController), (GInstanceInitFunc)(void (*)(void)) dl_download_widget_controller_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }


decompiled_code:
__int64 dl_download_widget_controller_get_type()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = dl_download_widget_controller_get_type_once();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

canonical_decompiled_code:
__int64 func5()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = func2();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

original_code: GType dl_download_widget_controller_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); guint64 gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (gpointer) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { GType g_define_type_id = dl_download_widget_controller_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }

canonical_original_code: unsigned long dl_download_widget_controller_get_type() { static unsigned long g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); unsigned long gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (void *) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { unsigned long g_define_type_id = dl_download_widget_controller_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }


decompiled_code:
__int64 dl_application_get_type_once()
{
__int64 v0; // rax

v0 = g_intern_static_string("DLApplication");
return g_type_register_static_simple(
80LL,
v0,
144LL,
dl_application_class_intern_init,
32LL,
dl_application_init,
0LL);
}

canonical_decompiled_code:
__int64 func0()
{
__int64 v0; // rax

v0 = g_intern_static_string("DLApplication");
return g_type_register_static_simple(
80LL,
v0,
144LL,
dl_application_class_intern_init,
32LL,
dl_application_init,
0LL);
}

original_code: __attribute__((noinline)) static GType dl_application_get_type_once (void) { GType g_define_type_id = g_type_register_static_simple (((GType) ((20) << (2))), g_intern_static_string ("DLApplication"), sizeof (DLApplicationClass), (GClassInitFunc)(void (*)(void)) dl_application_class_intern_init, sizeof (DLApplication), (GInstanceInitFunc)(void (*)(void)) dl_application_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }

canonical_original_code: static unsigned long dl_application_get_type_once() { unsigned long g_define_type_id = g_type_register_static_simple (((GType) ((20) << (2))), g_intern_static_string ("DLApplication"), sizeof (DLApplicationClass), (GClassInitFunc)(void (*)(void)) dl_application_class_intern_init, sizeof (DLApplication), (GInstanceInitFunc)(void (*)(void)) dl_application_init, (GTypeFlags) 0); { {{};} } return g_define_type_id; }


decompiled_code:
__int64 dl_application_get_type()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = dl_application_get_type_once();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

canonical_decompiled_code:
__int64 func5()
{
__int64 v1; // rax

if ( g_define_type_id__volatile_0 )
return g_define_type_id__volatile_0;
if ( (unsigned int)g_once_init_enter(&g_define_type_id__volatile_0) )
{
v1 = func0();
g_once_init_leave(&g_define_type_id__volatile_0, v1);
}
return g_define_type_id__volatile_0;
}

original_code: GType dl_application_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); guint64 gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (gpointer) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { GType g_define_type_id = dl_application_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }

canonical_original_code: unsigned long dl_application_get_type() { static unsigned long g_define_type_id__volatile = 0; if ((__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_1[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? (gpointer) *(&g_define_type_id__volatile) : 0); (!(__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_2[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); unsigned long gapg_temp = __atomic_load_8 ((&g_define_type_id__volatile), 5); (void *) gapg_temp; })) && g_once_init_enter (&g_define_type_id__volatile)); }))) { unsigned long g_define_type_id = dl_application_get_type_once (); (__extension__ ({ typedef char _GStaticAssertCompileTimeAssertion_3[(sizeof *(&g_define_type_id__volatile) == sizeof (gpointer)) ? 1 : -1] __attribute__((__unused__)); (void) (0 ? *(&g_define_type_id__volatile) = (g_define_type_id) : 0); g_once_init_leave ((&g_define_type_id__volatile), (gsize) (g_define_type_id)); })); } return g_define_type_id__volatile; }


original_code:
int m3l_cat_data(node_t *Tmpnode, size_t tot_dim)
{
 size_t i;
  if (strncmp(Tmpnode->type,"LD",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.16Lf ", Tmpnode->data.ldf[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"D",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.16lf ", Tmpnode->data.df[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"F",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.8f ", Tmpnode->data.f[i] ) < 0) Perror("printf");;
  }
  else if (strncmp(Tmpnode->type,"SC",2) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.sc[i]);
  }
  else if(strncmp(Tmpnode->type,"UC",2) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.uc[i]);
  }
  else if(strncmp(Tmpnode->type,"C",1) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.c[i]);
  }
  else if(strncmp(Tmpnode->type,"ULLI",4) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%ulld ", Tmpnode->data.ulli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"SLLI",4) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lld " , Tmpnode->data.slli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"LLI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lld " , Tmpnode->data.lli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"ULI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lu " , Tmpnode->data.uli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"USI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%u ", Tmpnode->data.usi[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"SI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%d ", Tmpnode->data.si[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"UI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%u ", Tmpnode->data.ui[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"LI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%ld ", Tmpnode->data.li[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"I",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%d ", Tmpnode->data.i[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"ST",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%zd ", Tmpnode->data.st[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"PTRDF",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%td ", Tmpnode->data.ptrdf[i] ) < 0) Perror("printf");;
  }
  else
  {
   Error("Unknown type");
   return -1;
  }
  return 0;
}

canonical_original_code:
int m3l_cat_data(struct node *Tmpnode, unsigned long tot_dim)
{
 unsigned long i;
  if (strncmp(Tmpnode->type,"LD",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.16Lf ", Tmpnode->data.ldf[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"D",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.16lf ", Tmpnode->data.df[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"F",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%.8f ", Tmpnode->data.f[i] ) < 0) Perror("printf");;
  }
  else if (strncmp(Tmpnode->type,"SC",2) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.sc[i]);
  }
  else if(strncmp(Tmpnode->type,"UC",2) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.uc[i]);
  }
  else if(strncmp(Tmpnode->type,"C",1) == 0){
   for (i=0; i<tot_dim; i++)
    printf("%c", Tmpnode->data.c[i]);
  }
  else if(strncmp(Tmpnode->type,"ULLI",4) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%ulld ", Tmpnode->data.ulli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"SLLI",4) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lld " , Tmpnode->data.slli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"LLI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lld " , Tmpnode->data.lli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"ULI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%lu " , Tmpnode->data.uli[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"USI",3) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%u ", Tmpnode->data.usi[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"SI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%d ", Tmpnode->data.si[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"UI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%u ", Tmpnode->data.ui[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"LI",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%ld ", Tmpnode->data.li[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"I",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%d ", Tmpnode->data.i[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"ST",2) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%zd ", Tmpnode->data.st[i] ) < 0) Perror("printf");;
  }
  else if(strncmp(Tmpnode->type,"PTRDF",1) == 0){
   for (i=0; i<tot_dim; i++)
    if( printf("%td ", Tmpnode->data.ptrdf[i] ) < 0) Perror("printf");;
  }
  else
  {
   Error("Unknown type");
   return -1;
  }
  return 0;
}

variable_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } *

variable_types:
i
unsigned long

user_defined_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t data; long create_time; struct node *next; struct find_str **linknode; unsigned long lcounter; char no_malloc; int ap; }


original_code:
int m3l_AllocateLinkInfo(node_t **Slist, node_t *Tlist){
 size_t lcounter;
 struct find_str **realloc_linknode;
 if( (*Slist)->linknode == ((void *)0)){
  if( ( (*Slist)->linknode = (find_str_t **)malloc(sizeof(find_str_t *))) == ((void *)0))
   Perror("linknode malloc");
  if( ( (*Slist)->linknode[0] = (find_str_t *)malloc(sizeof(find_str_t))) == ((void *)0))
   Perror("linknode malloc");
  (*Slist)->linknode[0]->List = Tlist;
  (*Slist)->lcounter = 1;
  return 1;
 }
 else{
  lcounter = (*Slist)->lcounter;
  realloc_linknode = ((void *)0);
  if( ( realloc_linknode = (find_str_t **)realloc( (*Slist)->linknode, (lcounter+1) * sizeof(find_str_t *))) == ((void *)0)){
   Perror("linknode malloc");}
  else
   (*Slist)->linknode = realloc_linknode;
  if( ( (*Slist)->linknode[lcounter] = (find_str_t *)malloc(sizeof(find_str_t))) == ((void *)0))
   Perror("linknode malloc");
  (*Slist)->linknode[lcounter]->List = Tlist;
  (*Slist)->lcounter++;
  return 1;
 }
 return -1;
}

canonical_original_code:
int m3l_AllocateLinkInfo(struct node **Slist, struct node *Tlist){
 unsigned long lcounter;
 struct find_str **realloc_linknode;
 if( (*Slist)->linknode == ((void *)0)){
  if( ( (*Slist)->linknode = (struct find_str **)malloc(sizeof(struct find_str *))) == ((void *)0))
   Perror("linknode malloc");
  if( ( (*Slist)->linknode[0] = (struct find_str *)malloc(sizeof(find_str_t))) == ((void *)0))
   Perror("linknode malloc");
  (*Slist)->linknode[0]->List = Tlist;
  (*Slist)->lcounter = 1;
  return 1;
 }
 else{
  lcounter = (*Slist)->lcounter;
  realloc_linknode = ((void *)0);
  if( ( realloc_linknode = (struct find_str **)realloc( (*Slist)->linknode, (lcounter+1) * sizeof(struct find_str *))) == ((void *)0)){
   Perror("linknode malloc");}
  else
   (*Slist)->linknode = realloc_linknode;
  if( ( (*Slist)->linknode[lcounter] = (struct find_str *)malloc(sizeof(find_str_t))) == ((void *)0))
   Perror("linknode malloc");
  (*Slist)->linknode[lcounter]->List = Tlist;
  (*Slist)->lcounter++;
  return 1;
 }
 return -1;
}

variable_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } **

variable_types:
Tlist
struct node *

variable_types:
lcounter
unsigned long

variable_types: struct find_str { struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str **linknode; unsigned long lcounter; char no_malloc; int ap; } *List; } **


decompiled_code:
__int64 __fastcall m3l_ln_recrt_list(char ***a1, __int64 *a2, const char *a3)
{
char *v3; // rax
char *v4; // rax
int v5; // edx
__int64 result; // rax

v3 = (*a1)[1];
*(_QWORD *)v3 = 0LL;
*((_QWORD *)v3 + 1) = 0LL;
*((_QWORD *)v3 + 2) = 0LL;
*((_QWORD *)v3 + 3) = 0LL;
*((_QWORD *)v3 + 4) = 0LL;
*((_QWORD *)v3 + 5) = 0LL;
v4 = **a1;
*(_DWORD *)v4 = 0;
v4[4] = 0;
if ( a3 )
{
if ( snprintf((*a1)[1], 0x30uLL, "%s", a3) >= 0 )
goto LABEL_3;
LABEL_8:
Perror("snprintf");
return 0xFFFFFFFFLL;
}
if ( snprintf((*a1)[1], 0x30uLL, "%s", *(const char **)(*a2 + 8)) < 0 )
goto LABEL_8;
LABEL_3:
strcpy(**a1, "LINK");
if ( (unsigned int)m3l_Free_data_str(a1) )
{
Error("Free_data_str");
result = 0xFFFFFFFFLL;
}
else
{
(*a1)[9] = (char *)*a2;
(*a1)[3] = (_BYTE *)(m3l_AllocateLinkInfo + 1);
v5 = m3l_AllocateLinkInfo(a2, (__int64)*a1);
result = 1LL;
if ( v5 < 0 )
{
Error("AllocateLinkInfo");
result = 0xFFFFFFFFLL;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(char ***a1, __int64 *a2, const char *a3)
{
char *v3; // rax
char *v4; // rax
int v5; // edx
__int64 result; // rax

v3 = (*a1)[1];
*(_QWORD *)v3 = 0LL;
*((_QWORD *)v3 + 1) = 0LL;
*((_QWORD *)v3 + 2) = 0LL;
*((_QWORD *)v3 + 3) = 0LL;
*((_QWORD *)v3 + 4) = 0LL;
*((_QWORD *)v3 + 5) = 0LL;
v4 = **a1;
*(_DWORD *)v4 = 0;
v4[4] = 0;
if ( a3 )
{
if ( snprintf((*a1)[1], 0x30uLL, "%s", a3) >= 0 )
goto LABEL_3;
LABEL_8:
Perror("snprintf");
return 0xFFFFFFFFLL;
}
if ( snprintf((*a1)[1], 0x30uLL, "%s", *(const char **)(*a2 + 8)) < 0 )
goto LABEL_8;
LABEL_3:
strcpy(**a1, "LINK");
if ( (unsigned int)m3l_Free_data_str(a1) )
{
Error("Free_data_str");
result = 0xFFFFFFFFLL;
}
else
{
(*a1)[9] = (char *)*a2;
(*a1)[3] = (_BYTE *)(m3l_AllocateLinkInfo + 1);
v5 = func0(a2, (__int64)*a1);
result = 1LL;
if ( v5 < 0 )
{
Error("AllocateLinkInfo");
result = 0xFFFFFFFFLL;
}
}
return result;
}

original_code:
int m3l_ln_recrt_list(node_t ** Tlist, node_t **Slist, char *NewName){
 bzero( (*Tlist)->name, 48);
 bzero( (*Tlist)->type, 5);
 if(NewName != ((void *)0)){
  if( snprintf((*Tlist)->name, 48,"%s",NewName) < 0){
   Perror("snprintf");
   return -1;
  }
 }
 else{
  if( snprintf((*Tlist)->name, 48,"%s", (*Slist)->name) < 0){
   Perror("snprintf");
   return -1;
  }
 }
 if( snprintf( (*Tlist)->type, 5,"%s", "LINK") < 0){
  Perror("snprintf");
  return -1;
 }
 if ( m3l_Free_data_str(Tlist) != 0){
  Error("Free_data_str");
  return -1;
 }
 (*Tlist)->child = (*Slist);
 (*Tlist)->ndim = 1;
 if( m3l_AllocateLinkInfo(Slist, (*Tlist)) < 0){
  Error("AllocateLinkInfo");
  return -1;
 }
 return 1;
}

canonical_original_code:
int m3l_ln_recrt_list(struct node **Tlist, struct node **Slist, char *NewName){
 bzero( (*Tlist)->name, 48);
 bzero( (*Tlist)->type, 5);
 if(NewName != ((void *)0)){
  if( snprintf((*Tlist)->name, 48,"%s",NewName) < 0){
   Perror("snprintf");
   return -1;
  }
 }
 else{
  if( snprintf((*Tlist)->name, 48,"%s", (*Slist)->name) < 0){
   Perror("snprintf");
   return -1;
  }
 }
 if( snprintf( (*Tlist)->type, 5,"%s", "LINK") < 0){
  Perror("snprintf");
  return -1;
 }
 if ( m3l_Free_data_str(Tlist) != 0){
  Error("Free_data_str");
  return -1;
 }
 (*Tlist)->child = (*Slist);
 (*Tlist)->ndim = 1;
 if( m3l_AllocateLinkInfo(Slist, (*Tlist)) < 0){
  Error("AllocateLinkInfo");
  return -1;
 }
 return 1;
}

variable_types:
Slist
struct node **

variable_types:
NewName
char *

user_defined_types: union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; }


decompiled_code:
__int64 __fastcall m3l_ln_crt_list(__int64 *a1, const char *a2, __int64 a3)
{
__int64 v3; // rbx
char s[8]; // [rsp+0h] [rbp-68h] BYREF
__int64 v7; // [rsp+38h] [rbp-30h]
__int64 v8; // [rsp+40h] [rbp-28h]

v3 = (__int64)a2;
if ( a2 )
{
if ( snprintf(&s[5], 0x30uLL, "%s", a2) < 0 )
{
Perror("m3l_ln_crt_list: snprintf");
return 0LL;
}
}
else if ( snprintf(&s[5], 0x30uLL, "%s", *(const char **)(*a1 + 8)) < 0 )
{
Perror("m3l_ln_crt_list: snprintf");
return v3;
}
strcpy(s, "LINK");
v7 = 1LL;
v8 = 0LL;
v3 = m3l_AllocateNode(a3);
if ( v3 )
{
*(_QWORD *)(v3 + 72) = *a1;
if ( (int)m3l_AllocateLinkInfo(a1, v3) < 0 )
{
Error("m3l_ln_crt_list: AllocateLinkInfo");
v3 = 0LL;
}
}
else
{
Error("m3l_ln_crt_list: Allocate");
}
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 *a1, const char *a2, __int64 a3)
{
__int64 v3; // rbx
char s[8]; // [rsp+0h] [rbp-68h] BYREF
__int64 v7; // [rsp+38h] [rbp-30h]
__int64 v8; // [rsp+40h] [rbp-28h]

v3 = (__int64)a2;
if ( a2 )
{
if ( snprintf(&s[5], 0x30uLL, "%s", a2) < 0 )
{
Perror("m3l_ln_crt_list: snprintf");
return 0LL;
}
}
else if ( snprintf(&s[5], 0x30uLL, "%s", *(const char **)(*a1 + 8)) < 0 )
{
Perror("m3l_ln_crt_list: snprintf");
return v3;
}
strcpy(s, "LINK");
v7 = 1LL;
v8 = 0LL;
v3 = m3l_AllocateNode(a3);
if ( v3 )
{
*(_QWORD *)(v3 + 72) = *a1;
if ( (int)func0(a1, v3) < 0 )
{
Error("m3l_ln_crt_list: AllocateLinkInfo");
v3 = 0LL;
}
}
else
{
Error("m3l_ln_crt_list: Allocate");
}
return v3;
}

original_code:
node_t *m3l_ln_crt_list(node_t **Slist, char *NewName, opts_t *Popts){
 node_t *Pnode;
 tmpstruct_t TMPSTR;
 if(NewName != ((void *)0)){
  if( snprintf(TMPSTR.Name_Of_List, sizeof(TMPSTR.Name_Of_List),"%s",NewName) < 0){
   Perror("m3l_ln_crt_list: snprintf");
   return (node_t *) ((void *)0);
  }
 }
 else{
  if( snprintf(TMPSTR.Name_Of_List, sizeof(TMPSTR.Name_Of_List),"%s", (*Slist)->name) < 0){
   Perror("m3l_ln_crt_list: snprintf");
   return (node_t *) ((void *)0);
  }
 }
 if( snprintf(TMPSTR.Type, sizeof(TMPSTR.Type),"LINK") < 0){
  Perror("m3l_ln_crt_list: snprintf");
  return (node_t *) ((void *)0);
 }
 TMPSTR.ndim = 1;
 TMPSTR.dim = ((void *)0);
 if( (Pnode = m3l_AllocateNode(TMPSTR, Popts)) == ((void *)0)){
  Error("m3l_ln_crt_list: Allocate");
  return (node_t *)((void *)0);
 }
 Pnode->child = (*Slist);
 if( m3l_AllocateLinkInfo(Slist, Pnode) < 0){
  Error("m3l_ln_crt_list: AllocateLinkInfo");
  return (node_t *) ((void *)0);
 }
 return Pnode;
}

canonical_original_code:
struct node *m3l_ln_crt_list(struct node **Slist, char *NewName, struct opts *Popts){
 struct node *Pnode;
 struct tmpstruct TMPSTR;
 if(NewName != ((void *)0)){
  if( snprintf(TMPSTR.Name_Of_List, sizeof(TMPSTR.Name_Of_List),"%s",NewName) < 0){
   Perror("m3l_ln_crt_list: snprintf");
   return (struct node *) ((void *)0);
  }
 }
 else{
  if( snprintf(TMPSTR.Name_Of_List, sizeof(TMPSTR.Name_Of_List),"%s", (*Slist)->name) < 0){
   Perror("m3l_ln_crt_list: snprintf");
   return (struct node *) ((void *)0);
  }
 }
 if( snprintf(TMPSTR.Type, sizeof(TMPSTR.Type),"LINK") < 0){
  Perror("m3l_ln_crt_list: snprintf");
  return (struct node *) ((void *)0);
 }
 TMPSTR.ndim = 1;
 TMPSTR.dim = ((void *)0);
 if( (Pnode = m3l_AllocateNode(TMPSTR, Popts)) == ((void *)0)){
  Error("m3l_ln_crt_list: Allocate");
  return (struct node *)((void *)0);
 }
 Pnode->child = (*Slist);
 if( m3l_AllocateLinkInfo(Slist, Pnode) < 0){
  Error("m3l_ln_crt_list: AllocateLinkInfo");
  return (struct node *) ((void *)0);
 }
 return Pnode;
}

variable_types: struct opts { char opt_a; char opt_b; char opt_c; char opt_d; char opt_e; char opt_f; char opt_i; char opt_k; char opt_l; char opt_m; char opt_n; char opt_p; char opt_r; char opt_s; char opt_u; char opt_linkscleanemptrefs; char opt_nomalloc; char opt_tcpencoding; char opt_tcpheader; char opt_shutdown; char opt_add; char opt_MEMCP; char opt_EOBseq; char opt_REOBseq; char opt_format; char opt_xformat; } *

variable_types: struct tmpstruct { char Type[5]; unsigned long ndim; }

return_type: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } *


decompiled_code:
__int64 m3l_ln_cleanemptylinksref()
{
return 0LL;
}

canonical_decompiled_code:
__int64 func4()
{
return 0LL;
}

original_code:
int m3l_ln_cleanemptylinksref(node_t **List, opts_t *Popt){
 size_t i, counter;
 counter = 0;
 find_str_t **TMP;
 return 0;
 if( (*List) == ((void *)0)){
  Warning("ln_cleanemptylinksref: Empty node");
  return -1;
 }
 if((*List)->lcounter > 0 ){
  for(i=0; i< (*List)->lcounter; i++)
   if( (*List)->linknode[i]->List != ((void *)0))counter++;
 }
 else{
  return 0;
 }
 if(counter > 0){
  if( (TMP = (find_str_t **)malloc( (*List)->lcounter * sizeof(find_str_t *))) == ((void *)0))
   Perror("ln_cleanemptylinksref malloc");
  for(i=0; i< (*List)->lcounter; i++){
   TMP[i] = ((void *)0);
   if( (*List)->linknode[i]->List != ((void *)0)){
    if( (TMP[i] = (find_str_t *)malloc( sizeof(find_str_t))) == ((void *)0))
     Perror("ln_cleanemptylinksref malloc");
    TMP[i]->List = (*List)->linknode[i]->List;
   }
  }
  if(counter < (*List)->lcounter){
   for(i=0; i< (*List)->lcounter; i++)
    free((*List)->linknode[i]);
   free((*List)->linknode);
   if( ((*List)->linknode = (find_str_t **)malloc( counter * sizeof(find_str_t *))) == ((void *)0))
    Perror("ln_cleanemptylinksref malloc");
   for(i=0; i< counter; i++){
    if( ((*List)->linknode[i] = (find_str_t *)malloc( sizeof(find_str_t))) == ((void *)0))
     Perror("ln_cleanemptylinksref malloc");
    (*List)->linknode[i]->List = TMP[i]->List ;
   }
   (*List)->lcounter = counter;
   for(i=0; i< (*List)->lcounter; i++){
    if(TMP[i] != ((void *)0))free(TMP[i]);
   }
   free(TMP);
   return 1;
  }
  else if(counter > (*List)->lcounter){
   return -2;
  }
  else{
   for(i=0; i< (*List)->lcounter; i++){
    if(TMP[i] != ((void *)0))free(TMP[i]);
   }
   free(TMP);
   return -3;
  }
 }
 else if(counter == 0){
  for(i=0; i< (*List)->lcounter; i++){
   free((*List)->linknode[i]);
   if(TMP[i] != ((void *)0))free(TMP[i]);
  }
  free((*List)->linknode);
  free(TMP);
  (*List)->lcounter = 0;
  return 1;
 }
 return -1;
}

canonical_original_code:
int m3l_ln_cleanemptylinksref(struct node **List, struct opts *Popt){
 unsigned long i; unsigned long counter;
 counter = 0;
 struct find_str **TMP;
 return 0;
 if( (*List) == ((void *)0)){
  Warning("ln_cleanemptylinksref: Empty node");
  return -1;
 }
 if((*List)->lcounter > 0 ){
  for(i=0; i< (*List)->lcounter; i++)
   if( (*List)->linknode[i]->List != ((void *)0))counter++;
 }
 else{
  return 0;
 }
 if(counter > 0){
  if( (TMP = (struct find_str **)malloc( (*List)->lcounter * sizeof(struct find_str *))) == ((void *)0))
   Perror("ln_cleanemptylinksref malloc");
  for(i=0; i< (*List)->lcounter; i++){
   TMP[i] = ((void *)0);
   if( (*List)->linknode[i]->List != ((void *)0)){
    if( (TMP[i] = (struct find_str *)malloc( sizeof(find_str_t))) == ((void *)0))
     Perror("ln_cleanemptylinksref malloc");
    TMP[i]->List = (*List)->linknode[i]->List;
   }
  }
  if(counter < (*List)->lcounter){
   for(i=0; i< (*List)->lcounter; i++)
    free((*List)->linknode[i]);
   free((*List)->linknode);
   if( ((*List)->linknode = (struct find_str **)malloc( counter * sizeof(struct find_str *))) == ((void *)0))
    Perror("ln_cleanemptylinksref malloc");
   for(i=0; i< counter; i++){
    if( ((*List)->linknode[i] = (struct find_str *)malloc( sizeof(find_str_t))) == ((void *)0))
     Perror("ln_cleanemptylinksref malloc");
    (*List)->linknode[i]->List = TMP[i]->List ;
   }
   (*List)->lcounter = counter;
   for(i=0; i< (*List)->lcounter; i++){
    if(TMP[i] != ((void *)0))free(TMP[i]);
   }
   free(TMP);
   return 1;
  }
  else if(counter > (*List)->lcounter){
   return -2;
  }
  else{
   for(i=0; i< (*List)->lcounter; i++){
    if(TMP[i] != ((void *)0))free(TMP[i]);
   }
   free(TMP);
   return -3;
  }
 }
 else if(counter == 0){
  for(i=0; i< (*List)->lcounter; i++){
   free((*List)->linknode[i]);
   if(TMP[i] != ((void *)0))free(TMP[i]);
  }
  free((*List)->linknode);
  free(TMP);
  (*List)->lcounter = 0;
  return 1;
 }
 return -1;
}

variable_types:
counter
unsigned long

user_defined_types: struct opts { char opt_a; char opt_b; char opt_c; char opt_d; char opt_e; char opt_f; char opt_i; char opt_k; char opt_l; char opt_m; char opt_n; char opt_p; char opt_r; char opt_s; char opt_u; char opt_linkscleanemptrefs; char opt_nomalloc; char opt_tcpencoding; char opt_tcpheader; char opt_shutdown; char opt_add; char opt_MEMCP; char opt_EOBseq; char opt_REOBseq; char opt_format; char opt_xformat; }


original_code:
size_t m3l_ln(node_t **SList, const char *s_path, const char *s_path_loc, node_t **TList, const char *t_path, const char *t_path_loc, opts_t *Popts)
{
 size_t i,j,k,l , ln_tot_nodes, ln_nodes,len;
 find_t *SFounds, *TFounds;
 int init_call;
 char *path, *path_loc, *newname;
 const char *pc;
 node_t *Tmpnode, *TmpnodePar;
 opts_t *Popts_Tlist, opts;
 init_call = 1;
 if(*TList == ((void *)0)){
  Warning("Cp: NULL target list");
  return -1;
 }
 if (Popts->opt_linkscleanemptlinks == 'e' || Popts->opt_linkscleanemptrefs == 'c'){
   ln_tot_nodes = m3l_ln_cleanemptylinks(TList, Popts);
  return ln_tot_nodes;
 }
 if(*SList == ((void *)0)){
  Warning("Cp: NULL source list");
  return -1;
 }
 if ( (SFounds = m3l_locate( *SList, s_path, s_path_loc, Popts)) == ((void *)0)){
  Warning("Cp: NULL SFounds");
  return 0;
 }
 opts.opt_i = '\0'; opts.opt_d = '\0'; opts.opt_f = '\0'; opts.opt_r = 'r'; opts.opt_I = '\0'; opts.opt_k = '\0'; opts.opt_b = '\0'; opts.opt_l = '\0';
 opts.opt_linkscleanemptrefs = '\0'; opts.opt_linkscleanemptlinks = '\0'; opts.opt_nomalloc = '\0';
 Popts_Tlist = &opts;
 len = strlen(t_path_loc);
 if(strncmp(t_path_loc, "./", 2) == 0 && len == 2){
  for(i=0; i< SFounds->founds; i++){
   TmpnodePar = SFounds->Found_Nodes[i]->List->parent;
   if(TmpnodePar == ((void *)0)){
    Warning("can not copy to NULL dir");
   }
   else{
    Tmpnode = SFounds->Found_Nodes[i]->List;
    if( (ln_nodes = m3l_ln_list(init_call, &Tmpnode, &TmpnodePar, (char *)t_path, Popts ) ) < 0){
     Warning("problem in ln_list");
    }
    else{
    ln_tot_nodes += ln_nodes;
    }
   }
  }
  i = SFounds->founds;
  m3l_DestroyFound(&SFounds);
  return i;
 }
 else{
  if ( Popts->opt_add == 'a' || (TFounds = m3l_locate( *TList, t_path, t_path_loc, Popts_Tlist)) == ((void *)0)){
   pc = t_path;
   i = 0;
   k = 0;
   while(*pc != '\0'){
    if(*pc++ == '/')i++;
    k++;
    }
   if(i > 1){
    pc = t_path;
    if( ( path = (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     return -1;
    }
    if( (newname = (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     return -1;
    }
    j = 0;
    l = 0;
    while(*pc != '\0'){
     if(*pc == '/')j++;
     if(j == i )break;
     path[l++] = *pc++;
    }
    path[l] = '\0';
    l = 0;
    pc++;
    while(*pc != '\0'){
     newname[l++] = *pc++;}
    newname[l] = '\0';
    pc = t_path_loc;
    while(*pc++ != '\0')k++;
    if( ( path_loc= (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     return -1;
    }
    j = 0;
    l = 0;
    pc = t_path_loc;
    while(*pc != '\0'){
     if(*pc == '/')j++;
     if(j == i )break;
     path_loc[l++] = *pc++;
    }
    path_loc[l] = '\0';
    if ( (TFounds = m3l_locate( *TList, path, path_loc, Popts_Tlist)) == ((void *)0)){
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     return -1;
    }
    pc = TFounds->Found_Nodes[0]->List->type;
    if(strncmp(pc, "DIR", 3) != 0 || TFounds->founds > 1){
     Warning("Wrong or not existing target");
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     m3l_DestroyFound(&TFounds);
     return -1;
    }
    ln_tot_nodes = 0;
    for(i=0; i< SFounds->founds; i++){
     if( (ln_nodes = m3l_ln_list(init_call, &SFounds->Found_Nodes[i]->List, &TFounds->Found_Nodes[0]->List, newname, Popts ) ) < 0){
      Warning("problem in ln_list");
     }
     else{
      ln_tot_nodes += ln_nodes;
     }
    }
    free(path);
    free(path_loc);
    free(newname);
    m3l_DestroyFound(&SFounds);
    m3l_DestroyFound(&TFounds);
    return ln_tot_nodes;
   }
   else{
    m3l_DestroyFound(&SFounds);
    return -1;
   }
  }
  else{
   if(TFounds->founds != 1){
    Warning("cp: multiple target nodes");
    m3l_DestroyFound(&TFounds);
    m3l_DestroyFound(&SFounds);
    return -1;
   }
   if( SFounds->founds > 1 && strncmp(TFounds->Found_Nodes[0]->List->type, "DIR", 3) != 0){
    Warning("cp: target node is not DIR");
    m3l_DestroyFound(&TFounds);
    m3l_DestroyFound(&SFounds);
    return -1;
   }
   ln_tot_nodes = 0;
   for(i=0; i< SFounds->founds; i++){
    if( (ln_nodes = m3l_ln_list(init_call, &SFounds->Found_Nodes[i]->List, &TFounds->Found_Nodes[0]->List, (char *) ((void *)0), Popts )) < 0){
     Warning("problem in ln_list");
    }
    else{
     ln_tot_nodes += ln_nodes;
    }
   }
   m3l_DestroyFound(&TFounds);
   m3l_DestroyFound(&SFounds);
   return ln_tot_nodes;
  }
 }
}

canonical_original_code:
unsigned long m3l_ln(struct node **SList, char *s_path, char *s_path_loc, struct node **TList, char *t_path, char *t_path_loc, struct opts *Popts)
{
 unsigned long i; unsigned long j; unsigned long k; unsigned long l; unsigned long ln_tot_nodes; unsigned long ln_nodes; unsigned long len;
 struct find *SFounds; struct find *TFounds;
 int init_call;
 char *path; char *path_loc; char *newname;
 char *pc;
 struct node *Tmpnode; struct node *TmpnodePar;
 struct opts *Popts_Tlist; struct opts opts;
 init_call = 1;
 if(*TList == ((void *)0)){
  Warning("Cp: NULL target list");
  return -1;
 }
 if (Popts->opt_linkscleanemptlinks == 'e' || Popts->opt_linkscleanemptrefs == 'c'){
   ln_tot_nodes = m3l_ln_cleanemptylinks(TList, Popts);
  return ln_tot_nodes;
 }
 if(*SList == ((void *)0)){
  Warning("Cp: NULL source list");
  return -1;
 }
 if ( (SFounds = m3l_locate( *SList, s_path, s_path_loc, Popts)) == ((void *)0)){
  Warning("Cp: NULL SFounds");
  return 0;
 }
 opts.opt_i = '\0'; opts.opt_d = '\0'; opts.opt_f = '\0'; opts.opt_r = 'r'; opts.opt_I = '\0'; opts.opt_k = '\0'; opts.opt_b = '\0'; opts.opt_l = '\0';
 opts.opt_linkscleanemptrefs = '\0'; opts.opt_linkscleanemptlinks = '\0'; opts.opt_nomalloc = '\0';
 Popts_Tlist = &opts;
 len = strlen(t_path_loc);
 if(strncmp(t_path_loc, "./", 2) == 0 && len == 2){
  for(i=0; i< SFounds->founds; i++){
   TmpnodePar = SFounds->Found_Nodes[i]->List->parent;
   if(TmpnodePar == ((void *)0)){
    Warning("can not copy to NULL dir");
   }
   else{
    Tmpnode = SFounds->Found_Nodes[i]->List;
    if( (ln_nodes = m3l_ln_list(init_call, &Tmpnode, &TmpnodePar, (char *)t_path, Popts ) ) < 0){
     Warning("problem in ln_list");
    }
    else{
    ln_tot_nodes += ln_nodes;
    }
   }
  }
  i = SFounds->founds;
  m3l_DestroyFound(&SFounds);
  return i;
 }
 else{
  if ( Popts->opt_add == 'a' || (TFounds = m3l_locate( *TList, t_path, t_path_loc, Popts_Tlist)) == ((void *)0)){
   pc = t_path;
   i = 0;
   k = 0;
   while(*pc != '\0'){
    if(*pc++ == '/')i++;
    k++;
    }
   if(i > 1){
    pc = t_path;
    if( ( path = (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     return -1;
    }
    if( (newname = (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     return -1;
    }
    j = 0;
    l = 0;
    while(*pc != '\0'){
     if(*pc == '/')j++;
     if(j == i )break;
     path[l++] = *pc++;
    }
    path[l] = '\0';
    l = 0;
    pc++;
    while(*pc != '\0'){
     newname[l++] = *pc++;}
    newname[l] = '\0';
    pc = t_path_loc;
    while(*pc++ != '\0')k++;
    if( ( path_loc= (char *)malloc( (k+1)*sizeof(char))) == ((void *)0)){
     Perror("malloc");
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     return -1;
    }
    j = 0;
    l = 0;
    pc = t_path_loc;
    while(*pc != '\0'){
     if(*pc == '/')j++;
     if(j == i )break;
     path_loc[l++] = *pc++;
    }
    path_loc[l] = '\0';
    if ( (TFounds = m3l_locate( *TList, path, path_loc, Popts_Tlist)) == ((void *)0)){
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     return -1;
    }
    pc = TFounds->Found_Nodes[0]->List->type;
    if(strncmp(pc, "DIR", 3) != 0 || TFounds->founds > 1){
     Warning("Wrong or not existing target");
     free(path);
     free(path_loc);
     free(newname);
     m3l_DestroyFound(&SFounds);
     m3l_DestroyFound(&TFounds);
     return -1;
    }
    ln_tot_nodes = 0;
    for(i=0; i< SFounds->founds; i++){
     if( (ln_nodes = m3l_ln_list(init_call, &SFounds->Found_Nodes[i]->List, &TFounds->Found_Nodes[0]->List, newname, Popts ) ) < 0){
      Warning("problem in ln_list");
     }
     else{
      ln_tot_nodes += ln_nodes;
     }
    }
    free(path);
    free(path_loc);
    free(newname);
    m3l_DestroyFound(&SFounds);
    m3l_DestroyFound(&TFounds);
    return ln_tot_nodes;
   }
   else{
    m3l_DestroyFound(&SFounds);
    return -1;
   }
  }
  else{
   if(TFounds->founds != 1){
    Warning("cp: multiple target nodes");
    m3l_DestroyFound(&TFounds);
    m3l_DestroyFound(&SFounds);
    return -1;
   }
   if( SFounds->founds > 1 && strncmp(TFounds->Found_Nodes[0]->List->type, "DIR", 3) != 0){
    Warning("cp: target node is not DIR");
    m3l_DestroyFound(&TFounds);
    m3l_DestroyFound(&SFounds);
    return -1;
   }
   ln_tot_nodes = 0;
   for(i=0; i< SFounds->founds; i++){
    if( (ln_nodes = m3l_ln_list(init_call, &SFounds->Found_Nodes[i]->List, &TFounds->Found_Nodes[0]->List, (char *) ((void *)0), Popts )) < 0){
     Warning("problem in ln_list");
    }
    else{
     ln_tot_nodes += ln_nodes;
    }
   }
   m3l_DestroyFound(&TFounds);
   m3l_DestroyFound(&SFounds);
   return ln_tot_nodes;
  }
 }
}

variable_types:
TList
struct node **

variable_types:
j
unsigned long

variable_types:
k
unsigned long

variable_types:
l
unsigned long

variable_types:
len
unsigned long

variable_types: struct find { struct find_str { struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str **linknode; unsigned long lcounter; char no_malloc; int ap; } *List; } **Found_Nodes; unsigned long founds; struct node *Home_Node; } *

variable_types:
path
char *

variable_types:
newname
char *

variable_types:
pc
char *

variable_types: struct opts { char opt_a; char opt_b; char opt_c; char opt_d; char opt_e; char opt_f; char opt_i; char opt_k; char opt_l; char opt_m; char opt_n; char opt_p; char opt_r; char opt_s; char opt_u; char opt_linkscleanemptrefs; char opt_nomalloc; char opt_tcpencoding; char opt_tcpheader; char opt_shutdown; char opt_add; char opt_MEMCP; char opt_EOBseq; char opt_REOBseq; char opt_format; char opt_xformat; }

user_defined_types: struct find { struct find_str **Found_Nodes; unsigned long founds; struct node *Home_Node; }


decompiled_code:
_BOOL8 __fastcall Check_EOFbuff(__int64 a1, const char *a2, size_t a3, size_t a4, const char *a5)
{
const char *v5; // r9
bool v7; // cc
size_t v8; // rdx
char *v9; // rax
const char *v10; // rsi
__int64 v11; // rax
size_t v12; // rdi

v5 = a2;
v7 = a3 <= a4;
v8 = a4;
if ( v7 )
v8 = a3;
if ( a4 > v8 )
{
v9 = (char *)a2;
v10 = &a2[a4 - v8];
do
{
*v9 = v9[v8];
++v9;
}
while ( v9 != v10 );
}
if ( v8 )
{
v11 = 0LL;
v12 = a3 - v8 + a1;
do
{
v5[a4 - v8 + v11] = *(_BYTE *)(v12 + v11);
++v11;
}
while ( v8 != v11 );
}
v5[a4] = 0;
return strncmp(v5, a5, a4) == 0;
}

original_code:
int Check_EOFbuff(char *buff, char *eofbuff, ssize_t n, size_t eoblen, char *EOFBUFF)
{
 size_t counter,i;
 counter = 0;
 if(eoblen < n)
  counter = eoblen ;
 else
  counter = n;
 for (i=counter; i<eoblen; i++)
  *(eofbuff+i-counter) = *(eofbuff+i);
 for (i=0; i<counter; i++)
  *(eofbuff+i+eoblen-counter) = *(buff+n-counter+i);
 eofbuff[eoblen]='\0';
 if(strncmp(eofbuff, EOFBUFF, eoblen) == 0){
  return 1;
 }
 else{
  return 0;
 }
}

canonical_original_code:
int Check_EOFbuff(char *buff, char *eofbuff, long n, unsigned long eoblen, char *EOFBUFF)
{
 unsigned long counter; unsigned long i;
 counter = 0;
 if(eoblen < n)
  counter = eoblen ;
 else
  counter = n;
 for (i=counter; i<eoblen; i++)
  *(eofbuff+i-counter) = *(eofbuff+i);
 for (i=0; i<counter; i++)
  *(eofbuff+i+eoblen-counter) = *(buff+n-counter+i);
 eofbuff[eoblen]='\0';
 if(strncmp(eofbuff, EOFBUFF, eoblen) == 0){
  return 1;
 }
 else{
  return 0;
 }
}

variable_types:
buff
char *

variable_types:
eofbuff
char *

variable_types: n long

variable_types:
eoblen
unsigned long

variable_types:
EOFBUFF
char *

variable_types:
i
unsigned long


original_code:
int Check_EOFfile(char *buff, char *eofbuff, ssize_t n, size_t eoblen, char *EOFBUFF)
{
 size_t i, tecount, count1;
 char *pcloc;
 tecount = 0;
 count1 = 0;
 pcloc = &buff[n-1];
 for(i=0; i<n ; i++)
  if( *(buff+n-i-1) == ' ' || *(buff+n-i-1) == '\t' || *(buff+n-i-1) == '\n'){
   pcloc--;
   tecount++;
  }
  else
   break;
 if(eoblen < n-tecount)
  count1 = eoblen;
 else
  count1 = n-tecount;
 for (i=count1; i<eoblen; i++)
  *(eofbuff+i-count1) = *(eofbuff+i);
 for (i=0; i<count1; i++)
  *(eofbuff+eoblen-i-1) = *pcloc--;
 eofbuff[eoblen]='\0';
 if(strncmp(eofbuff, EOFBUFF, eoblen) == 0){
  return 1;}
 else{
  return 0;
 }
}

canonical_original_code:
int Check_EOFfile(char *buff, char *eofbuff, long n, unsigned long eoblen, char *EOFBUFF)
{
 unsigned long i; unsigned long tecount; unsigned long count1;
 char *pcloc;
 tecount = 0;
 count1 = 0;
 pcloc = &buff[n-1];
 for(i=0; i<n ; i++)
  if( *(buff+n-i-1) == ' ' || *(buff+n-i-1) == '\t' || *(buff+n-i-1) == '\n'){
   pcloc--;
   tecount++;
  }
  else
   break;
 if(eoblen < n-tecount)
  count1 = eoblen;
 else
  count1 = n-tecount;
 for (i=count1; i<eoblen; i++)
  *(eofbuff+i-count1) = *(eofbuff+i);
 for (i=0; i<count1; i++)
  *(eofbuff+eoblen-i-1) = *pcloc--;
 eofbuff[eoblen]='\0';
 if(strncmp(eofbuff, EOFBUFF, eoblen) == 0){
  return 1;}
 else{
  return 0;
 }
}

variable_types:
tecount
unsigned long

variable_types:
pcloc
char *


original_code:
int m3l_Free_data_str(node_t **Lnode)
{
 if(strncmp((*Lnode)->type,"DIR",3) != 0 && strncmp((*Lnode)->type,"LINK",4) != 0 ){
  free((*Lnode)->fdim);
  (*Lnode)->fdim = ((void *)0);
  (*Lnode)->ndim = 0;
  if((*Lnode)->no_malloc == 'n') return 0;
  if (strncmp((*Lnode)->type,"LD",2) == 0){
   free( (*Lnode)->data.ldf);
   (*Lnode)->data.ldf = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"D",1) == 0){
   free( (*Lnode)->data.df);
   (*Lnode)->data.df = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"F",1) == 0){
   free( (*Lnode)->data.f);
   (*Lnode)->data.f = ((void *)0);
  }
  else if (strncmp((*Lnode)->type,"SC",2) == 0){
   free( (*Lnode)->data.sc);
   (*Lnode)->data.sc = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"UC",2) == 0){
   free( (*Lnode)->data.uc);
   (*Lnode)->data.uc = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"C",1) == 0){
   free( (*Lnode)->data.c);
   (*Lnode)->data.c = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ULLI",4) == 0){
   free( (*Lnode)->data.ulli);
   (*Lnode)->data.ulli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"SLLI",4) == 0){
   free( (*Lnode)->data.slli);
   (*Lnode)->data.slli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"LLI",3) == 0){
   free( (*Lnode)->data.lli);
   (*Lnode)->data.lli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ULI",3) == 0){
   free( (*Lnode)->data.uli);
   (*Lnode)->data.uli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"USI",3) == 0){
   free( (*Lnode)->data.usi);
   (*Lnode)->data.usi = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"SI",2) == 0){
   free( (*Lnode)->data.si);
   (*Lnode)->data.si = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"UI",2) == 0){
   free( (*Lnode)->data.ui);
   (*Lnode)->data.ui = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"LI",2) == 0){
   free( (*Lnode)->data.li);
   (*Lnode)->data.li = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"I",1) == 0){
   free( (*Lnode)->data.i);
   (*Lnode)->data.i = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ST",2) == 0){
   free( (*Lnode)->data.st);
   (*Lnode)->data.st = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"PTRDF",1) == 0){
   free( (*Lnode)->data.ptrdf);
   (*Lnode)->data.ptrdf = ((void *)0);
  }
 }
 return 0;
}

canonical_original_code:
int m3l_Free_data_str(struct node **Lnode)
{
 if(strncmp((*Lnode)->type,"DIR",3) != 0 && strncmp((*Lnode)->type,"LINK",4) != 0 ){
  free((*Lnode)->fdim);
  (*Lnode)->fdim = ((void *)0);
  (*Lnode)->ndim = 0;
  if((*Lnode)->no_malloc == 'n') return 0;
  if (strncmp((*Lnode)->type,"LD",2) == 0){
   free( (*Lnode)->data.ldf);
   (*Lnode)->data.ldf = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"D",1) == 0){
   free( (*Lnode)->data.df);
   (*Lnode)->data.df = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"F",1) == 0){
   free( (*Lnode)->data.f);
   (*Lnode)->data.f = ((void *)0);
  }
  else if (strncmp((*Lnode)->type,"SC",2) == 0){
   free( (*Lnode)->data.sc);
   (*Lnode)->data.sc = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"UC",2) == 0){
   free( (*Lnode)->data.uc);
   (*Lnode)->data.uc = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"C",1) == 0){
   free( (*Lnode)->data.c);
   (*Lnode)->data.c = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ULLI",4) == 0){
   free( (*Lnode)->data.ulli);
   (*Lnode)->data.ulli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"SLLI",4) == 0){
   free( (*Lnode)->data.slli);
   (*Lnode)->data.slli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"LLI",3) == 0){
   free( (*Lnode)->data.lli);
   (*Lnode)->data.lli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ULI",3) == 0){
   free( (*Lnode)->data.uli);
   (*Lnode)->data.uli = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"USI",3) == 0){
   free( (*Lnode)->data.usi);
   (*Lnode)->data.usi = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"SI",2) == 0){
   free( (*Lnode)->data.si);
   (*Lnode)->data.si = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"UI",2) == 0){
   free( (*Lnode)->data.ui);
   (*Lnode)->data.ui = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"LI",2) == 0){
   free( (*Lnode)->data.li);
   (*Lnode)->data.li = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"I",1) == 0){
   free( (*Lnode)->data.i);
   (*Lnode)->data.i = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"ST",2) == 0){
   free( (*Lnode)->data.st);
   (*Lnode)->data.st = ((void *)0);
  }
  else if(strncmp((*Lnode)->type,"PTRDF",1) == 0){
   free( (*Lnode)->data.ptrdf);
   (*Lnode)->data.ptrdf = ((void *)0);
  }
 }
 return 0;
}

variable_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } **


original_code:
int m3l_Free(node_t **Lnode)
{
 size_t i;
 if( m3l_Free_data_str(Lnode) != 0)
  Perror("Free_data_str");
 if((*Lnode)->type != ((void *)0)) {
  free((*Lnode)->type);
  (*Lnode)->type = ((void *)0);
 }
 if((*Lnode)->name != ((void *)0)) {
  free((*Lnode)->name);
  (*Lnode)->name = ((void *)0);
 }
 (*Lnode)->next=((void *)0); (*Lnode)->prev=((void *)0); (*Lnode)->parent=((void *)0); (*Lnode)->child=((void *)0); (*Lnode)->fdim=((void *)0);
 if((*Lnode)->lcounter > 0){
  for (i=0; i<(*Lnode)->lcounter; i++)
   free((*Lnode)->linknode[i]);
  free((*Lnode)->linknode);
 }
 free(*Lnode);
 (*Lnode) = ((void *)0);
 return 0;
}

canonical_original_code:
int m3l_Free(struct node **Lnode)
{
 unsigned long i;
 if( m3l_Free_data_str(Lnode) != 0)
  Perror("Free_data_str");
 if((*Lnode)->type != ((void *)0)) {
  free((*Lnode)->type);
  (*Lnode)->type = ((void *)0);
 }
 if((*Lnode)->name != ((void *)0)) {
  free((*Lnode)->name);
  (*Lnode)->name = ((void *)0);
 }
 (*Lnode)->next=((void *)0); (*Lnode)->prev=((void *)0); (*Lnode)->parent=((void *)0); (*Lnode)->child=((void *)0); (*Lnode)->fdim=((void *)0);
 if((*Lnode)->lcounter > 0){
  for (i=0; i<(*Lnode)->lcounter; i++)
   free((*Lnode)->linknode[i]);
  free((*Lnode)->linknode);
 }
 free(*Lnode);
 (*Lnode) = ((void *)0);
 return 0;
}


decompiled_code:
__int64 __fastcall m3l_AllocateNodeData(const void ***a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, unsigned __int8 a7, int a8, int a9, int a10, int a11, int a12, int a13, unsigned __int64 a14, __int64 a15)
{
bool v15; // cf
bool v16; // zf
unsigned __int8 *v18; // rsi
__int64 v19; // rcx
unsigned __int8 *v20; // rdi
char v21; // al
bool v22; // cf
bool v23; // zf
__int64 v24; // rcx
const char *v25; // rdi
unsigned __int64 v26; // r14
bool v27; // cf
bool v28; // zf
unsigned __int8 *v29; // rsi
__int64 v30; // rcx
const char *v31; // rdi
char v32; // al
bool v33; // cf
bool v34; // zf
__int64 v35; // r12
unsigned __int64 i; // rbx
const void **v37; // rbx
void *v38; // rax
bool v39; // al
bool v40; // cf
bool v41; // zf
__int64 v42; // rcx
const char *v43; // rdi
bool v44; // cf
bool v45; // zf
__int64 v46; // rcx
const char *v47; // rdi
__int64 v48; // rbx
const void **v49; // rbx
char *v50; // rdx
char v51; // al
void *v52; // rax
_QWORD *v53; // rbp
__int64 *v54; // rbp
__int64 v55; // rax
void *v56; // rax
void *v58; // rax
void *v59; // rax
void *v60; // rax
void *v61; // rax
void *v62; // rax
void *v63; // rax
void *v64; // rax
void *v65; // rax
void *v66; // rax
void *v67; // rax
void *v68; // rax
void *v69; // rax
void *v70; // rax
void *v71; // rax
void *v72; // rax
__int64 v73; // rcx
const char *v74; // rdi

v15 = 0;
v16 = 0;
v18 = &a7;
v19 = 3LL;
v20 = (unsigned __int8 *)&LC0;
do
{
if ( !v19 )
break;
v15 = *v18 < *v20;
v16 = *v18++ == *v20++;
--v19;
}
while ( v16 );
v21 = (!v15 && !v16) - v15;
v22 = 0;
v23 = v21 == 0;
if ( v21 )
{
v18 = &a7;
v24 = 4LL;
v25 = "LINK";
do
{
if ( !v24 )
break;
v22 = *v18 < (unsigned int)*v25;
v23 = *v18++ == *v25++;
--v24;
}
while ( v23 );
if ( (!v22 && !v23) != v22 )
{
v37 = *a1;
v38 = malloc(8 * a14);
v37[2] = v38;
if ( !v38 )
Perror("malloc");
}
}
v26 = a14;
(*a1)[3] = (const void *)a14;
v27 = 0;
v28 = v26 == 0;
if ( v26 )
{
v29 = &a7;
v30 = 2LL;
v31 = "UC";
do
{
if ( !v30 )
break;
v27 = *v29 < (unsigned int)*v31;
v28 = *v29++ == *v31++;
--v30;
}
while ( v28 );
v32 = (!v27 && !v28) - v27;
v33 = 0;
v34 = v32 == 0;
if ( !v32 )
goto LABEL_14;
v29 = &a7;
v73 = 2LL;
v74 = "SC";
do
{
if ( !v73 )
break;
v33 = *v29 < (unsigned int)*v74;
v34 = *v29++ == *v74++;
--v73;
}
while ( v34 );
if ( (!v33 && !v34) == v33 )
{
LABEL_14:
v35 = 1LL;
for ( i = 0LL; i < v26; ++i )
{
v53 = (_QWORD *)(a15 + 8 * i);
v16 = *v53 == -1LL;
*((_QWORD *)(*a1)[2] + i) = *v53 + 1LL;
if ( v16 )
Error("udf_rm: too low value of dimensions", v29);
v35 *= *v53;
}
goto LABEL_28;
}
}
else
{
Error("udf_rm: too low value of number of dimensions", v18);
v39 = memcmp(&a7, "UC", 2uLL) != 0;
v35 = 1LL;
v40 = 0;
v41 = !v39;
if ( !v39 )
goto LABEL_28;
v29 = &a7;
v42 = 2LL;
v43 = "SC";
do
{
if ( !v42 )
break;
v40 = *v29 < (unsigned int)*v43;
v41 = *v29++ == *v43++;
--v42;
}
while ( v41 );
if ( (!v40 && !v41) == v40 )
{
v35 = 1LL;
goto LABEL_28;
}
}
v44 = a7 < 0x43u;
v45 = a7 == 67;
if ( a7 == 67 )
goto LABEL_49;
v29 = &a7;
v46 = 8LL;
v47 = "DISKFILE";
do
{
if ( !v46 )
break;
v44 = *v29 < (unsigned int)*v47;
v45 = *v29++ == *v47++;
--v46;
}
while ( v45 );
if ( (!v44 && !v45) == v44 )
{
LABEL_49:
if ( !v26 )
{
v35 = 1LL;
goto LABEL_28;
}
goto LABEL_14;
}
v35 = 1LL;
v48 = 0LL;
if ( v26 )
{
do
{
v54 = (__int64 *)(a15 + 8 * v48);
v55 = *v54;
*((_QWORD *)(*a1)[2] + v48) = *v54;
if ( !v55 )
Error("udf_rm: too low value of dimensions", v29);
v35 *= *v54;
++v48;
}
while ( v26 != v48 );
}
LABEL_28:
if ( a2 && *(_BYTE *)(a2 + 32) == 109 )
{
*((_BYTE *)*a1 + 96) = 110;
}
else
{
v49 = *a1;
v50 = (char *)**a1;
if ( !memcmp(v50, "LD", 2uLL) )
{
v56 = malloc(16 * v35);
v49[4] = v56;
if ( !v56 )
goto LABEL_60;
}
else
{
v51 = *v50;
if ( *v50 == 68 )
{
v58 = malloc(8 * v35);
v49[4] = v58;
if ( v58 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 70 )
{
v59 = malloc(4 * v35);
v49[4] = v59;
if ( v59 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SC", 2uLL) )
{
v60 = malloc(v35 + 1);
v49[4] = v60;
if ( v60 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "UC", 2uLL) )
{
v61 = malloc(v35 + 1);
v49[4] = v61;
if ( v61 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 67 )
{
v62 = malloc(v35 + 1);
v49[4] = v62;
if ( v62 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ULLI", 4uLL) )
{
v63 = malloc(8 * v35);
v49[4] = v63;
if ( v63 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SLLI", 4uLL) )
{
v64 = malloc(8 * v35);
v49[4] = v64;
if ( v64 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "LLI", 3uLL) )
{
v65 = malloc(8 * v35);
v49[4] = v65;
if ( v65 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ULI", 3uLL) )
{
v66 = malloc(8 * v35);
v49[4] = v66;
if ( v66 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "USI", 3uLL) )
{
v67 = malloc(2 * v35);
v49[4] = v67;
if ( v67 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SI", 2uLL) )
{
v68 = malloc(2 * v35);
v49[4] = v68;
if ( v68 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "UI", 2uLL) )
{
v69 = malloc(4 * v35);
v49[4] = v69;
if ( v69 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "LI", 2uLL) )
{
v70 = malloc(8 * v35);
v49[4] = v70;
if ( v70 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 73 )
{
v71 = malloc(4 * v35);
v49[4] = v71;
if ( v71 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ST", 2uLL) )
{
v72 = malloc(8 * v35);
v49[4] = v72;
if ( v72 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 80 )
{
v52 = malloc(8 * v35);
v49[4] = v52;
if ( !v52 )
{
LABEL_60:
Perror("malloc");
return 0LL;
}
}
}
}
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func2(const void ***a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, unsigned __int8 a7, int a8, int a9, int a10, int a11, int a12, int a13, unsigned __int64 a14, __int64 a15)
{
bool v15; // cf
bool v16; // zf
unsigned __int8 *v18; // rsi
__int64 v19; // rcx
unsigned __int8 *v20; // rdi
char v21; // al
bool v22; // cf
bool v23; // zf
__int64 v24; // rcx
const char *v25; // rdi
unsigned __int64 v26; // r14
bool v27; // cf
bool v28; // zf
unsigned __int8 *v29; // rsi
__int64 v30; // rcx
const char *v31; // rdi
char v32; // al
bool v33; // cf
bool v34; // zf
__int64 v35; // r12
unsigned __int64 i; // rbx
const void **v37; // rbx
void *v38; // rax
bool v39; // al
bool v40; // cf
bool v41; // zf
__int64 v42; // rcx
const char *v43; // rdi
bool v44; // cf
bool v45; // zf
__int64 v46; // rcx
const char *v47; // rdi
__int64 v48; // rbx
const void **v49; // rbx
char *v50; // rdx
char v51; // al
void *v52; // rax
_QWORD *v53; // rbp
__int64 *v54; // rbp
__int64 v55; // rax
void *v56; // rax
void *v58; // rax
void *v59; // rax
void *v60; // rax
void *v61; // rax
void *v62; // rax
void *v63; // rax
void *v64; // rax
void *v65; // rax
void *v66; // rax
void *v67; // rax
void *v68; // rax
void *v69; // rax
void *v70; // rax
void *v71; // rax
void *v72; // rax
__int64 v73; // rcx
const char *v74; // rdi

v15 = 0;
v16 = 0;
v18 = &a7;
v19 = 3LL;
v20 = (unsigned __int8 *)&LC0;
do
{
if ( !v19 )
break;
v15 = *v18 < *v20;
v16 = *v18++ == *v20++;
--v19;
}
while ( v16 );
v21 = (!v15 && !v16) - v15;
v22 = 0;
v23 = v21 == 0;
if ( v21 )
{
v18 = &a7;
v24 = 4LL;
v25 = "LINK";
do
{
if ( !v24 )
break;
v22 = *v18 < (unsigned int)*v25;
v23 = *v18++ == *v25++;
--v24;
}
while ( v23 );
if ( (!v22 && !v23) != v22 )
{
v37 = *a1;
v38 = malloc(8 * a14);
v37[2] = v38;
if ( !v38 )
Perror("malloc");
}
}
v26 = a14;
(*a1)[3] = (const void *)a14;
v27 = 0;
v28 = v26 == 0;
if ( v26 )
{
v29 = &a7;
v30 = 2LL;
v31 = "UC";
do
{
if ( !v30 )
break;
v27 = *v29 < (unsigned int)*v31;
v28 = *v29++ == *v31++;
--v30;
}
while ( v28 );
v32 = (!v27 && !v28) - v27;
v33 = 0;
v34 = v32 == 0;
if ( !v32 )
goto LABEL_14;
v29 = &a7;
v73 = 2LL;
v74 = "SC";
do
{
if ( !v73 )
break;
v33 = *v29 < (unsigned int)*v74;
v34 = *v29++ == *v74++;
--v73;
}
while ( v34 );
if ( (!v33 && !v34) == v33 )
{
LABEL_14:
v35 = 1LL;
for ( i = 0LL; i < v26; ++i )
{
v53 = (_QWORD *)(a15 + 8 * i);
v16 = *v53 == -1LL;
*((_QWORD *)(*a1)[2] + i) = *v53 + 1LL;
if ( v16 )
Error("udf_rm: too low value of dimensions", v29);
v35 *= *v53;
}
goto LABEL_28;
}
}
else
{
Error("udf_rm: too low value of number of dimensions", v18);
v39 = memcmp(&a7, "UC", 2uLL) != 0;
v35 = 1LL;
v40 = 0;
v41 = !v39;
if ( !v39 )
goto LABEL_28;
v29 = &a7;
v42 = 2LL;
v43 = "SC";
do
{
if ( !v42 )
break;
v40 = *v29 < (unsigned int)*v43;
v41 = *v29++ == *v43++;
--v42;
}
while ( v41 );
if ( (!v40 && !v41) == v40 )
{
v35 = 1LL;
goto LABEL_28;
}
}
v44 = a7 < 0x43u;
v45 = a7 == 67;
if ( a7 == 67 )
goto LABEL_49;
v29 = &a7;
v46 = 8LL;
v47 = "DISKFILE";
do
{
if ( !v46 )
break;
v44 = *v29 < (unsigned int)*v47;
v45 = *v29++ == *v47++;
--v46;
}
while ( v45 );
if ( (!v44 && !v45) == v44 )
{
LABEL_49:
if ( !v26 )
{
v35 = 1LL;
goto LABEL_28;
}
goto LABEL_14;
}
v35 = 1LL;
v48 = 0LL;
if ( v26 )
{
do
{
v54 = (__int64 *)(a15 + 8 * v48);
v55 = *v54;
*((_QWORD *)(*a1)[2] + v48) = *v54;
if ( !v55 )
Error("udf_rm: too low value of dimensions", v29);
v35 *= *v54;
++v48;
}
while ( v26 != v48 );
}
LABEL_28:
if ( a2 && *(_BYTE *)(a2 + 32) == 109 )
{
*((_BYTE *)*a1 + 96) = 110;
}
else
{
v49 = *a1;
v50 = (char *)**a1;
if ( !memcmp(v50, "LD", 2uLL) )
{
v56 = malloc(16 * v35);
v49[4] = v56;
if ( !v56 )
goto LABEL_60;
}
else
{
v51 = *v50;
if ( *v50 == 68 )
{
v58 = malloc(8 * v35);
v49[4] = v58;
if ( v58 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 70 )
{
v59 = malloc(4 * v35);
v49[4] = v59;
if ( v59 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SC", 2uLL) )
{
v60 = malloc(v35 + 1);
v49[4] = v60;
if ( v60 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "UC", 2uLL) )
{
v61 = malloc(v35 + 1);
v49[4] = v61;
if ( v61 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 67 )
{
v62 = malloc(v35 + 1);
v49[4] = v62;
if ( v62 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ULLI", 4uLL) )
{
v63 = malloc(8 * v35);
v49[4] = v63;
if ( v63 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SLLI", 4uLL) )
{
v64 = malloc(8 * v35);
v49[4] = v64;
if ( v64 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "LLI", 3uLL) )
{
v65 = malloc(8 * v35);
v49[4] = v65;
if ( v65 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ULI", 3uLL) )
{
v66 = malloc(8 * v35);
v49[4] = v66;
if ( v66 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "USI", 3uLL) )
{
v67 = malloc(2 * v35);
v49[4] = v67;
if ( v67 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "SI", 2uLL) )
{
v68 = malloc(2 * v35);
v49[4] = v68;
if ( v68 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "UI", 2uLL) )
{
v69 = malloc(4 * v35);
v49[4] = v69;
if ( v69 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "LI", 2uLL) )
{
v70 = malloc(8 * v35);
v49[4] = v70;
if ( v70 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 73 )
{
v71 = malloc(4 * v35);
v49[4] = v71;
if ( v71 )
return 0LL;
goto LABEL_60;
}
if ( !memcmp(**a1, "ST", 2uLL) )
{
v72 = malloc(8 * v35);
v49[4] = v72;
if ( v72 )
return 0LL;
goto LABEL_60;
}
if ( v51 == 80 )
{
v52 = malloc(8 * v35);
v49[4] = v52;
if ( !v52 )
{
LABEL_60:
Perror("malloc");
return 0LL;
}
}
}
}
return 0LL;
}

original_code:
int m3l_AllocateNodeData(node_t **Lnode, tmpstruct_t TMPSTR, opts_t *Popt)
{
 size_t i, tot_dim;
 if(strncmp(TMPSTR.Type,"DIR",3) != 0 && strncmp(TMPSTR.Type,"LINK",4) != 0 ){
  if ( ( (*Lnode)->fdim = (size_t *)malloc(TMPSTR.ndim* sizeof(size_t))) == ((void *)0))
   Perror("malloc");
 }
 if( ( (*Lnode)->ndim = TMPSTR.ndim) < 1 )
  Error("udf_rm: too low value of number of dimensions");
 tot_dim = 1;
    if( strncmp(TMPSTR.Type,"UC",2) == 0 || strncmp(TMPSTR.Type,"SC",2) == 0 || TMPSTR.Type[0] == 'C' || strncmp(TMPSTR.Type,"DISKFILE",8) == 0){
        for(i=0; i<TMPSTR.ndim; i++){
            if ( ( (*Lnode)->fdim[i] = TMPSTR.dim[i] + 1 ) < 1 )
                Error("udf_rm: too low value of dimensions");
            tot_dim = tot_dim * TMPSTR.dim[i];
        }
    }
    else{
        for(i=0; i<TMPSTR.ndim; i++){
            if ( ( (*Lnode)->fdim[i] = TMPSTR.dim[i] ) < 1 )
                Error("udf_rm: too low value of dimensions");
            tot_dim = tot_dim * TMPSTR.dim[i];
        }
    }
 if(Popt != ((void *)0) && Popt->opt_nomalloc == 'm'){
  (*Lnode)->no_malloc = 'n';
  return 0;
 }
 if (strncmp((*Lnode)->type,"LD",2) == 0){
  if ( ( (*Lnode)->data.ldf = (long double *)malloc(tot_dim*sizeof(long double))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"D",1) == 0){
  if ( ( (*Lnode)->data.df = (double *)malloc(tot_dim*sizeof(double))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"F",1) == 0){
  if ( ( (*Lnode)->data.f = (float *)malloc(tot_dim*sizeof(float))) == ((void *)0))
   Perror("malloc");
 }
 else if (strncmp((*Lnode)->type,"SC",2) == 0){
  if ( ( (*Lnode)->data.sc = (signed char *)malloc((tot_dim+1)*sizeof(signed char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"UC",2) == 0){
  if ( ( (*Lnode)->data.uc = (unsigned char *)malloc((tot_dim+1)*sizeof(unsigned char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"C",1) == 0){
  if ( ( (*Lnode)->data.c = (char *)malloc((tot_dim+1)*sizeof(char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ULLI",4) == 0){
  if ( ( (*Lnode)->data.ulli = (unsigned long long *)malloc(tot_dim*sizeof(unsigned long long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"SLLI",4) == 0){
  if ( ( (*Lnode)->data.slli = (signed long long int *)malloc(tot_dim*sizeof(signed long long int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"LLI",3) == 0){
  if ( ( (*Lnode)->data.lli = (long long int *)malloc(tot_dim*sizeof(long long int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ULI",3) == 0){
  if ( ( (*Lnode)->data.uli = (unsigned long int *)malloc(tot_dim*sizeof(unsigned long int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"USI",3) == 0){
  if ( ( (*Lnode)->data.usi = (unsigned short int *)malloc(tot_dim*sizeof(unsigned short int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"SI",2) == 0){
  if ( ( (*Lnode)->data.si = (short int *)malloc(tot_dim*sizeof(short int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"UI",2) == 0){
  if ( ( (*Lnode)->data.ui = (unsigned int *)malloc(tot_dim*sizeof(unsigned int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"LI",2) == 0){
  if ( ( (*Lnode)->data.li = (long int *)malloc(tot_dim*sizeof(long int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"I",1) == 0){
  if ( ( (*Lnode)->data.i = (int *)malloc(tot_dim *sizeof(int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ST",2) == 0){
  if ( ( (*Lnode)->data.st = (size_t *)malloc(tot_dim*sizeof(size_t))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"PTRDF",1) == 0){
  if ( ( (*Lnode)->data.ptrdf = (ptrdiff_t *)malloc(tot_dim*sizeof(ptrdiff_t))) == ((void *)0))
   Perror("malloc");
 }
 return 0;
}

canonical_original_code:
int m3l_AllocateNodeData(struct node **Lnode, struct tmpstruct TMPSTR, struct opts *Popt)
{
 unsigned long i; unsigned long tot_dim;
 if(strncmp(TMPSTR.Type,"DIR",3) != 0 && strncmp(TMPSTR.Type,"LINK",4) != 0 ){
  if ( ( (*Lnode)->fdim = (unsigned long *)malloc(TMPSTR.ndim* sizeof(unsigned long))) == ((void *)0))
   Perror("malloc");
 }
 if( ( (*Lnode)->ndim = TMPSTR.ndim) < 1 )
  Error("udf_rm: too low value of number of dimensions");
 tot_dim = 1;
    if( strncmp(TMPSTR.Type,"UC",2) == 0 || strncmp(TMPSTR.Type,"SC",2) == 0 || TMPSTR.Type[0] == 'C' || strncmp(TMPSTR.Type,"DISKFILE",8) == 0){
        for(i=0; i<TMPSTR.ndim; i++){
            if ( ( (*Lnode)->fdim[i] = TMPSTR.dim[i] + 1 ) < 1 )
                Error("udf_rm: too low value of dimensions");
            tot_dim = tot_dim * TMPSTR.dim[i];
        }
    }
    else{
        for(i=0; i<TMPSTR.ndim; i++){
            if ( ( (*Lnode)->fdim[i] = TMPSTR.dim[i] ) < 1 )
                Error("udf_rm: too low value of dimensions");
            tot_dim = tot_dim * TMPSTR.dim[i];
        }
    }
 if(Popt != ((void *)0) && Popt->opt_nomalloc == 'm'){
  (*Lnode)->no_malloc = 'n';
  return 0;
 }
 if (strncmp((*Lnode)->type,"LD",2) == 0){
  if ( ( (*Lnode)->data.ldf = (long double *)malloc(tot_dim*sizeof(long double))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"D",1) == 0){
  if ( ( (*Lnode)->data.df = (double *)malloc(tot_dim*sizeof(double))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"F",1) == 0){
  if ( ( (*Lnode)->data.f = (float *)malloc(tot_dim*sizeof(float))) == ((void *)0))
   Perror("malloc");
 }
 else if (strncmp((*Lnode)->type,"SC",2) == 0){
  if ( ( (*Lnode)->data.sc = (char *)malloc((tot_dim+1)*sizeof(char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"UC",2) == 0){
  if ( ( (*Lnode)->data.uc = (unsigned char *)malloc((tot_dim+1)*sizeof(unsigned char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"C",1) == 0){
  if ( ( (*Lnode)->data.c = (char *)malloc((tot_dim+1)*sizeof(char))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ULLI",4) == 0){
  if ( ( (*Lnode)->data.ulli = (unsigned long long *)malloc(tot_dim*sizeof(unsigned long long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"SLLI",4) == 0){
  if ( ( (*Lnode)->data.slli = (long long *)malloc(tot_dim*sizeof(long long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"LLI",3) == 0){
  if ( ( (*Lnode)->data.lli = (long long *)malloc(tot_dim*sizeof(long long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ULI",3) == 0){
  if ( ( (*Lnode)->data.uli = (unsigned long *)malloc(tot_dim*sizeof(unsigned long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"USI",3) == 0){
  if ( ( (*Lnode)->data.usi = (unsigned short *)malloc(tot_dim*sizeof(unsigned short))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"SI",2) == 0){
  if ( ( (*Lnode)->data.si = (short *)malloc(tot_dim*sizeof(short))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"UI",2) == 0){
  if ( ( (*Lnode)->data.ui = (unsigned int *)malloc(tot_dim*sizeof(unsigned int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"LI",2) == 0){
  if ( ( (*Lnode)->data.li = (long *)malloc(tot_dim*sizeof(long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"I",1) == 0){
  if ( ( (*Lnode)->data.i = (int *)malloc(tot_dim *sizeof(int))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"ST",2) == 0){
  if ( ( (*Lnode)->data.st = (unsigned long *)malloc(tot_dim*sizeof(unsigned long))) == ((void *)0))
   Perror("malloc");
 }
 else if(strncmp((*Lnode)->type,"PTRDF",1) == 0){
  if ( ( (*Lnode)->data.ptrdf = (long *)malloc(tot_dim*sizeof(long))) == ((void *)0))
   Perror("malloc");
 }
 return 0;
}

variable_types: struct tmpstruct { char Type[5]; unsigned long ndim; }

variable_types: struct opts { char opt_a; char opt_b; char opt_c; char opt_d; char opt_e; char opt_f; char opt_i; char opt_k; char opt_l; char opt_m; char opt_n; char opt_p; char opt_r; char opt_s; char opt_u; char opt_linkscleanemptrefs; char opt_nomalloc; char opt_tcpencoding; char opt_tcpheader; char opt_shutdown; char opt_add; char opt_MEMCP; char opt_EOBseq; char opt_REOBseq; char opt_format; char opt_xformat; } *


original_code:
node_t *m3l_AllocateNode(tmpstruct_t TMPSTR, opts_t *Popt){
 node_t *Lnode=((void *)0);
 if ( (Lnode = (node_t *)malloc(sizeof(node_t))) == ((void *)0))
  Perror("malloc");
 Lnode->next=((void *)0); Lnode->prev=((void *)0); Lnode->parent=((void *)0); Lnode->child=((void *)0); Lnode->fdim=((void *)0);
 Lnode->type=((void *)0); Lnode->name=((void *)0);
 Lnode->linknode = ((void *)0);
 Lnode->lcounter = 0;
 Lnode->no_malloc = '\0';
 Lnode->ap = 0;
 Lnode->create_time = time(0);
 if ( ( Lnode->type = (char *)malloc(5* sizeof(char))) == ((void *)0))
  Perror("malloc");
 if ( ( Lnode->name = (char *)malloc(48* sizeof(char))) == ((void *)0))
  Perror("malloc");
 if( snprintf(Lnode->type, 5,"%s",TMPSTR.Type) < 0)
  Perror("snprintf");
 if( snprintf(Lnode->name, 48 ,"%s",TMPSTR.Name_Of_List) < 0)
  Perror("snprintf");
 Lnode->ndim = TMPSTR.ndim;
 if(strncmp(TMPSTR.Type,"DIR",3) != 0 && strncmp(TMPSTR.Type,"LINK",4) != 0 ){
  if( m3l_AllocateNodeData(&Lnode, TMPSTR, Popt) != 0)
   Error("AllocateNodeData");
 }
 return Lnode;
}

canonical_original_code:
struct node *m3l_AllocateNode(struct tmpstruct TMPSTR, struct opts *Popt){
 struct node *Lnode = ((void *)0);
 if ( (Lnode = (struct node *)malloc(sizeof(node_t))) == ((void *)0))
  Perror("malloc");
 Lnode->next=((void *)0); Lnode->prev=((void *)0); Lnode->parent=((void *)0); Lnode->child=((void *)0); Lnode->fdim=((void *)0);
 Lnode->type=((void *)0); Lnode->name=((void *)0);
 Lnode->linknode = ((void *)0);
 Lnode->lcounter = 0;
 Lnode->no_malloc = '\0';
 Lnode->ap = 0;
 Lnode->create_time = time(0);
 if ( ( Lnode->type = (char *)malloc(5* sizeof(char))) == ((void *)0))
  Perror("malloc");
 if ( ( Lnode->name = (char *)malloc(48* sizeof(char))) == ((void *)0))
  Perror("malloc");
 if( snprintf(Lnode->type, 5,"%s",TMPSTR.Type) < 0)
  Perror("snprintf");
 if( snprintf(Lnode->name, 48 ,"%s",TMPSTR.Name_Of_List) < 0)
  Perror("snprintf");
 Lnode->ndim = TMPSTR.ndim;
 if(strncmp(TMPSTR.Type,"DIR",3) != 0 && strncmp(TMPSTR.Type,"LINK",4) != 0 ){
  if( m3l_AllocateNodeData(&Lnode, TMPSTR, Popt) != 0)
   Error("AllocateNodeData");
 }
 return Lnode;
}

variable_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } *

user_defined_types: struct tmpstruct { char Type[5]; unsigned long ndim; }


original_code:
size_t m3l_get_ind(size_t ndim, size_t *ind, size_t *dim)
{
 size_t ret_ind, tmp,k,l;
 ret_ind = 0;
 for (k=0; k<ndim-1; k++){
  tmp = 1;
  for (l=k+1; l<ndim; l++)
   tmp = tmp*dim[l];
  ret_ind = ret_ind + ind[k]*tmp;
 }
 ret_ind = ret_ind + ind[ndim-1];
 return ret_ind;
}

canonical_original_code:
unsigned long m3l_get_ind(unsigned long ndim, unsigned long *ind, unsigned long *dim)
{
 unsigned long ret_ind; unsigned long tmp; unsigned long k; unsigned long l;
 ret_ind = 0;
 for (k=0; k<ndim-1; k++){
  tmp = 1;
  for (l=k+1; l<ndim; l++)
   tmp = tmp*dim[l];
  ret_ind = ret_ind + ind[k]*tmp;
 }
 ret_ind = ret_ind + ind[ndim-1];
 return ret_ind;
}

variable_types:
ndim
unsigned long

variable_types:
ind
unsigned long *

variable_types:
dim
unsigned long *

variable_types:
tmp
unsigned long

variable_types:
k
unsigned long

variable_types:
l
unsigned long


original_code:
size_t m3l_get_4nd(size_t i, size_t j, size_t k, size_t l, size_t jm, size_t km, size_t lm)
{
 size_t ret_ind;
  ret_ind = i*jm*km*lm+j*km*lm+k*lm+l;
 return ret_ind;
}

canonical_original_code:
unsigned long m3l_get_4nd(unsigned long i, unsigned long j, unsigned long k, unsigned long l, unsigned long jm, unsigned long km, unsigned long lm)
{
 unsigned long ret_ind;
  ret_ind = i*jm*km*lm+j*km*lm+k*lm+l;
 return ret_ind;
}

variable_types:
j
unsigned long

variable_types:
jm
unsigned long

variable_types:
km
unsigned long

variable_types:
lm
unsigned long


original_code:
size_t m3l_get_3ind(size_t i, size_t j, size_t k, size_t jm, size_t km)
{
 size_t ret_ind;
  ret_ind = i*jm*km+j*km+k;
 return ret_ind;
}

canonical_original_code:
unsigned long m3l_get_3ind(unsigned long i, unsigned long j, unsigned long k, unsigned long jm, unsigned long km)
{
 unsigned long ret_ind;
  ret_ind = i*jm*km+j*km+k;
 return ret_ind;
}

variable_types:
i
unsigned long


decompiled_code:
__int64 __fastcall m3l_get_2ind(__int64 a1, __int64 a2, __int64 a3)
{
return a3 * a1 + a2;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2, __int64 a3)
{
return a3 * a1 + a2;
}

original_code:
size_t m3l_get_2ind(size_t i, size_t j, size_t jm)
{
 size_t ret_ind;
  ret_ind = i*jm+j;
 return ret_ind;
}

canonical_original_code:
unsigned long m3l_get_2ind(unsigned long i, unsigned long j, unsigned long jm)
{
 unsigned long ret_ind;
  ret_ind = i*jm+j;
 return ret_ind;
}


decompiled_code:
const void *__fastcall m3l_get_data_pointer(const void **a1)
{
const void **v1; // rax
char *v2; // rdx
char v3; // r8
const void *v4; // rdx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = (char *)*v1;
if ( !memcmp(*v1, "DIR", 3uLL) )
return 0LL;
if ( !memcmp(*v1, "LD", 2uLL) )
return v1[4];
v3 = *v2;
if ( *v2 == 68 )
return v1[4];
if ( v3 == 70 )
return v1[4];
if ( !memcmp(*v1, "SC", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "UC", 2uLL) )
return v1[4];
if ( v3 == 67 )
return v1[4];
if ( !memcmp(*v1, "ULLI", 4uLL) )
return v1[4];
if ( !memcmp(*v1, "SLLI", 4uLL) )
return v1[4];
if ( !memcmp(*v1, "LLI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "ULI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "USI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "SI", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "UI", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "LI", 2uLL) )
return v1[4];
if ( v3 == 73 )
return v1[4];
if ( !memcmp(*v1, "ST", 2uLL) )
return v1[4];
v4 = 0LL;
if ( v3 == 80 )
v4 = v1[4];
return v4;
}

canonical_decompiled_code:
const void *__fastcall func4(const void **a1)
{
const void **v1; // rax
char *v2; // rdx
char v3; // r8
const void *v4; // rdx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = (char *)*v1;
if ( !memcmp(*v1, "DIR", 3uLL) )
return 0LL;
if ( !memcmp(*v1, "LD", 2uLL) )
return v1[4];
v3 = *v2;
if ( *v2 == 68 )
return v1[4];
if ( v3 == 70 )
return v1[4];
if ( !memcmp(*v1, "SC", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "UC", 2uLL) )
return v1[4];
if ( v3 == 67 )
return v1[4];
if ( !memcmp(*v1, "ULLI", 4uLL) )
return v1[4];
if ( !memcmp(*v1, "SLLI", 4uLL) )
return v1[4];
if ( !memcmp(*v1, "LLI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "ULI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "USI", 3uLL) )
return v1[4];
if ( !memcmp(*v1, "SI", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "UI", 2uLL) )
return v1[4];
if ( !memcmp(*v1, "LI", 2uLL) )
return v1[4];
if ( v3 == 73 )
return v1[4];
if ( !memcmp(*v1, "ST", 2uLL) )
return v1[4];
v4 = 0LL;
if ( v3 == 80 )
v4 = v1[4];
return v4;
}

original_code:
void *m3l_get_data_pointer(node_t *Lnode)
{
 node_t *TmpNode;
 TmpNode = Lnode;
 if(strncmp(Lnode->type, "LINK",4) == 0)
  TmpNode = Lnode->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return ((void *)0);
 if (strncmp(TmpNode->type,"LD",2) == 0){
  return (void *)TmpNode->data.ldf;
 }
 else if(strncmp(TmpNode->type,"D",1) == 0){
  return (void *)TmpNode->data.df;
 }
 else if(strncmp(TmpNode->type,"F",1) == 0){
  return (void *)TmpNode->data.f;
 }
 else if (strncmp(TmpNode->type,"SC",2) == 0){
  return (void *)TmpNode->data.sc;
 }
 else if(strncmp(TmpNode->type,"UC",2) == 0){
  return (void *)TmpNode->data.uc;
 }
 else if(strncmp(TmpNode->type,"C",1) == 0){
  return (void *)TmpNode->data.c;
 }
 else if(strncmp(TmpNode->type,"ULLI",4) == 0){
  return (void *)TmpNode->data.ulli;
 }
 else if(strncmp(TmpNode->type,"SLLI",4) == 0){
  return (void *)TmpNode->data.slli;
 }
 else if(strncmp(TmpNode->type,"LLI",3) == 0){
  return (void *)TmpNode->data.lli;
 }
 else if(strncmp(TmpNode->type,"ULI",3) == 0){
  return (void *)TmpNode->data.uli;
 }
 else if(strncmp(TmpNode->type,"USI",3) == 0){
  return (void *)TmpNode->data.usi;
 }
 else if(strncmp(TmpNode->type,"SI",2) == 0){
  return (void *)TmpNode->data.si;
 }
 else if(strncmp(TmpNode->type,"UI",2) == 0){
  return (void *)TmpNode->data.ui;
 }
 else if(strncmp(TmpNode->type,"LI",2) == 0){
  return (void *)TmpNode->data.li;
 }
 else if(strncmp(TmpNode->type,"I",1) == 0){
  return (void *)TmpNode->data.i;
 }
 else if(strncmp(TmpNode->type,"ST",2) == 0){
  return (void *)TmpNode->data.st;
 }
 else if(strncmp(TmpNode->type,"PTRDF",1) == 0){
  return (void *)TmpNode->data.ptrdf;
 }
 return ((void *)0);
}

canonical_original_code:
void *m3l_get_data_pointer(struct node *Lnode)
{
 struct node *TmpNode;
 TmpNode = Lnode;
 if(strncmp(Lnode->type, "LINK",4) == 0)
  TmpNode = Lnode->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return ((void *)0);
 if (strncmp(TmpNode->type,"LD",2) == 0){
  return (void *)TmpNode->data.ldf;
 }
 else if(strncmp(TmpNode->type,"D",1) == 0){
  return (void *)TmpNode->data.df;
 }
 else if(strncmp(TmpNode->type,"F",1) == 0){
  return (void *)TmpNode->data.f;
 }
 else if (strncmp(TmpNode->type,"SC",2) == 0){
  return (void *)TmpNode->data.sc;
 }
 else if(strncmp(TmpNode->type,"UC",2) == 0){
  return (void *)TmpNode->data.uc;
 }
 else if(strncmp(TmpNode->type,"C",1) == 0){
  return (void *)TmpNode->data.c;
 }
 else if(strncmp(TmpNode->type,"ULLI",4) == 0){
  return (void *)TmpNode->data.ulli;
 }
 else if(strncmp(TmpNode->type,"SLLI",4) == 0){
  return (void *)TmpNode->data.slli;
 }
 else if(strncmp(TmpNode->type,"LLI",3) == 0){
  return (void *)TmpNode->data.lli;
 }
 else if(strncmp(TmpNode->type,"ULI",3) == 0){
  return (void *)TmpNode->data.uli;
 }
 else if(strncmp(TmpNode->type,"USI",3) == 0){
  return (void *)TmpNode->data.usi;
 }
 else if(strncmp(TmpNode->type,"SI",2) == 0){
  return (void *)TmpNode->data.si;
 }
 else if(strncmp(TmpNode->type,"UI",2) == 0){
  return (void *)TmpNode->data.ui;
 }
 else if(strncmp(TmpNode->type,"LI",2) == 0){
  return (void *)TmpNode->data.li;
 }
 else if(strncmp(TmpNode->type,"I",1) == 0){
  return (void *)TmpNode->data.i;
 }
 else if(strncmp(TmpNode->type,"ST",2) == 0){
  return (void *)TmpNode->data.st;
 }
 else if(strncmp(TmpNode->type,"PTRDF",1) == 0){
  return (void *)TmpNode->data.ptrdf;
 }
 return ((void *)0);
}

return_type: void *


decompiled_code:
const void *__fastcall m3l_get_List_dim(const void **a1)
{
const void **v1; // rax

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
return v1[2];
}

canonical_decompiled_code:
const void *__fastcall func5(const void **a1)
{
const void **v1; // rax

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
return v1[2];
}

original_code:
size_t *m3l_get_List_dim(node_t *List){
 node_t *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = List->child;
 return TmpNode->fdim;
}

canonical_original_code:
unsigned long *m3l_get_List_dim(struct node *List){
 struct node *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = List->child;
 return TmpNode->fdim;
}

return_type: unsigned long *


decompiled_code:
__int64 __fastcall m3l_get_List_totdim(const void **a1)
{
const void **v1; // rax
__int64 v2; // rdx
const void *v3; // rdx
_QWORD *v4; // rax
_QWORD *v5; // rcx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = -1LL;
if ( memcmp(*v1, "DIR", 3uLL) )
{
v3 = v1[3];
if ( v3 == (char *)m3l_get_ind + 1 )
{
v2 = *(_QWORD *)v1[2];
}
else if ( v3 )
{
v4 = v1[2];
v5 = &v4[(_QWORD)v3];
v2 = 1LL;
do
v2 *= *v4++;
while ( v4 != v5 );
}
else
{
v2 = 1LL;
}
}
return v2;
}

canonical_decompiled_code:
__int64 __fastcall func6(const void **a1)
{
const void **v1; // rax
__int64 v2; // rdx
const void *v3; // rdx
_QWORD *v4; // rax
_QWORD *v5; // rcx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = -1LL;
if ( memcmp(*v1, "DIR", 3uLL) )
{
v3 = v1[3];
if ( v3 == (char *)m3l_get_ind + 1 )
{
v2 = *(_QWORD *)v1[2];
}
else if ( v3 )
{
v4 = v1[2];
v5 = &v4[(_QWORD)v3];
v2 = 1LL;
do
v2 *= *v4++;
while ( v4 != v5 );
}
else
{
v2 = 1LL;
}
}
return v2;
}

original_code:
size_t m3l_get_List_totdim(node_t *List){
 size_t tot_dim, i;
 node_t *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = List->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return -1;
 tot_dim = 1;
 if(TmpNode->ndim == 1)
  return TmpNode->fdim[0];
 else{
  for(i=0; i<TmpNode->ndim; i++)
   tot_dim = tot_dim*TmpNode->fdim[i];
  return tot_dim;
 }
}

canonical_original_code:
unsigned long m3l_get_List_totdim(struct node *List){
 unsigned long tot_dim; unsigned long i;
 struct node *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = List->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return -1;
 tot_dim = 1;
 if(TmpNode->ndim == 1)
  return TmpNode->fdim[0];
 else{
  for(i=0; i<TmpNode->ndim; i++)
   tot_dim = tot_dim*TmpNode->fdim[i];
  return tot_dim;
 }
}


decompiled_code:
__int64 __fastcall m3l_get_List_ndim(__int64 a1)
{
return *(_QWORD *)(a1 + 24);
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
return *(_QWORD *)(a1 + 24);
}

original_code:
size_t m3l_get_List_ndim(node_t *List){
 return List->ndim;
}

canonical_original_code:
unsigned long m3l_get_List_ndim(struct node *List){
 return List->ndim;
}


decompiled_code:
__int64 __fastcall m3l_get_List_type(__int64 a1)
{
return *(_QWORD *)a1;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
return *(_QWORD *)a1;
}

original_code:
char *m3l_get_List_type(node_t *List){
 return List->type;
}

canonical_original_code:
char *m3l_get_List_type(struct node *List){
 return List->type;
}

return_type: char *


decompiled_code:
__int64 __fastcall m3l_get_List_name(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

original_code:
char *m3l_get_List_name(node_t *List){
 return List->name;
}

canonical_original_code:
char *m3l_get_List_name(struct node *List){
 return List->name;
}


decompiled_code:
__int64 __fastcall m3l_get_Found_number(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1)
{
return *(_QWORD *)(a1 + 8);
}

original_code:
size_t m3l_get_Found_number(find_t *Founds){
 return Founds->founds;
}

canonical_original_code:
unsigned long m3l_get_Found_number(struct find *Founds){
 return Founds->founds;
}

variable_types: struct find { struct find_str { struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str **linknode; unsigned long lcounter; char no_malloc; int ap; } *List; } **Found_Nodes; unsigned long founds; struct node *Home_Node; } *


decompiled_code:
__int64 __fastcall m3l_get_Found_node(_QWORD *a1, __int64 a2)
{
return **(_QWORD **)(*a1 + 8 * a2);
}

canonical_decompiled_code:
__int64 __fastcall func11(_QWORD *a1, __int64 a2)
{
return **(_QWORD **)(*a1 + 8 * a2);
}

original_code:
node_t *m3l_get_Found_node(find_t *Founds, size_t i){
 return Founds->Found_Nodes[i]->List;
}

canonical_original_code:
struct node *m3l_get_Found_node(struct find *Founds, unsigned long i){
 return Founds->Found_Nodes[i]->List;
}

variable_types: struct find { struct find_str **Found_Nodes; unsigned long founds; struct node *Home_Node; } *


decompiled_code:
__int64 __fastcall m3l_get_List_no_malloc(const void **a1)
{
const void **v1; // rax
bool v2; // zf
unsigned int v3; // ecx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = memcmp(*v1, "DIR", 3uLL) == 0;
v3 = 101;
if ( !v2 )
v3 = *((unsigned __int8 *)v1 + 96);
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func12(const void **a1)
{
const void **v1; // rax
bool v2; // zf
unsigned int v3; // ecx

v1 = a1;
if ( !memcmp(*a1, "LINK", 4uLL) )
v1 = (const void **)v1[9];
v2 = memcmp(*v1, "DIR", 3uLL) == 0;
v3 = 101;
if ( !v2 )
v3 = *((unsigned __int8 *)v1 + 96);
return v3;
}

original_code:
char m3l_get_List_no_malloc(node_t *List){
 node_t *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = TmpNode->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return 'e';
 return TmpNode->no_malloc;
}

canonical_original_code:
char m3l_get_List_no_malloc(struct node *List){
 struct node *TmpNode;
 TmpNode = List;
 if(strncmp(TmpNode->type, "LINK",4) == 0)
  TmpNode = TmpNode->child;
 if(strncmp( TmpNode->type,"DIR",3) == 0)
  return 'e';
 return TmpNode->no_malloc;
}

return_type: char


decompiled_code:
const void *__fastcall m3l_detach_data_from_List(const void ***a1)
{
bool v1; // cf
bool v2; // zf
const void **v4; // rdx
const char *v5; // rsi
__int64 v6; // rcx
const char *v7; // rdi
const void *result; // rax

v4 = *a1;
v5 = (const char *)**a1;
v6 = 4LL;
v7 = "LINK";
do
{
if ( !v6 )
break;
v1 = *v5 < (unsigned int)*v7;
v2 = *v5++ == *v7++;
--v6;
}
while ( v2 );
if ( (!v1 && !v2) == v1 )
{
Warning("m3l_detach_data_from_List: Can not detach LINK type list", v5, v4, v6);
result = 0LL;
}
else
{
result = m3l_get_data_pointer(v4);
if ( result )
*((_BYTE *)*a1 + 96) = 110;
}
return result;
}

canonical_decompiled_code:
const void *__fastcall func13(const void ***a1)
{
bool v1; // cf
bool v2; // zf
const void **v4; // rdx
const char *v5; // rsi
__int64 v6; // rcx
const char *v7; // rdi
const void *result; // rax

v4 = *a1;
v5 = (const char *)**a1;
v6 = 4LL;
v7 = "LINK";
do
{
if ( !v6 )
break;
v1 = *v5 < (unsigned int)*v7;
v2 = *v5++ == *v7++;
--v6;
}
while ( v2 );
if ( (!v1 && !v2) == v1 )
{
Warning("m3l_detach_data_from_List: Can not detach LINK type list", v5, v4, v6);
result = 0LL;
}
else
{
result = func4(v4);
if ( result )
*((_BYTE *)*a1 + 96) = 110;
}
return result;
}

original_code:
void *m3l_detach_data_from_List(node_t **List, opts_t *Popts)
{
 node_t *RetNode=((void *)0);
 if(strncmp((*List)->type, "LINK",4) == 0){
  Warning("m3l_detach_data_from_List: Can not detach LINK type list");
  return ((void *)0);
 }
 if( (RetNode = m3l_get_data_pointer( *List )) != ((void *)0)){
  (*List)->no_malloc = 'n';
  return RetNode;
 }
 else{
  return ((void *)0);
 }
}

canonical_original_code:
void *m3l_detach_data_from_List(struct node **List, struct opts *Popts)
{
 struct node *RetNode = ((void *)0);
 if(strncmp((*List)->type, "LINK",4) == 0){
  Warning("m3l_detach_data_from_List: Can not detach LINK type list");
  return ((void *)0);
 }
 if( (RetNode = m3l_get_data_pointer( *List )) != ((void *)0)){
  (*List)->no_malloc = 'n';
  return RetNode;
 }
 else{
  return ((void *)0);
 }
}

variable_types: struct node { char *type; char *name; unsigned long *fdim; unsigned long ndim; union data_t { void *v; float *f; double *df; long double *ldf; char *c; char *sc; unsigned char *uc; short *si; unsigned short *usi; int *i; unsigned int *ui; long *li; unsigned long *uli; long long *lli; long long *slli; unsigned long long *ulli; unsigned long *st; long *ptrdf; } data; long create_time; struct node *next; struct find_str { struct node *List; } **linknode; unsigned long lcounter; char no_malloc; int ap; } **