decompiled_code:
__int64 __fastcall stream_read(__int64 a1, __int64 a2, __int64 a3)
{
_BOOL4 v4; // er14
int v5; // ebx
int v6; // ebx
int v7; // ebx
__int64 result; // rax

v4 = *(_QWORD *)(a1 + 64) == 0LL;
v5 = check_error_noquit(0LL, "stream_read : stream == NULL\n");
v6 = check_error_noquit(v4, "stream_read : Le flux n'est pas ouvert\n") | v5;
v7 = check_error_noquit(a2 == 0, "stream_read : buffer == NULL\n") | v6;
if ( v7 | (unsigned int)check_error_noquit(a3 == 0, "stream_read : size <= 0\n") )
result = 4294967294LL;
else
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(a1 + 24))(a1 + 64, a2, a3);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(__int64 a1, __int64 a2, __int64 a3)
{
_BOOL4 v4; // er14
int v5; // ebx
int v6; // ebx
int v7; // ebx
__int64 result; // rax

v4 = *(_QWORD *)(a1 + 64) == 0LL;
v5 = check_error_noquit(0LL, "stream_read : stream == NULL\n");
v6 = check_error_noquit(v4, "stream_read : Le flux n'est pas ouvert\n") | v5;
v7 = check_error_noquit(a2 == 0, "stream_read : buffer == NULL\n") | v6;
if ( v7 | (unsigned int)check_error_noquit(a3 == 0, "stream_read : size <= 0\n") )
result = 4294967294LL;
else
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(a1 + 24))(a1 + 64, a2, a3);
return result;
}

original_code:
int stream_read(stream_t* stream, void* buffer, size_t size) {
    int openflag = (stream->sd.data == ((void *)0));
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_read : stream == NULL\n");
    error = error | check_error_noquit(openflag
        , "stream_read : Le flux n'est pas ouvert\n");
    error = error | check_error_noquit((buffer == ((void *)0))
        , "stream_read : buffer == NULL\n");
    error = error | check_error_noquit((size <= 0)
        , "stream_read : size <= 0\n");
    if (error) {
        return -2;
    }
 return stream->op._read(&stream->sd, buffer, size);
}

canonical_original_code:
int stream_read(struct stream_t *stream, void *buffer, unsigned long size) {
    int openflag = (stream->sd.data == ((void *)0));
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_read : stream == NULL\n");
    error = error | check_error_noquit(openflag
        , "stream_read : Le flux n'est pas ouvert\n");
    error = error | check_error_noquit((buffer == ((void *)0))
        , "stream_read : buffer == NULL\n");
    error = error | check_error_noquit((size <= 0)
        , "stream_read : size <= 0\n");
    if (error) {
        return -2;
    }
 return stream->op._read(&stream->sd, buffer, size);
}

variable_types:
buffer
void *


repo: lesbeben/projetSE

decompiled_code:
__int64 __fastcall stream_write(__int64 a1, __int64 a2, __int64 a3)
{
_BOOL4 v4; // er14
int v5; // ebx
int v6; // ebx
int v7; // ebx
__int64 result; // rax

v4 = *(_QWORD *)(a1 + 64) == 0LL;
v5 = check_error_noquit(0LL, "stream_write : stream == NULL\n");
v6 = check_error_noquit(v4, "stream_write : Le flux n'est pas ouvert\n") | v5;
v7 = check_error_noquit(a2 == 0, "stream_write : buffer == NULL\n") | v6;
if ( v7 | (unsigned int)check_error_noquit(a3 == 0, "stream_write : size <= 0\n") )
result = 4294967294LL;
else
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(a1 + 32))(a1 + 64, a2, a3);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, __int64 a2, __int64 a3)
{
_BOOL4 v4; // er14
int v5; // ebx
int v6; // ebx
int v7; // ebx
__int64 result; // rax

v4 = *(_QWORD *)(a1 + 64) == 0LL;
v5 = check_error_noquit(0LL, "stream_write : stream == NULL\n");
v6 = check_error_noquit(v4, "stream_write : Le flux n'est pas ouvert\n") | v5;
v7 = check_error_noquit(a2 == 0, "stream_write : buffer == NULL\n") | v6;
if ( v7 | (unsigned int)check_error_noquit(a3 == 0, "stream_write : size <= 0\n") )
result = 4294967294LL;
else
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(a1 + 32))(a1 + 64, a2, a3);
return result;
}

original_code:
int stream_write(stream_t* stream, void* buffer, size_t size) {
    int openflag = (stream->sd.data == ((void *)0));
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_write : stream == NULL\n");
    error = error | check_error_noquit(openflag
        , "stream_write : Le flux n'est pas ouvert\n");
    error = error | check_error_noquit((buffer == ((void *)0))
        , "stream_write : buffer == NULL\n");
    error = error | check_error_noquit((size <= 0)
        , "stream_write : size <= 0\n");
    if (error) {
        return -2;
    }
 return stream->op._write(&stream->sd, buffer, size);
}

canonical_original_code:
int stream_write(struct stream_t *stream, void *buffer, unsigned long size) {
    int openflag = (stream->sd.data == ((void *)0));
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_write : stream == NULL\n");
    error = error | check_error_noquit(openflag
        , "stream_write : Le flux n'est pas ouvert\n");
    error = error | check_error_noquit((buffer == ((void *)0))
        , "stream_write : buffer == NULL\n");
    error = error | check_error_noquit((size <= 0)
        , "stream_write : size <= 0\n");
    if (error) {
        return -2;
    }
 return stream->op._write(&stream->sd, buffer, size);
}

variable_types: struct stream_t { struct operation_t { int (*_create)(struct streamd_t { void *data; } *, char *, unsigned long); int (*_open)(struct streamd_t *, char *, int); int (*_close)(struct streamd_t *); int (*_read)(struct streamd_t *, void *, unsigned long); int (*_write)(struct streamd_t *, void *, unsigned long); int (*_getfd)(struct streamd_t *); int (*_unlink)(char *); char name[4]; } op; struct streamd_t sd; } *

variable_types:
size
unsigned long

variable_types: openflag int

variable_types: error int

return_type: int

user_defined_types: struct stream_t { struct operation_t op; struct streamd_t sd; }

user_defined_types: struct operation_t { int (*_create)(struct streamd_t *, char *, unsigned long); int (*_open)(struct streamd_t *, char *, int); int (*_close)(struct streamd_t *); int (*_read)(struct streamd_t *, void *, unsigned long); int (*_write)(struct streamd_t *, void *, unsigned long); int (*_getfd)(struct streamd_t *); int (*_unlink)(char *); char name[4]; }


decompiled_code:
__int64 __fastcall stream_unlink(__int64 a1, __int64 a2)
{
int v2; // er12

v2 = check_error_noquit(a1 == 0, "stream_unlink : stream == NULL\n");
if ( (unsigned int)check_error_noquit(a2 == 0, "stream_unlink : name == NULL\n") | v2 )
return 4294967294LL;
manager_removestream(a1);
return (*(__int64 (__fastcall **)(__int64))(a1 + 48))(a2);
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, __int64 a2)
{
int v2; // er12

v2 = check_error_noquit(a1 == 0, "stream_unlink : stream == NULL\n");
if ( (unsigned int)check_error_noquit(a2 == 0, "stream_unlink : name == NULL\n") | v2 )
return 4294967294LL;
manager_removestream(a1);
return (*(__int64 (__fastcall **)(__int64))(a1 + 48))(a2);
}

original_code:
int stream_unlink(stream_t* stream, const char* name) {
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_unlink : stream == NULL\n");
    error = error | check_error_noquit((name == ((void *)0))
        , "stream_unlink : name == NULL\n");
    if (error) {
        return -2;
    }
    manager_removestream(stream);
 return stream->op._unlink(name);
}

canonical_original_code:
int stream_unlink(struct stream_t *stream, char *name) {
    int error = 0;
    error = error | check_error_noquit((stream == ((void *)0))
        , "stream_unlink : stream == NULL\n");
    error = error | check_error_noquit((name == ((void *)0))
        , "stream_unlink : name == NULL\n");
    if (error) {
        return -2;
    }
    manager_removestream(stream);
 return stream->op._unlink(name);
}

variable_types:
name
char *


decompiled_code:
__int64 __fastcall add_answer_func(__int64 a1, char *a2, size_t a3)
{
snprintf(a2, a3, "%d", (unsigned int)(*(_DWORD *)(a1 + 20) + *(_DWORD *)(a1 + 16)));
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, char *a2, size_t a3)
{
snprintf(a2, a3, "%d", (unsigned int)(*(_DWORD *)(a1 + 20) + *(_DWORD *)(a1 + 16)));
return 0LL;
}

original_code:
int add_answer_func(request_t* req, char* buffer, size_t buffsize) {
 int res = 0;
 int x = *((int*) (req->data));
 int y = *((int*) (req->data) + 1);
 snprintf(buffer, buffsize, "%d", x + y);
 return res;
}

canonical_original_code:
int add_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 int res = 0;
 int x = *((int*) (req->data));
 int y = *((int*) (req->data) + 1);
 snprintf(buffer, buffsize, "%d", x + y);
 return res;
}

variable_types: struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *

variable_types:
buffer
char *

variable_types:
buffsize
unsigned long

variable_types: res int

variable_types: x int

variable_types: y int


getCommand

decompiled_code:
__int64 getCommand()
{
return add_answer_cmd;
}

canonical_decompiled_code:
__int64 func7()
{
return add_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return add_answer_cmd;
}

return_type: struct answer_cmd_t { char cmd_name[4]; int (*answer_cmd_func)(struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *, char *, unsigned long); }

user_defined_types: struct answer_cmd_t { char cmd_name[4]; int (*answer_cmd_func)(struct request_t *, char *, unsigned long); }


decompiled_code:
int add_help()
{
puts("Commande ADD");
puts(" Additionne 2 entiers x et y");
puts(" Usage : ");
return puts(" \"ADD x y\"");
}

canonical_decompiled_code:
int func6()
{
puts("Commande ADD");
puts(" Additionne 2 entiers x et y");
puts(" Usage : ");
return puts(" \"ADD x y\"");
}

original_code:
void add_help() {
    printf("Commande ADD\n");
    printf("  Additionne 2 entiers x et y\n");
    printf("  Usage : \n");
    printf("    \"ADD x y\"\n");
}

return_type: void


decompiled_code:
__int64 __fastcall add_request_func(char *src)
{
int v1; // ebx
int *v2; // rax
int *v3; // r12
char *v4; // rdx
int v5; // er13
char *v6; // rax
__int64 v7; // r12
__pid_t v8; // eax
__int64 result; // rax
char *nptr; // [rsp+0h] [rbp-38h] BYREF
char *endptr; // [rsp+8h] [rbp-30h] BYREF

v1 = strtol(src + 3, &nptr, 0);
v2 = __errno_location();
v3 = v2;
if ( !*v2 || (v4 = src + 3, v1) )
{
*v2 = 0;
v5 = strtol(nptr, &endptr, 0);
if ( !*v3 || v5 )
{
*v3 = 0;
v6 = (char *)malloc(0x20uLL);
*(_QWORD *)v6 = 32LL;
v7 = (__int64)v6;
strncpy(v6 + 12, src, 3uLL);
*(_BYTE *)(v7 + 15) = 0;
v8 = getpid();
*(_DWORD *)(v7 + 16) = v1;
*(_DWORD *)(v7 + 8) = v8;
result = v7;
*(_DWORD *)(v7 + 20) = v5;
return result;
}
v4 = endptr;
}
fprintf(stderr, "%s n'est pas un entier\n", v4);
add_help();
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(char *src)
{
int v1; // ebx
int *v2; // rax
int *v3; // r12
char *v4; // rdx
int v5; // er13
char *v6; // rax
__int64 v7; // r12
__pid_t v8; // eax
__int64 result; // rax
char *nptr; // [rsp+0h] [rbp-38h] BYREF
char *endptr; // [rsp+8h] [rbp-30h] BYREF

v1 = strtol(src + 3, &nptr, 0);
v2 = __errno_location();
v3 = v2;
if ( !*v2 || (v4 = src + 3, v1) )
{
*v2 = 0;
v5 = strtol(nptr, &endptr, 0);
if ( !*v3 || v5 )
{
*v3 = 0;
v6 = (char *)malloc(0x20uLL);
*(_QWORD *)v6 = 32LL;
v7 = (__int64)v6;
strncpy(v6 + 12, src, 3uLL);
*(_BYTE *)(v7 + 15) = 0;
v8 = getpid();
*(_DWORD *)(v7 + 16) = v1;
*(_DWORD *)(v7 + 8) = v8;
result = v7;
*(_DWORD *)(v7 + 20) = v5;
return result;
}
v4 = endptr;
}
fprintf(stderr, "%s n'est pas un entier\n", v4);
func6();
return 0LL;
}

original_code:
request_t* add_request_func(const char* cmd) {
 char* tailptr;
 char* tailptr2;
 int x = 0;
 int y = 0;
 x = strtol(cmd + 3, &tailptr, 0);
 if (((*__errno_location ()) == 34 && (x == 0x7fffffffffffffffL || x == (-0x7fffffffffffffffL - 1L)))
     || ((*__errno_location ()) != 0 && x == 0)) {
     fprintf(stderr, "%s n'est pas un entier\n", cmd + 3);
     add_help();
     return ((void *)0);
 }
 (*__errno_location ()) = 0;
 y = strtol(tailptr, &tailptr2, 0);
 if (((*__errno_location ()) == 34 && (y == 0x7fffffffffffffffL || y == (-0x7fffffffffffffffL - 1L)))
     || ((*__errno_location ()) != 0 && y == 0)) {
     fprintf(stderr, "%s n'est pas un entier\n", tailptr2);
     add_help();
     return ((void *)0);
 }
 (*__errno_location ()) = 0;
 request_t* req = malloc(sizeof(request_t) + 2 * sizeof(int));
 req->size = sizeof(request_t) + 2 * sizeof(int);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 *((int*)req->data) = x;
 *((int*)req->data + 1) = y;
 return req;
}

canonical_original_code:
struct request_t *add_request_func(char *cmd) {
 char *tailptr;
 char *tailptr2;
 int x = 0;
 int y = 0;
 x = strtol(cmd + 3, &tailptr, 0);
 if (((*__errno_location ()) == 34 && (x == 0x7fffffffffffffffL || x == (-0x7fffffffffffffffL - 1L)))
     || ((*__errno_location ()) != 0 && x == 0)) {
     fprintf(stderr, "%s n'est pas un entier\n", cmd + 3);
     add_help();
     return ((void *)0);
 }
 (*__errno_location ()) = 0;
 y = strtol(tailptr, &tailptr2, 0);
 if (((*__errno_location ()) == 34 && (y == 0x7fffffffffffffffL || y == (-0x7fffffffffffffffL - 1L)))
     || ((*__errno_location ()) != 0 && y == 0)) {
     fprintf(stderr, "%s n'est pas un entier\n", tailptr2);
     add_help();
     return ((void *)0);
 }
 (*__errno_location ()) = 0;
 struct request_t *req = malloc(sizeof(request_t) + 2 * sizeof(int));
 req->size = sizeof(request_t) + 2 * sizeof(int);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 *((int *)req->data) = x;
 *((int *)req->data + 1) = y;
 return req;
}

variable_types:
cmd
char *

variable_types:
tailptr
char *

return_type: struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *


decompiled_code:
__int64 __fastcall get_answer(__int64 a1, char *a2, size_t a3)
{
char *v4; // rbx
const char *v5; // r12

if ( !a1 || !a2 )
{
snprintf(a2, a3, "Erreur interne du server");
return 0xFFFFFFFFLL;
}
v4 = dl_list;
v5 = (const char *)(a1 + 12);
if ( !dl_list )
{
LABEL_8:
fprintf(stderr, "Commande %s inconnue\n", v5);
snprintf(a2, a3, "Commande %s inconnue", v5);
return 0xFFFFFFFFLL;
}
while ( strncmp(v5, v4, 3uLL) )
{
v4 = (char *)*((_QWORD *)v4 + 3);
if ( !v4 )
goto LABEL_8;
}
return (*((__int64 (__fastcall **)(__int64, char *, size_t))v4 + 1))(a1, a2, a3);
}

canonical_decompiled_code:
__int64 __fastcall func1(__int64 a1, char *a2, size_t a3)
{
char *v4; // rbx
const char *v5; // r12

if ( !a1 || !a2 )
{
snprintf(a2, a3, "Erreur interne du server");
return 0xFFFFFFFFLL;
}
v4 = dl_list;
v5 = (const char *)(a1 + 12);
if ( !dl_list )
{
LABEL_8:
fprintf(stderr, "Commande %s inconnue\n", v5);
snprintf(a2, a3, "Commande %s inconnue", v5);
return 0xFFFFFFFFLL;
}
while ( strncmp(v5, v4, 3uLL) )
{
v4 = (char *)*((_QWORD *)v4 + 3);
if ( !v4 )
goto LABEL_8;
}
return (*((__int64 (__fastcall **)(__int64, char *, size_t))v4 + 1))(a1, a2, a3);
}

original_code:
int get_answer(request_t* req, char* buffer, size_t buffsize) {
 if ((req != ((void *)0)) && (buffer != ((void *)0))) {
  dl_list_t elmnt = dl_list;
  while (elmnt != ((void *)0)) {
   if (strncmp(req->cmdname, elmnt->cmd.cmd_name, 3) == 0) {
    return elmnt->cmd.answer_cmd_func(req, buffer, buffsize);
   }
   elmnt = elmnt->next;
  }
  fprintf(stderr, "Commande %s inconnue\n", req->cmdname);
  snprintf(buffer, buffsize, "Commande %s inconnue", req->cmdname);
 }else {
  snprintf(buffer, buffsize, "Erreur interne du server");
 }
 return -1;
}

canonical_original_code:
int get_answer(struct request_t *req, char *buffer, unsigned long buffsize) {
 if ((req != ((void *)0)) && (buffer != ((void *)0))) {
  struct DL_LIST *elmnt = dl_list;
  while (elmnt != ((void *)0)) {
   if (strncmp(req->cmdname, elmnt->cmd.cmd_name, 3) == 0) {
    return elmnt->cmd.answer_cmd_func(req, buffer, buffsize);
   }
   elmnt = elmnt->next;
  }
  fprintf(stderr, "Commande %s inconnue\n", req->cmdname);
  snprintf(buffer, buffsize, "Commande %s inconnue", req->cmdname);
 }else {
  snprintf(buffer, buffsize, "Erreur interne du server");
 }
 return -1;
}

variable_types: struct DL_LIST { struct answer_cmd_t { char cmd_name[4]; int (*answer_cmd_func)(struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *, char *, unsigned long); } cmd; void *handler; struct DL_LIST *next; } *

user_defined_types: struct DL_LIST { struct answer_cmd_t cmd; void *handler; struct DL_LIST *next; }


decompiled_code:
void request_manager_close()
{
char *v0; // rbp
char *v1; // rbx
char *v2; // rax

v0 = dl_list;
if ( dl_list )
{
while ( 1 )
{
if ( dlclose(*((void **)v0 + 2)) == -1 )
{
v2 = dlerror();
fprintf(stderr, "dlclose : %s\n", v2);
raise(15);
}
v1 = (char *)*((_QWORD *)v0 + 3);
free(v0);
if ( !v1 )
break;
v0 = v1;
}
}
}

canonical_decompiled_code:
void func2()
{
char *v0; // rbp
char *v1; // rbx
char *v2; // rax

v0 = dl_list;
if ( dl_list )
{
while ( 1 )
{
if ( dlclose(*((void **)v0 + 2)) == -1 )
{
v2 = dlerror();
fprintf(stderr, "dlclose : %s\n", v2);
raise(15);
}
v1 = (char *)*((_QWORD *)v0 + 3);
free(v0);
if ( !v1 )
break;
v0 = v1;
}
}
}

original_code:
void request_manager_close() {
 dl_list_t elmnt = dl_list;
 while (elmnt != ((void *)0)) {
  if (dlclose(elmnt->handler) == -1) {
   fprintf(stderr, "dlclose : %s\n", dlerror());
   raise(15);
  }
  dl_list_t next = elmnt->next;
  free(elmnt);
  elmnt = next;
 }
}

canonical_original_code:
void request_manager_close() {
 struct DL_LIST *elmnt = dl_list;
 while (elmnt != ((void *)0)) {
  if (dlclose(elmnt->handler) == -1) {
   fprintf(stderr, "dlclose : %s\n", dlerror());
   raise(15);
  }
  struct DL_LIST *next = elmnt->next;
  free(elmnt);
  elmnt = next;
 }
}

variable_types: struct DL_LIST { struct request_cmd_t { char cmd_name[4]; struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *(*request_cmd_func)(char *); void (*help)(); } cmd; void *handler; struct DL_LIST *next; } *

user_defined_types: struct DL_LIST { struct request_cmd_t cmd; void *handler; struct DL_LIST *next; }

user_defined_types: struct request_cmd_t { char cmd_name[4]; struct request_t *(*request_cmd_func)(char *); void (*help)(); }


decompiled_code:
__int64 __fastcall con_answer_func(__int64 a1, _BYTE *a2)
{
*a2 = 0;
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func5(__int64 a1, _BYTE *a2)
{
*a2 = 0;
return 0LL;
}

original_code:
int con_answer_func(request_t* req, char* buffer, size_t buffsize) {
 strcpy(buffer, "");
 return 0;
}

canonical_original_code:
int con_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 strcpy(buffer, "");
 return 0;
}

user_defined_types: struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; }


decompiled_code:
__int64 getCommand()
{
return con_answer_cmd;
}

canonical_decompiled_code:
__int64 func6()
{
return con_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return con_answer_cmd;
}


decompiled_code:
__int64 __fastcall set_answer_func(__int64 a1, char *a2, unsigned __int64 a3)
{
if ( a3 <= 3 )
return 0xFFFFFFFFLL;
strncpy(a2, (const char *)(a1 + 16), 3uLL)[3] = 0;
return 4294967294LL;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, char *a2, unsigned __int64 a3)
{
if ( a3 <= 3 )
return 0xFFFFFFFFLL;
strncpy(a2, (const char *)(a1 + 16), 3uLL)[3] = 0;
return 4294967294LL;
}

original_code:
int set_answer_func(request_t* req, char* buffer, size_t buffsize) {
 if (buffsize < 4) {
  return -1;
 }
 strncpy(buffer, ((char*)req->data), 3);
 buffer[3] = '\0';
 return -2;
}

canonical_original_code:
int set_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 if (buffsize < 4) {
  return -1;
 }
 strncpy(buffer, ((char *)req->data), 3);
 buffer[3] = '\0';
 return -2;
}


decompiled_code:
__int64 getCommand()
{
return set_answer_cmd;
}

canonical_decompiled_code:
__int64 func7()
{
return set_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return set_answer_cmd;
}


done

decompiled_code:
void done()
{
is_done = 1;
}

canonical_decompiled_code:
void func0()
{
is_done = 1;
}

original_code:
void done() {
 is_done = 1;
}

canonical_original_code:
void done() {
 is_done = 1;
}


isDone

decompiled_code:
__int64 isDone()
{
return (unsigned int)is_done;
}

canonical_decompiled_code:
__int64 func2()
{
return (unsigned int)is_done;
}

original_code:
int isDone() {
 return is_done;
}

canonical_original_code:
int isDone() {
 return is_done;
}


decompiled_code:
__int64 __fastcall gid_answer_func(__int64 a1, char *a2, size_t a3)
{
struct group *v4; // rax
__int64 result; // rax

v4 = getgrgid(*(_DWORD *)(a1 + 16));
if ( v4 )
{
snprintf(a2, a3, "%s", v4->gr_name);
result = 0LL;
}
else
{
snprintf(a2, a3, "Erreur lors de la lecture du gid : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
result = 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, char *a2, size_t a3)
{
struct group *v4; // rax
__int64 result; // rax

v4 = getgrgid(*(_DWORD *)(a1 + 16));
if ( v4 )
{
snprintf(a2, a3, "%s", v4->gr_name);
result = 0LL;
}
else
{
snprintf(a2, a3, "Erreur lors de la lecture du gid : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
int gid_answer_func(request_t* req, char* buffer, size_t buffsize) {
 int res = 0;
 struct group* grp = getgrgid(*((int*) (req->data)));
 if (grp == ((void *)0)) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture du gid : %d"
    , *((int*) (req->data)));
  fprintf(stderr, "%s\n", buffer);
  res = -1;
 } else {
  snprintf(buffer, buffsize, "%s", grp->gr_name);
 }
 return res;
}

canonical_original_code:
int gid_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 int res = 0;
 struct group *grp = getgrgid(*((int*) (req->data)));
 if (grp == ((void *)0)) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture du gid : %d"
    , *((int *) (req->data)));
  fprintf(stderr, "%s\n", buffer);
  res = -1;
 } else {
  snprintf(buffer, buffsize, "%s", grp->gr_name);
 }
 return res;
}

variable_types: struct group { char *gr_name; char *gr_passwd; unsigned int gr_gid; char **gr_mem; } *


getCommand

decompiled_code:
__int64 getCommand()
{
return gid_answer_cmd;
}

canonical_decompiled_code:
__int64 func7()
{
return gid_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return gid_answer_cmd;
}


decompiled_code:
void exi_help()
{
;
}

canonical_decompiled_code:
void func6()
{
;
}

original_code:
void exi_help() {
}

canonical_original_code:
void exi_help() {
}


decompiled_code:
char *__fastcall exi_request_func(char *src)
{
char *v1; // rax
char *v2; // r12

v1 = (char *)malloc(0x18uLL);
*(_QWORD *)v1 = 24LL;
v2 = v1;
strncpy(v1 + 12, src, 3uLL);
v2[15] = 0;
*((_DWORD *)v2 + 2) = getpid();
return v2;
}

canonical_decompiled_code:
char *__fastcall func7(char *src)
{
char *v1; // rax
char *v2; // r12

v1 = (char *)malloc(0x18uLL);
*(_QWORD *)v1 = 24LL;
v2 = v1;
strncpy(v1 + 12, src, 3uLL);
v2[15] = 0;
*((_DWORD *)v2 + 2) = getpid();
return v2;
}

original_code:
request_t* exi_request_func(const char* cmd) {
 request_t* req = malloc(sizeof(request_t));
 req->size = sizeof(request_t);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 return req;
}

canonical_original_code:
struct request_t *exi_request_func(char *cmd) {
 struct request_t *req = malloc(sizeof(request_t));
 req->size = sizeof(request_t);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 return req;
}


decompiled_code:
__int64 __fastcall time_answer_func(__int64 a1, char *a2, size_t a3)
{
struct tm *v4; // rdi
char *v5; // rax
const char *v7; // rdi
time_t timer; // [rsp+8h] [rbp-20h] BYREF

timer = time(0LL);
if ( timer == -1 )
{
v7 = "time";
}
else
{
v4 = localtime(&timer);
if ( v4 )
{
v5 = asctime(v4);
snprintf(a2, a3, "%s", v5);
return 0LL;
}
v7 = (const char *)&unk_2007;
}
perror(v7);
snprintf(a2, a3, "Erreur lors de la lecture de l'heure");
fprintf(stderr, "%s\n", a2);
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, char *a2, size_t a3)
{
struct tm *v4; // rdi
char *v5; // rax
const char *v7; // rdi
time_t timer; // [rsp+8h] [rbp-20h] BYREF

timer = time(0LL);
if ( timer == -1 )
{
v7 = "time";
}
else
{
v4 = localtime(&timer);
if ( v4 )
{
v5 = asctime(v4);
snprintf(a2, a3, "%s", v5);
return 0LL;
}
v7 = (const char *)&unk_2007;
}
perror(v7);
snprintf(a2, a3, "Erreur lors de la lecture de l'heure");
fprintf(stderr, "%s\n", a2);
return 0xFFFFFFFFLL;
}

original_code:
int time_answer_func(request_t* req, char* buffer, size_t buffsize) {
 time_t heure;
 struct tm* h;
 heure = time(((void *)0));
 if (heure == -1) {
  perror("time");
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'heure");
  fprintf(stderr, "%s\n", buffer);
  return -1;
 }
 h = localtime(&heure);
 if (h != ((void *)0)) {
  snprintf(buffer, buffsize
    , "%s", asctime(h));
 } else {
  perror("localtime");
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'heure");
  fprintf(stderr, "%s\n", buffer);
  return -1;
 }
 return 0;
}

canonical_original_code:
int time_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 long heure;
 struct tm *h;
 heure = time(((void *)0));
 if (heure == -1) {
  perror("time");
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'heure");
  fprintf(stderr, "%s\n", buffer);
  return -1;
 }
 h = localtime(&heure);
 if (h != ((void *)0)) {
  snprintf(buffer, buffsize
    , "%s", asctime(h));
 } else {
  perror("localtime");
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'heure");
  fprintf(stderr, "%s\n", buffer);
  return -1;
 }
 return 0;
}

variable_types: heure long

variable_types: struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long __tm_gmtoff; char *__tm_zone; } *


decompiled_code:
__int64 getCommand()
{
return time_answer_cmd;
}

canonical_decompiled_code:
__int64 func7()
{
return time_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return time_answer_cmd;
}


decompiled_code:
__int64 __fastcall check_error_noquit(int a1, const char *a2)
{
if ( a1 <= 0 )
return 0LL;
fputs(a2, stderr);
return 1LL;
}

canonical_decompiled_code:
__int64 __fastcall func0(int a1, const char *a2)
{
if ( a1 <= 0 )
return 0LL;
fputs(a2, stderr);
return 1LL;
}

original_code:
int check_error_noquit(int value, const char* str) {
    if (value > 0) {
        fprintf(stderr, "%s", str);
        return 1;
    }
    return 0;
}

canonical_original_code:
int check_error_noquit(int value, char *str) {
    if (value > 0) {
        fprintf(stderr, "%s", str);
        return 1;
    }
    return 0;
}

variable_types: value int

variable_types:
str
char *


decompiled_code:
int __fastcall check_error(int a1, const char *a2)
{
int result; // eax

if ( a1 > 0 )
{
fputs(a2, stderr);
result = raise(15);
}
return result;
}

canonical_decompiled_code:
int __fastcall func1(int a1, const char *a2)
{
int result; // eax

if ( a1 > 0 )
{
fputs(a2, stderr);
result = raise(15);
}
return result;
}

original_code:
void check_error(int value, const char* str) {
    if (value > 0) {
        fprintf(stderr, "%s", str);
        raise(15);
    }
}

canonical_original_code:
void check_error(int value, char *str) {
    if (value > 0) {
        fprintf(stderr, "%s", str);
        raise(15);
    }
}


decompiled_code:
int __fastcall check_error2(int a1, const char *a2)
{
int result; // eax

if ( a1 > 0 )
{
perror(a2);
result = raise(15);
}
return result;
}

canonical_decompiled_code:
int __fastcall func2(int a1, const char *a2)
{
int result; // eax

if ( a1 > 0 )
{
perror(a2);
result = raise(15);
}
return result;
}

original_code:
void check_error2(int value, const char* str) {
    if (value > 0) {
        perror(str);
        raise(15);
    }
}

canonical_original_code:
void check_error2(int value, char *str) {
    if (value > 0) {
        perror(str);
        raise(15);
    }
}


decompiled_code:
void con_help()
{
;
}

original_code:
void con_help() {
}

canonical_original_code:
void con_help() {
}


decompiled_code:
char *__fastcall con_request_func(char *src)
{
char *v1; // rax
char *v2; // r12

v1 = (char *)malloc(0x18uLL);
*(_QWORD *)v1 = 24LL;
v2 = v1;
strncpy(v1 + 12, src, 3uLL);
v2[15] = 0;
*((_DWORD *)v2 + 2) = getpid();
return v2;
}

original_code:
request_t* con_request_func(const char* cmd) {
 request_t* req = malloc(sizeof(request_t));
 req->size = sizeof(request_t);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 return req;
}

canonical_original_code:
struct request_t *con_request_func(char *cmd) {
 struct request_t *req = malloc(sizeof(request_t));
 req->size = sizeof(request_t);
 strncpy(req->cmdname, cmd, 3);
 req->cmdname[3] = '\0';
 req->clientpid = getpid();
 return req;
}


decompiled_code:
__int64 __fastcall stream_set_add(__int64 a1, __int64 a2)
{
int v2; // eax
__int64 result; // rax

if ( a1 )
{
if ( a2 )
{
v2 = (*(__int64 (__fastcall **)(__int64))(a2 + 40))(a2 + 64);
if ( *(_DWORD *)(a1 + 128) < v2 )
*(_DWORD *)(a1 + 128) = v2;
*(_QWORD *)(a1 + 8LL * (v2 / 64)) |= 1LL << (v2 % 64);
result = 0LL;
}
else
{
fwrite("stream_set_add : stream == NULL\n", 1uLL, 0x20uLL, stderr);
result = 4294967294LL;
}
}
else
{
fwrite("stream_set_add : set == NULL\n", 1uLL, 0x1DuLL, stderr);
result = 4294967294LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2)
{
int v2; // eax
__int64 result; // rax

if ( a1 )
{
if ( a2 )
{
v2 = (*(__int64 (__fastcall **)(__int64))(a2 + 40))(a2 + 64);
if ( *(_DWORD *)(a1 + 128) < v2 )
*(_DWORD *)(a1 + 128) = v2;
*(_QWORD *)(a1 + 8LL * (v2 / 64)) |= 1LL << (v2 % 64);
result = 0LL;
}
else
{
fwrite("stream_set_add : stream == NULL\n", 1uLL, 0x20uLL, stderr);
result = 4294967294LL;
}
}
else
{
fwrite("stream_set_add : set == NULL\n", 1uLL, 0x1DuLL, stderr);
result = 4294967294LL;
}
return result;
}

original_code:
int stream_set_add(stream_set_t* set, stream_t* stream) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_add : set == NULL\n");
  return -2;
 }
 if (stream == ((void *)0)) {
  fprintf(stderr, "stream_set_add : stream == NULL\n");
  return -2;
 }
 int fd = stream->op._getfd(&stream->sd);
 if (fd > set->_maxfd) {
  set->_maxfd = fd;
 }
 ((void) (((&set->_set)->fds_bits)[((fd) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((fd) % (8 * (int) sizeof (__fd_mask)))))));
 return 0;
}

canonical_original_code:
int stream_set_add(struct stream_set_t *set, struct stream_t *stream) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_add : set == NULL\n");
  return -2;
 }
 if (stream == ((void *)0)) {
  fprintf(stderr, "stream_set_add : stream == NULL\n");
  return -2;
 }
 int fd = stream->op._getfd(&stream->sd);
 if (fd > set->_maxfd) {
  set->_maxfd = fd;
 }
 ((void) (((&set->_set)->fds_bits)[((fd) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((fd) % (8 * (int) sizeof (__fd_mask)))))));
 return 0;
}

variable_types: struct stream_set_t { struct fd_set { long fds_bits[-1]; } _set; int _maxfd; } *

variable_types: struct stream_t { struct operation_t { int (*_create)(struct streamd_t { void *data; } *, char *, unsigned long); int (*_open)(struct streamd_t *, char *, int); int (*_close)(struct streamd_t *); int (*_read)(struct streamd_t *, void *, unsigned long); int (*_write)(struct streamd_t *, void *, unsigned long); int (*_getfd)(struct streamd_t *); int (*_unlink)(char *); char name[4]; } op; struct streamd_t sd; } *

variable_types: fd int

user_defined_types: struct stream_set_t { struct fd_set _set; int _maxfd; }


decompiled_code:
__int64 __fastcall stream_set_clear(_DWORD *a1)
{
__int64 result; // rax

if ( a1 )
{
a1[32] = 0;
result = 0LL;
memset(a1, 0, 0x80uLL);
}
else
{
fwrite("stream_set_clear : set == NULL\n", 1uLL, 0x1FuLL, stderr);
result = 4294967294LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func1(_DWORD *a1)
{
__int64 result; // rax

if ( a1 )
{
a1[32] = 0;
result = 0LL;
memset(a1, 0, 0x80uLL);
}
else
{
fwrite("stream_set_clear : set == NULL\n", 1uLL, 0x1FuLL, stderr);
result = 4294967294LL;
}
return result;
}

original_code:
int stream_set_clear(stream_set_t* set) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_clear : set == NULL\n");
  return -2;
 }
 set->_maxfd = 0;
 do { int __d0, __d1; __asm__ __volatile__ ("cld; rep; " "stosq" : "=c" (__d0), "=D" (__d1) : "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1" (&((&set->_set)->fds_bits)[0]) : "memory"); } while (0);
 return 0;
}

canonical_original_code:
int stream_set_clear(struct stream_set_t *set) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_clear : set == NULL\n");
  return -2;
 }
 set->_maxfd = 0;
 do { int __d0; int __d1; __asm__ __volatile__ ("cld; rep; " "stosq" : "=c" (__d0), "=D" (__d1) : "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1" (&((&set->_set)->fds_bits)[0]) : "memory"); } while (0);
 return 0;
}


decompiled_code:
__int64 __fastcall stream_set_isset(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
__int64 result; // rax

if ( a1 )
{
if ( a2 )
{
v2 = *(_QWORD *)(a1 + 8LL * ((*(int (__fastcall **)(__int64))(a2 + 40))(a2 + 64) / 64));
result = (v2 & (1LL << ((*(int (__fastcall **)(__int64))(a2 + 40))(a2 + 64) % 64))) != 0;
}
else
{
fwrite("stream_set_isset : stream == NULL\n", 1uLL, 0x22uLL, stderr);
result = 4294967294LL;
}
}
else
{
fwrite("stream_set_isset : set == NULL\n", 1uLL, 0x1FuLL, stderr);
result = 4294967294LL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
__int64 result; // rax

if ( a1 )
{
if ( a2 )
{
v2 = *(_QWORD *)(a1 + 8LL * ((*(int (__fastcall **)(__int64))(a2 + 40))(a2 + 64) / 64));
result = (v2 & (1LL << ((*(int (__fastcall **)(__int64))(a2 + 40))(a2 + 64) % 64))) != 0;
}
else
{
fwrite("stream_set_isset : stream == NULL\n", 1uLL, 0x22uLL, stderr);
result = 4294967294LL;
}
}
else
{
fwrite("stream_set_isset : set == NULL\n", 1uLL, 0x1FuLL, stderr);
result = 4294967294LL;
}
return result;
}

original_code:
int stream_set_isset(stream_set_t* set, stream_t* stream) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_isset : set == NULL\n");
  return -2;
 }
 if (stream == ((void *)0)) {
  fprintf(stderr, "stream_set_isset : stream == NULL\n");
  return -2;
 }
 return ((((&set->_set)->fds_bits)[((stream->op._getfd(&stream->sd)) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << ((stream->op._getfd(&stream->sd)) % (8 * (int) sizeof (__fd_mask)))))) != 0);
}

canonical_original_code:
int stream_set_isset(struct stream_set_t *set, struct stream_t *stream) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_isset : set == NULL\n");
  return -2;
 }
 if (stream == ((void *)0)) {
  fprintf(stderr, "stream_set_isset : stream == NULL\n");
  return -2;
 }
 return ((((&set->_set)->fds_bits)[((stream->op._getfd(&stream->sd)) / (8 * (int) sizeof (__fd_mask)))] & ((__fd_mask) (1UL << ((stream->op._getfd(&stream->sd)) % (8 * (int) sizeof (__fd_mask)))))) != 0);
}


decompiled_code:
int __fastcall stream_set_select(fd_set *readfds, struct timeval *timeout)
{
if ( readfds )
return select(LODWORD(readfds[1].fds_bits[0]) + 1, readfds, 0LL, 0LL, timeout);
fwrite("stream_set_select : set == NULL\n", 1uLL, 0x20uLL, stderr);
return -2;
}

canonical_decompiled_code:
int __fastcall func3(fd_set *readfds, struct timeval *timeout)
{
if ( readfds )
return select(LODWORD(readfds[1].fds_bits[0]) + 1, readfds, 0LL, 0LL, timeout);
fwrite("stream_set_select : set == NULL\n", 1uLL, 0x20uLL, stderr);
return -2;
}

original_code:
int stream_set_select(stream_set_t* set, struct timeval* timeout) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_select : set == NULL\n");
  return -2;
 }
 return select(set->_maxfd + 1, &set->_set, ((void *)0), ((void *)0), timeout);
}

canonical_original_code:
int stream_set_select(struct stream_set_t *set, struct timeval *timeout) {
 if (set == ((void *)0)) {
  fprintf(stderr, "stream_set_select : set == NULL\n");
  return -2;
 }
 return select(set->_maxfd + 1, &set->_set, ((void *)0), ((void *)0), timeout);
}

variable_types: struct timeval { long tv_sec; long tv_usec; } *


decompiled_code:
__int64 __fastcall uid_answer_func(__int64 a1, char *a2, size_t a3)
{
struct passwd *v4; // rax
__int64 result; // rax

v4 = getpwuid(*(_DWORD *)(a1 + 16));
if ( v4 )
{
snprintf(a2, a3, "%s", v4->pw_name);
result = 0LL;
}
else
{
snprintf(a2, a3, "Erreur lors de la lecture de l'UID : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
result = 0xFFFFFFFFLL;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, char *a2, size_t a3)
{
struct passwd *v4; // rax
__int64 result; // rax

v4 = getpwuid(*(_DWORD *)(a1 + 16));
if ( v4 )
{
snprintf(a2, a3, "%s", v4->pw_name);
result = 0LL;
}
else
{
snprintf(a2, a3, "Erreur lors de la lecture de l'UID : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
result = 0xFFFFFFFFLL;
}
return result;
}

original_code:
int uid_answer_func(request_t* req, char* buffer, size_t buffsize) {
 int res = 0;
 struct passwd* pw = getpwuid(*((int*) (req->data)));
 if (pw == ((void *)0)) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'UID : %d"
    , *((int*) (req->data)));
  fprintf(stderr, "%s\n", buffer);
  res = -1;
 } else {
  snprintf(buffer, buffsize, "%s", pw->pw_name);
 }
 return res;
}

canonical_original_code:
int uid_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 int res = 0;
 struct passwd *pw = getpwuid(*((int*) (req->data)));
 if (pw == ((void *)0)) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture de l'UID : %d"
    , *((int *) (req->data)));
  fprintf(stderr, "%s\n", buffer);
  res = -1;
 } else {
  snprintf(buffer, buffsize, "%s", pw->pw_name);
 }
 return res;
}

variable_types: struct request_t { unsigned long size; int clientpid; char cmdname[4]; char data[1]; } *

variable_types:
buffer
char *

variable_types:
buffsize
unsigned long

variable_types: struct passwd { char *pw_name; char *pw_passwd; unsigned int pw_uid; unsigned int pw_gid; char *pw_gecos; char *pw_dir; char *pw_shell; } *


decompiled_code:
__int64 getCommand()
{
return uid_answer_cmd;
}

canonical_decompiled_code:
__int64 func7()
{
return uid_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return uid_answer_cmd;
}


decompiled_code:
__int64 __fastcall pid_answer_func(__int64 a1, char *a2, size_t a3)
{
unsigned int v4; // er12

v4 = getpidname();
if ( v4 == -1 )
{
snprintf(a2, a3, "Erreur lors de la lecture du pid : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
}
return v4;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, char *a2, size_t a3)
{
unsigned int v4; // er12

v4 = func6();
if ( v4 == -1 )
{
snprintf(a2, a3, "Erreur lors de la lecture du pid : %d", *(unsigned int *)(a1 + 16));
fprintf(stderr, "%s\n", a2);
}
return v4;
}

original_code:
int pid_answer_func(request_t* req, char* buffer, size_t buffsize) {
 int res = getpidname(*((int*) (req->data)), buffer, buffsize);
 if (res == -1) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture du pid : %d"
    , *((int*) (req->data)));
  fprintf(stderr, "%s\n", buffer);
 }
 return res;
}

canonical_original_code:
int pid_answer_func(struct request_t *req, char *buffer, unsigned long buffsize) {
 int res = getpidname(*((int*) (req->data)), buffer, buffsize);
 if (res == -1) {
  snprintf(buffer, buffsize
    , "Erreur lors de la lecture du pid : %d"
    , *((int *) (req->data)));
  fprintf(stderr, "%s\n", buffer);
 }
 return res;
}

variable_types: res int


decompiled_code:
__int64 getCommand()
{
return pid_answer_cmd;
}

canonical_decompiled_code:
__int64 func8()
{
return pid_answer_cmd;
}

canonical_original_code:
struct answer_cmd_t getCommand() {
 return pid_answer_cmd;
}


decompiled_code:
int class_protect_sprintf(char *a1, const char *a2, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a2);
return vsnprintf(a1, 0x800uLL, a2, arg);
}

canonical_decompiled_code:
int func0(char *a1, const char *a2, ...)
{
gcc_va_list arg; // [rsp+8h] [rbp-D0h] BYREF

va_start(arg, a2);
return vsnprintf(a1, 0x800uLL, a2, arg);
}

original_code:
void class_protect_sprintf(char* dest, char* tpl,...) {
  va_list args;
  __builtin_va_start(args,tpl);
  vsnprintf(dest, 2048,tpl,args);
  __builtin_va_end(args);
}

canonical_original_code:
void class_protect_sprintf(char *dest, char *tpl, ...) {
  __builtin_va_list args;
  __builtin_va_start(args,tpl);
  vsnprintf(dest, 2048,tpl,args);
  __builtin_va_end(args);
}

variable_types:
dest
char *

variable_types:
tpl
char *


decompiled_code:
// attributes: thunk
void *class_protect_memcpy(void *dest, const void *src, size_t n)
{
return memcpy(dest, src, n);
}

canonical_decompiled_code:
void *func2(void *dest, const void *src, size_t n)
{
return memcpy(dest, src, n);
}

original_code:
void* class_protect_memcpy(void* dest, void* from, size_t sz) {
  return memcpy(dest, from,sz);
}

canonical_original_code:
void *class_protect_memcpy(void *dest, void *from, unsigned long sz) {
  return memcpy(dest, from,sz);
}

variable_types:
dest
void *

variable_types:
from
void *

variable_types:
sz
unsigned long

return_type: void *


decompiled_code:
__int64 __fastcall get_number_of_titles(const char *a1)
{
const char *v1; // rcx
__int64 result; // rax
_BOOL4 v3; // edx

v1 = &a1[strlen(a1)];
result = 0LL;
while ( a1 != v1 )
{
v3 = *a1++ == 9;
result = (unsigned int)(v3 + result);
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func3(const char *a1)
{
const char *v1; // rcx
__int64 result; // rax
_BOOL4 v3; // edx

v1 = &a1[strlen(a1)];
result = 0LL;
while ( a1 != v1 )
{
v3 = *a1++ == 9;
result = (unsigned int)(v3 + result);
}
return result;
}

original_code:
int get_number_of_titles(char * titlestring){
  int i;
  int number_of_titles=0;
  for (i=0; i<strlen(titlestring); i++){
    if (titlestring[i] == '\t')
      number_of_titles++;
  }
  return number_of_titles;
}

canonical_original_code:
int get_number_of_titles(char *titlestring){
  int i;
  int number_of_titles = 0;
  for (i=0; i<strlen(titlestring); i++){
    if (titlestring[i] == '\t')
      number_of_titles++;
  }
  return number_of_titles;
}

variable_types:
titlestring
char *

variable_types: i int


decompiled_code:
__int64 __fastcall compare_doubles(double *a1, double *a2)
{
__int64 result; // rax

result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
result = *a1 > *a2;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func5(double *a1, double *a2)
{
__int64 result; // rax

result = 0xFFFFFFFFLL;
if ( *a2 <= *a1 )
result = *a1 > *a2;
return result;
}

original_code:
int compare_doubles(const void *a,
                    const void *b){
  double *x = (double *) a;
  double *y = (double *) b;
  if (*x < *y)
    return -1;
  else if
    (*x > *y) return 1;
  return 0;
}

canonical_original_code:
int compare_doubles(void *a, void *b){
  double *x = (double *) a;
  double *y = (double *) b;
  if (*x < *y)
    return -1;
  else if
    (*x > *y) return 1;
  return 0;
}

variable_types:
a
void *

variable_types:
b
void *

variable_types:
x
double *

variable_types:
y
double *


decompiled_code:
__int64 __fastcall string_begins_with(const char *a1, char a2)
{
int v2; // eax
unsigned int v3; // er8
__int64 v4; // rdx
char v5; // al

v2 = strlen(a1);
if ( v2 <= 0 )
return 0;
v3 = 0;
v4 = (__int64)&a1[v2 - 1 + 1];
do
{
v5 = *a1;
if ( *a1 != 32 && v5 != 9 )
{
if ( v5 != a2 )
return v3;
v3 = 1;
}
++a1;
}
while ( a1 != (const char *)v4 );
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func6(const char *a1, char a2)
{
int v2; // eax
unsigned int v3; // er8
__int64 v4; // rdx
char v5; // al

v2 = strlen(a1);
if ( v2 <= 0 )
return 0;
v3 = 0;
v4 = (__int64)&a1[v2 - 1 + 1];
do
{
v5 = *a1;
if ( *a1 != 32 && v5 != 9 )
{
if ( v5 != a2 )
return v3;
v3 = 1;
}
++a1;
}
while ( a1 != (const char *)v4 );
return v3;
}

original_code:
int string_begins_with(char* thestring, char beginchar){
  int int_temp=0;
  int strlength = strlen((thestring));
  int result = 0;
  for(int_temp=0;int_temp<strlength;++int_temp){
    if(thestring[int_temp]==' ' || thestring[int_temp]=='\t'){continue;}
    else if(thestring[int_temp]==beginchar){result=1;}
    else{break;}
  }
  return result;
}

canonical_original_code:
int string_begins_with(char *thestring, char beginchar){
  int int_temp = 0;
  int strlength = strlen((thestring));
  int result = 0;
  for(int_temp=0;int_temp<strlength;++int_temp){
    if(thestring[int_temp]==' ' || thestring[int_temp]=='\t'){continue;}
    else if(thestring[int_temp]==beginchar){result=1;}
    else{break;}
  }
  return result;
}

variable_types:
thestring
char *

variable_types: beginchar char

variable_types: strlength int

variable_types: result int


decompiled_code:
__int64 __fastcall class_version(char *a1)
{
strcpy(a1, "v3.2.0");
return 0LL;
}

canonical_decompiled_code:
__int64 __fastcall func7(char *a1)
{
strcpy(a1, "v3.2.0");
return 0LL;
}

original_code:
int class_version(
                  char * version
                  ) {
  sprintf(version,"%s","v3.2.0");
  return 0;
}

canonical_original_code:
int class_version(char *version) {
  sprintf(version,"%s","v3.2.0");
  return 0;
}

variable_types:
version
char *


original_code:
double dEdtdV_DM_ann(double z, INJ_PARAMS *params){
  double pann_tot, u_min, erfc;
  double zp1, zp1_ann, zp1_max, zp1_min, var, zp1_halo;
  var = params->ann_var;
  zp1 = z + 1.;
  zp1_ann = params->ann_z + 1.;
  zp1_max = params->ann_zmax + 1.;
  zp1_halo = params->ann_z_halo + 1.;
  zp1_min = params->ann_zmin + 1.;
  pann_tot = 0.;
  if (params->pann > 0.) {
    if (zp1 > zp1_max) pann_tot = params->pann *exp(-var *square(log(zp1_ann/zp1_max)));
    else if (zp1 > zp1_min) {
      pann_tot = params->pann *exp(var*(-square(log(zp1_ann/zp1_max))
    +square(log(zp1/zp1_max))));
    }
    else {
      pann_tot = params->pann *exp(var*(-square(log(zp1_ann/zp1_max))
    +square(log(zp1_min/zp1_max))));
    }
 pann_tot = pann_tot*pow(zp1,3.);
  }
  if (params->pann_halo > 0.) {
    u_min = zp1/zp1_halo;
    erfc = pow(1.+0.278393*u_min+0.230389*u_min*u_min+0.000972*u_min*u_min*u_min+0.078108*u_min*u_min*u_min*u_min,-4);
    pann_tot += params->pann_halo *erfc;
  }
  return square(10537.4*params->odmh2) * zp1*zp1*zp1*1e-9* pann_tot
        +10537.4*params->odmh2*pow((1+z),3)*params->decay;
}

canonical_original_code:
double dEdtdV_DM_ann(double z, struct INJ_PARAMS *params){
  double pann_tot; double u_min; double erfc;
  double zp1; double zp1_ann; double zp1_max; double zp1_min; double var; double zp1_halo;
  var = params->ann_var;
  zp1 = z + 1.;
  zp1_ann = params->ann_z + 1.;
  zp1_max = params->ann_zmax + 1.;
  zp1_halo = params->ann_z_halo + 1.;
  zp1_min = params->ann_zmin + 1.;
  pann_tot = 0.;
  if (params->pann > 0.) {
    if (zp1 > zp1_max) pann_tot = params->pann *exp(-var *square(log(zp1_ann/zp1_max)));
    else if (zp1 > zp1_min) {
      pann_tot = params->pann *exp(var*(-square(log(zp1_ann/zp1_max))
    +square(log(zp1/zp1_max))));
    }
    else {
      pann_tot = params->pann *exp(var*(-square(log(zp1_ann/zp1_max))
    +square(log(zp1_min/zp1_max))));
    }
 pann_tot = pann_tot*pow(zp1,3.);
  }
  if (params->pann_halo > 0.) {
    u_min = zp1/zp1_halo;
    erfc = pow(1.+0.278393*u_min+0.230389*u_min*u_min+0.000972*u_min*u_min*u_min+0.078108*u_min*u_min*u_min*u_min,-4);
    pann_tot += params->pann_halo *erfc;
  }
  return square(10537.4*params->odmh2) * zp1*zp1*zp1*1e-9* pann_tot
        +10537.4*params->odmh2*pow((1+z),3)*params->decay;
}

variable_types: z double

variable_types: struct INJ_PARAMS { double odmh2; double pann; double ann_z; double ann_z_halo; double decay; double Mpbh; int on_the_spot; double ion; } *

variable_types: erfc double

variable_types: var double

return_type: double


original_code:
double beta_pbh(double Mpbh, double z, double xe, double Teff) {
  double a, vB, tB;
  a = 1./(1.+z);
  vB = 9.09e3 * sqrt((1.+xe)*Teff);
  tB = 1.33e26 *Mpbh/vB/vB/vB;
  return 5.60e-24 *xe/a/a/a/a *tB;
}

canonical_original_code:
double beta_pbh(double Mpbh, double z, double xe, double Teff) {
  double a; double vB; double tB;
  a = 1./(1.+z);
  vB = 9.09e3 * sqrt((1.+xe)*Teff);
  tB = 1.33e26 *Mpbh/vB/vB/vB;
  return 5.60e-24 *xe/a/a/a/a *tB;
}

variable_types: Mpbh double

variable_types: xe double

variable_types: Teff double

variable_types: a double

variable_types: vB double

variable_types: tB double


decompiled_code:
double __fastcall gamma_pbh(double a1, double a2, double a3, double a4)
{
return 3672.0 / (a3 + 1.0) * beta_pbh(a1, a2, a3, a4);
}

canonical_decompiled_code:
double __fastcall func2(double a1, double a2, double a3, double a4)
{
return 3672.0 / (a3 + 1.0) * func1(a1, a2, a3, a4);
}

original_code:
double gamma_pbh(double Mpbh, double z, double xe, double Teff) {
  return 2.*1836./(1.+xe) *beta_pbh(Mpbh, z, xe, Teff);
}


original_code:
double lambda_pbh(double Mpbh, double z, double xe, double Teff) {
  double beta, gamma, lam_ricotti, lam_ad, lam_iso, lam_nodrag;
  beta = beta_pbh(Mpbh, z, xe, Teff);
  gamma = gamma_pbh(Mpbh, z, xe, Teff);
  lam_ricotti = exp(4.5/(3.+pow(beta, 0.75)))/square(sqrt(1.+beta)+1.);
  lam_ad = pow(0.6, 1.5)/4.;
  lam_iso = exp(1.5)/4.;
  lam_nodrag = lam_ad + (lam_iso - lam_ad) * pow(gamma*gamma/(88. + gamma*gamma), 0.22);
  return lam_ricotti *lam_nodrag /lam_iso;
}

canonical_original_code:
double lambda_pbh(double Mpbh, double z, double xe, double Teff) {
  double beta; double gamma; double lam_ricotti; double lam_ad; double lam_iso; double lam_nodrag;
  beta = beta_pbh(Mpbh, z, xe, Teff);
  gamma = gamma_pbh(Mpbh, z, xe, Teff);
  lam_ricotti = exp(4.5/(3.+pow(beta, 0.75)))/square(sqrt(1.+beta)+1.);
  lam_ad = pow(0.6, 1.5)/4.;
  lam_iso = exp(1.5)/4.;
  lam_nodrag = lam_ad + (lam_iso - lam_ad) * pow(gamma*gamma/(88. + gamma*gamma), 0.22);
  return lam_ricotti *lam_nodrag /lam_iso;
}

variable_types: beta double

variable_types: gamma double


decompiled_code:
double __fastcall Mdot_pbh(double a1, double a2, double a3, double a4)
{
double v4; // xmm4_8
double v6; // xmm0_8
double v7; // xmm0_8
double v9; // [rsp+8h] [rbp-30h]
double v10; // [rsp+8h] [rbp-30h]
double v11; // [rsp+18h] [rbp-20h]

v4 = *(double *)&LC1;
v6 = (a3 + 1.0) * a4;
if ( v6 < 0.0 )
{
v10 = a1;
v7 = sqrt(v6);
a1 = v10;
v4 = *(double *)&LC1;
}
else
{
v7 = sqrt(v6);
}
v11 = a1;
v9 = cube((v4 + a2) / (v7 * 9090.0)) * (8.81e22 * a1 * a1);
return lambda_pbh(v11, a2, a3, a4) * v9;
}

canonical_decompiled_code:
double __fastcall func4(double a1, double a2, double a3, double a4)
{
double v4; // xmm4_8
double v6; // xmm0_8
double v7; // xmm0_8
double v9; // [rsp+8h] [rbp-30h]
double v10; // [rsp+8h] [rbp-30h]
double v11; // [rsp+18h] [rbp-20h]

v4 = *(double *)&LC1;
v6 = (a3 + 1.0) * a4;
if ( v6 < 0.0 )
{
v10 = a1;
v7 = sqrt(v6);
a1 = v10;
v4 = *(double *)&LC1;
}
else
{
v7 = sqrt(v6);
}
v11 = a1;
v9 = cube((v4 + a2) / (v7 * 9090.0)) * (8.81e22 * a1 * a1);
return func3(v11, a2, a3, a4) * v9;
}

original_code:
double Mdot_pbh(double Mpbh, double z, double xe, double Teff) {
  double vB = 9.09e3 * sqrt((1.+xe)*Teff);
  return 8.81e22 * Mpbh*Mpbh*cube((1.+z)/vB) *lambda_pbh(Mpbh, z, xe, Teff);
}


variable_types: X double

variable_types: G double


decompiled_code:
double __fastcall L_pbh(double a1, double a2, double a3, double a4)
{
double v6; // [rsp+10h] [rbp-28h]

v6 = Mdot_pbh(a1, a2, a3, a4);
return eps_over_mdot_pbh(a1, a2, a3, a4) * (v6 / (1.4e17 * a1)) * v6 * 9.0e20;
}

canonical_decompiled_code:
double __fastcall func6(double a1, double a2, double a3, double a4)
{
double v6; // [rsp+10h] [rbp-28h]

v6 = func4(a1, a2, a3, a4);
return func5(a1, a2, a3, a4) * (v6 / (1.4e17 * a1)) * v6 * 9.0e20;
}

original_code:
double L_pbh(double Mpbh, double z, double xe, double Teff) {
  double Mdot, mdot, eff;
  Mdot = Mdot_pbh(Mpbh, z, xe, Teff);
  mdot = Mdot / (1.4e17 * Mpbh);
  eff = mdot *eps_over_mdot_pbh(Mpbh, z, xe, Teff);
  return eff * Mdot * 9e20;
}

canonical_original_code:
double L_pbh(double Mpbh, double z, double xe, double Teff) {
  double Mdot; double mdot; double eff;
  Mdot = Mdot_pbh(Mpbh, z, xe, Teff);
  mdot = Mdot / (1.4e17 * Mpbh);
  eff = mdot *eps_over_mdot_pbh(Mpbh, z, xe, Teff);
  return eff * Mdot * 9e20;
}

variable_types: Mdot double

variable_types: mdot double

variable_types: eff double


decompiled_code:
double __fastcall vbc_rms_func(double a1)
{
double result; // xmm0_8

if ( a1 >= 1000.0 )
result = *(double *)&LC44;
else
result = (a1 + 1.0) * 3000000.0 / 1000.0;
return result;
}

canonical_decompiled_code:
double __fastcall func7(double a1)
{
double result; // xmm0_8

if ( a1 >= 1000.0 )
result = *(double *)&LC44;
else
result = (a1 + 1.0) * 3000000.0 / 1000.0;
return result;
}

original_code:
double vbc_rms_func(double z) {
  if (z < 1e3) return 30e5 * (1.+z)/1e3;
  else return 30e5;
}

variable_types: z double


original_code:
double L_pbh_av(double Mpbh, double z, double xe, double Tgas) {
  double vbc_rms, vbc_max, vbc, P_vbc, num, denom, x, Teff;
  int i, Nvbc;
  Nvbc = 50;
  vbc_rms = vbc_rms_func(z);
  vbc_max = 5.*vbc_rms;
  num = denom = 0.;
  for (i = 0; i < Nvbc; i++) {
    vbc = i*vbc_max/(Nvbc-1.);
    x = vbc/vbc_rms;
    denom += P_vbc = x*x* exp(-1.5*x*x);
    Teff = Tgas + 121e-10 *vbc*vbc/(1.+xe);
    num += L_pbh(Mpbh, z, xe, Teff) * P_vbc;
  }
  return num/denom;
}

canonical_original_code:
double L_pbh_av(double Mpbh, double z, double xe, double Tgas) {
  double vbc_rms; double vbc_max; double vbc; double P_vbc; double num; double denom; double x; double Teff;
  int i; int Nvbc;
  Nvbc = 50;
  vbc_rms = vbc_rms_func(z);
  vbc_max = 5.*vbc_rms;
  num = denom = 0.;
  for (i = 0; i < Nvbc; i++) {
    vbc = i*vbc_max/(Nvbc-1.);
    x = vbc/vbc_rms;
    denom += P_vbc = x*x* exp(-1.5*x*x);
    Teff = Tgas + 121e-10 *vbc*vbc/(1.+xe);
    num += L_pbh(Mpbh, z, xe, Teff) * P_vbc;
  }
  return num/denom;
}

variable_types: Tgas double

variable_types: vbc double

variable_types: num double

variable_types: denom double

variable_types: x double

variable_types: i int

variable_types: Nvbc int


decompiled_code:
double __fastcall dEdtdV_pbh(double a1, double a2, double a3, double a4, double a5)
{
double v6; // [rsp+8h] [rbp-30h]
double v7; // [rsp+10h] [rbp-28h]

v7 = fmin(a4, 1.0);
if ( a1 <= 0.0 )
return 0.0;
v6 = 6.12e-52 / a2 * cube(a3 + 1.0) * a1;
L_pbh_av(a2, a3, v7, a5);
return a2 * v6;
}

canonical_decompiled_code:
double __fastcall func9(double a1, double a2, double a3, double a4, double a5)
{
double v6; // [rsp+8h] [rbp-30h]
double v7; // [rsp+10h] [rbp-28h]

v7 = fmin(a4, 1.0);
if ( a1 <= 0.0 )
return 0.0;
v6 = 6.12e-52 / a2 * cube(a3 + 1.0) * a1;
func8(a2, a3, v7, a5);
return a2 * v6;
}

original_code:
double dEdtdV_pbh(double fpbh, double Mpbh, double z, double xe, double Tgas) {
  double xe_used = (xe < 1.? xe : 1.);
  if (fpbh > 0.) {
    return 6.12e-52/Mpbh * cube(1.+z) * fpbh *L_pbh_av(Mpbh, z, xe_used, Tgas);
  }
  else return 0.;
}

variable_types: fpbh double

variable_types: Mpbh double

variable_types: xe double


decompiled_code:
double __fastcall dEdtdV_inj(double *a1, double a2, double a3, double a4)
{
double v5; // [rsp+0h] [rbp-28h]

v5 = dEdtdV_DM_ann(a1, a2);
return dEdtdV_pbh(a1[10], a1[9], a2, a3, a4) + v5;
}

canonical_decompiled_code:
double __fastcall func10(double *a1, double a2, double a3, double a4)
{
double v5; // [rsp+0h] [rbp-28h]

v5 = func0(a1, a2);
return func9(a1[10], a1[9], a2, a3, a4) + v5;
}

original_code:
double dEdtdV_inj(double z, double xe, double Tgas, INJ_PARAMS *params){
  return dEdtdV_DM_ann(z, params)
         + dEdtdV_pbh(params->fpbh, params->Mpbh, z, xe, Tgas);
}

canonical_original_code:
double dEdtdV_inj(double z, double xe, double Tgas, struct INJ_PARAMS *params){
  return dEdtdV_DM_ann(z, params)
         + dEdtdV_pbh(params->fpbh, params->Mpbh, z, xe, Tgas);
}

variable_types: struct INJ_PARAMS { double odmh2; double pann; double ann_z; double ann_z_halo; double decay; double Mpbh; int on_the_spot; double ion; } *


decompiled_code:
void __fastcall update_dEdtdV_dep(__int64 a1, double *a2, double a3, double a4, double a5, double a6, double a7, double a8)
{
double v8; // xmm0_8
double v11; // [rsp+20h] [rbp-28h]

v8 = dEdtdV_inj((double *)a1, a3, a5, a6);
if ( *(_DWORD *)(a1 + 88) == 1 )
{
*a2 = v8;
}
else
{
v11 = *a2;
*a2 = (v8 * (a4 * 2.0e-15 * a7 / a8) + v11 * exp(a4 * -7.0)) / (a4 * 2.0e-15 * a7 / a8 + 1.0);
}
}

original_code:
void update_dEdtdV_dep(double z_out, double dlna, double xe, double Tgas,
         double nH, double H, INJ_PARAMS *params, double *dEdtdV_dep) {
  double inj = dEdtdV_inj(z_out, xe, Tgas, params);
  if (params->on_the_spot == 1) *dEdtdV_dep = inj;
  else {
    *dEdtdV_dep = (*dEdtdV_dep *exp(-7.*dlna) + 2e-15* dlna*nH/H *inj)
                 /(1.+ 2e-15 *dlna*nH/H);
  }
}

canonical_original_code:
void update_dEdtdV_dep(double z_out, double dlna, double xe, double Tgas, double nH, double H, struct INJ_PARAMS *params, double *dEdtdV_dep) {
  double inj = dEdtdV_inj(z_out, xe, Tgas, params);
  if (params->on_the_spot == 1) *dEdtdV_dep = inj;
  else {
    *dEdtdV_dep = (*dEdtdV_dep *exp(-7.*dlna) + 2e-15* dlna*nH/H *inj)
                 /(1.+ 2e-15 *dlna*nH/H);
  }
}

variable_types: dlna double

variable_types: nH double

variable_types: H double

variable_types: inj double

user_defined_types: struct INJ_PARAMS { double odmh2; double pann; double ann_z; double ann_z_halo; double decay; double Mpbh; int on_the_spot; double ion; }


decompiled_code:
double __fastcall chi_heat(double a1)
{
return (a1 + a1 + 1.0) / 3.0;
}

canonical_decompiled_code:
double __fastcall func12(double a1)
{
return (a1 + a1 + 1.0) / 3.0;
}

original_code:
double chi_heat(double xe) {
  return (1.+2.*xe)/3.;
}


decompiled_code:
double __fastcall chi_ion(double a1)
{
return (1.0 - a1) / 3.0;
}

canonical_decompiled_code:
double __fastcall func13(double a1)
{
return (1.0 - a1) / 3.0;
}

original_code:
double chi_ion(double xe) {
  return (1.-xe)/3.;
}


decompiled_code:
double __fastcall chi_exc(double a1)
{
double v2; // [rsp+0h] [rbp-18h]

v2 = chi_ion(a1);
return 1.0 - v2 - chi_heat(a1);
}

canonical_decompiled_code:
double __fastcall func14(double a1)
{
double v2; // [rsp+0h] [rbp-18h]

v2 = func13(a1);
return 1.0 - v2 - func12(a1);
}

original_code:
double chi_exc(double xe) {
  return 1. - chi_ion(xe) - chi_heat(xe);
}


square

decompiled_code:
double __fastcall square(double a1)
{
return a1 * a1;
}

canonical_decompiled_code:
double __fastcall func0(double a1)
{
return a1 * a1;
}

original_code:
double square(double x) {
  return x*x;
}

canonical_original_code:
double square(double x) {
  return x*x;
}


cube

decompiled_code:
double __fastcall cube(double a1)
{
return a1 * a1 * a1;
}

canonical_decompiled_code:
double __fastcall func1(double a1)
{
return a1 * a1 * a1;
}

original_code:
double cube(double x) {
  return x*x*x;
}

canonical_original_code:
double cube(double x) {
  return x*x*x;
}


decompiled_code:
void *__fastcall create_1D_array(size_t nmemb, _DWORD *a2, char *a3)
{
void *v4; // rax
void *v5; // r12
char v7[152]; // [rsp+0h] [rbp-98h] BYREF

v4 = calloc((unsigned int)nmemb, 8uLL);
v5 = v4;
if ( *a2 != 1 && !v4 )
{
strcpy(v7, "unable to allocate memory in create_1D_array \n");
strcat(a3, v7);
*a2 = 1;
}
return v5;
}

canonical_decompiled_code:
void *__fastcall func2(size_t nmemb, _DWORD *a2, char *a3)
{
void *v4; // rax
void *v5; // r12
char v7[152]; // [rsp+0h] [rbp-98h] BYREF

v4 = calloc((unsigned int)nmemb, 8uLL);
v5 = v4;
if ( *a2 != 1 && !v4 )
{
strcpy(v7, "unable to allocate memory in create_1D_array \n");
strcat(a3, v7);
*a2 = 1;
}
return v5;
}

original_code:
double *create_1D_array(unsigned n1, int *error, char error_message[2048]){
  double *matrix = (double *) calloc(n1, sizeof(double));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)) {
    sprintf(sub_message, "unable to allocate memory in create_1D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  return matrix;
}

canonical_original_code:
double *create_1D_array(unsigned int n1, int *error, char error_message[2048]){
  double *matrix = (double *) calloc(n1, sizeof(double));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)) {
    sprintf(sub_message, "unable to allocate memory in create_1D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  return matrix;
}

variable_types:
error
int *

variable_types:
matrix
double *

return_type: double *


decompiled_code:
char *__fastcall create_2D_array(size_t nmemb, unsigned int a2, _DWORD *a3, char *a4)
{
char *v6; // rax
char *v7; // r15
char *v8; // rbx
char v10[184]; // [rsp+0h] [rbp-B8h] BYREF

v6 = (char *)calloc((unsigned int)nmemb, 8uLL);
v7 = v6;
if ( *a3 != 1 )
{
if ( !v6 )
{
strcpy(v10, "unable to allocate memory in create_2D_array \n");
strcat(a4, v10);
*a3 = 1;
}
if ( (_DWORD)nmemb )
{
v8 = v7;
do
{
v8 += 8;
*((_QWORD *)v8 - 1) = create_1D_array(a2, a3, a4);
}
while ( v8 != &v7[8 * (unsigned int)nmemb] );
}
}
return v7;
}

canonical_decompiled_code:
char *__fastcall func3(size_t nmemb, unsigned int a2, _DWORD *a3, char *a4)
{
char *v6; // rax
char *v7; // r15
char *v8; // rbx
char v10[184]; // [rsp+0h] [rbp-B8h] BYREF

v6 = (char *)calloc((unsigned int)nmemb, 8uLL);
v7 = v6;
if ( *a3 != 1 )
{
if ( !v6 )
{
strcpy(v10, "unable to allocate memory in create_2D_array \n");
strcat(a4, v10);
*a3 = 1;
}
if ( (_DWORD)nmemb )
{
v8 = v7;
do
{
v8 += 8;
*((_QWORD *)v8 - 1) = func2(a2, a3, a4);
}
while ( v8 != &v7[8 * (unsigned int)nmemb] );
}
}
return v7;
}

original_code:
double **create_2D_array(unsigned n1, unsigned n2, int *error, char error_message[2048]){
  unsigned i;
  double **matrix = (double **) calloc(n1, sizeof(double *));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)){
    sprintf(sub_message, "unable to allocate memory in create_2D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  for (i = 0; i < n1; i++) matrix[i] = create_1D_array(n2, error, error_message);
  return matrix;
}

canonical_original_code:
double **create_2D_array(unsigned int n1, unsigned int n2, int *error, char error_message[2048]){
  unsigned int i;
  double **matrix = (double **) calloc(n1, sizeof(double *));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)){
    sprintf(sub_message, "unable to allocate memory in create_2D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  for (i = 0; i < n1; i++) matrix[i] = create_1D_array(n2, error, error_message);
  return matrix;
}

variable_types:
i
unsigned int

variable_types:
matrix
double **

return_type: double **


decompiled_code:
void __fastcall free_2D_array(void *ptr, int a2)
{
void *v2; // r12
void **v3; // rbx
void **v4; // rbp
void *v5; // rdi

v2 = ptr;
if ( a2 )
{
v3 = (void **)ptr;
v4 = (void **)((char *)ptr + 8 * (unsigned int)(a2 - 1) + 8);
do
{
v5 = *v3++;
free(v5);
}
while ( v3 != v4 );
}
free(v2);
}

canonical_decompiled_code:
void __fastcall func4(void *ptr, int a2)
{
void *v2; // r12
void **v3; // rbx
void **v4; // rbp
void *v5; // rdi

v2 = ptr;
if ( a2 )
{
v3 = (void **)ptr;
v4 = (void **)((char *)ptr + 8 * (unsigned int)(a2 - 1) + 8);
do
{
v5 = *v3++;
free(v5);
}
while ( v3 != v4 );
}
free(v2);
}

original_code:
void free_2D_array(double **matrix, unsigned n1){
  unsigned i;
  for (i = 0; i < n1; i++) free(matrix[i]);
  free(matrix);
}

canonical_original_code:
void free_2D_array(double **matrix, unsigned int n1){
  unsigned int i;
  for (i = 0; i < n1; i++) free(matrix[i]);
  free(matrix);
}


decompiled_code:
char *__fastcall create_3D_array(size_t nmemb, unsigned int a2, unsigned int a3, _DWORD *a4, char *a5)
{
char *v8; // rax
__int64 v9; // rdx
char *v10; // r15
char *v11; // r14
char *v13; // [rsp+0h] [rbp-C8h]
char src[184]; // [rsp+10h] [rbp-B8h] BYREF

v8 = (char *)calloc((unsigned int)nmemb, 8uLL);
v13 = v8;
if ( *a4 != 1 )
{
v9 = (unsigned int)nmemb;
if ( !v8 )
{
strcpy(src, "unable to allocate memory in create_3D_array \n");
strcat(a5, src);
*a4 = 1;
v9 = (unsigned int)nmemb;
}
if ( (_DWORD)nmemb )
{
v10 = v13;
v11 = &v13[8 * v9];
do
{
v10 += 8;
*((_QWORD *)v10 - 1) = create_2D_array(a2, a3, a4, a5);
}
while ( v10 != v11 );
}
}
return v13;
}

canonical_decompiled_code:
char *__fastcall func5(size_t nmemb, unsigned int a2, unsigned int a3, _DWORD *a4, char *a5)
{
char *v8; // rax
__int64 v9; // rdx
char *v10; // r15
char *v11; // r14
char *v13; // [rsp+0h] [rbp-C8h]
char src[184]; // [rsp+10h] [rbp-B8h] BYREF

v8 = (char *)calloc((unsigned int)nmemb, 8uLL);
v13 = v8;
if ( *a4 != 1 )
{
v9 = (unsigned int)nmemb;
if ( !v8 )
{
strcpy(src, "unable to allocate memory in create_3D_array \n");
strcat(a5, src);
*a4 = 1;
v9 = (unsigned int)nmemb;
}
if ( (_DWORD)nmemb )
{
v10 = v13;
v11 = &v13[8 * v9];
do
{
v10 += 8;
*((_QWORD *)v10 - 1) = func3(a2, a3, a4, a5);
}
while ( v10 != v11 );
}
}
return v13;
}

original_code:
double ***create_3D_array(unsigned n1, unsigned n2, unsigned n3, int *error, char error_message[2048]){
  unsigned i;
  double ***matrix = (double ***) calloc(n1, sizeof(double **));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)) {
    sprintf(sub_message, "unable to allocate memory in create_3D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  for (i = 0; i < n1; i++) matrix[i] = create_2D_array(n2, n3, error, error_message);
  return matrix;
}

canonical_original_code:
double ***create_3D_array(unsigned int n1, unsigned int n2, unsigned int n3, int *error, char error_message[2048]){
  unsigned int i;
  double ***matrix = (double ***) calloc(n1, sizeof(double **));
  char sub_message[128];
  if (*error == 1) return matrix;
  if (matrix == ((void *)0)) {
    sprintf(sub_message, "unable to allocate memory in create_3D_array \n");
    strcat(error_message, sub_message);
    *error = 1;
  }
  for (i = 0; i < n1; i++) matrix[i] = create_2D_array(n2, n3, error, error_message);
  return matrix;
}

variable_types:
matrix
double ***

return_type: double ***


decompiled_code:
void __fastcall free_3D_array(void *ptr, int a2, int a3)
{
void *v3; // r13
void **v5; // rbx
void **v6; // r12
void *v7; // rdi

v3 = ptr;
if ( a2 )
{
v5 = (void **)ptr;
v6 = (void **)((char *)ptr + 8 * (unsigned int)(a2 - 1) + 8);
do
{
v7 = *v5++;
free_2D_array(v7, a3);
}
while ( v5 != v6 );
}
free(v3);
}

canonical_decompiled_code:
void __fastcall func6(void *ptr, int a2, int a3)
{
void *v3; // r13
void **v5; // rbx
void **v6; // r12
void *v7; // rdi

v3 = ptr;
if ( a2 )
{
v5 = (void **)ptr;
v6 = (void **)((char *)ptr + 8 * (unsigned int)(a2 - 1) + 8);
do
{
v7 = *v5++;
func4(v7, a3);
}
while ( v5 != v6 );
}
free(v3);
}

original_code:
void free_3D_array(double ***matrix, unsigned n1, unsigned n2) {
  unsigned i;
  for (i = 0; i < n1; i++) free_2D_array(matrix[i], n2);
  free(matrix);
}

canonical_original_code:
void free_3D_array(double ***matrix, unsigned int n1, unsigned int n2) {
  unsigned int i;
  for (i = 0; i < n1; i++) free_2D_array(matrix[i], n2);
  free(matrix);
}


maketab

decompiled_code:
void __fastcall maketab(int a1, __int64 a2, double a3, double a4)
{
double v4; // xmm1_8
__int64 i; // rax

v4 = (a4 - a3) / ((double)a1 - 1.0);
if ( a1 )
{
for ( i = 0LL; i != a1; ++i )
*(double *)(a2 + 8 * i) = (double)(int)i * v4 + a3;
}
}

canonical_decompiled_code:
void __fastcall func7(int a1, __int64 a2, double a3, double a4)
{
double v4; // xmm1_8
__int64 i; // rax

v4 = (a4 - a3) / ((double)a1 - 1.0);
if ( a1 )
{
for ( i = 0LL; i != a1; ++i )
*(double *)(a2 + 8 * i) = (double)(int)i * v4 + a3;
}
}

original_code:
void maketab(double xmin, double xmax, unsigned Nx, double *xtab){
  unsigned i;
  double h = (xmax - xmin)/(Nx - 1.0);
  for (i = 0; i < Nx; i++) xtab[i] = xmin + i * h;
}

canonical_original_code:
void maketab(double xmin, double xmax, unsigned int Nx, double *xtab){
  unsigned int i;
  double h = (xmax - xmin)/(Nx - 1.0);
  for (i = 0; i < Nx; i++) xtab[i] = xmin + i * h;
}

variable_types: xmin double

variable_types: xmax double

variable_types:
Nx
unsigned int

variable_types:
xtab
double *

variable_types: h double


original_code:
double rec_interp1d(double x0, double dx, double *ytab, unsigned int Nx, double x, int *error, char error_message[2048]) {
  long ix;
  double frac;
  char sub_message[128];
  if (*error == 1) return 0.;
  if (dx > 0 && (x<x0 || x>x0+dx*(Nx-1))) {
    sprintf(sub_message,"x-value out of range in interpolation in rec_interp1d.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  if (dx < 0 && (x>x0 || x<x0+dx*(Nx-1))) {
    sprintf(sub_message,"x-value out of range in interpolation in rec_interp1d.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  ix = (long)floor((x-x0)/dx);
  if (ix<1) ix=1;
  if (ix>Nx-3) ix=Nx-3;
  frac = (x-x0)/dx-ix;
  ytab += ix-1;
  return(
    -ytab[0]*frac*(1.-frac)*(2.-frac)/6.
    +ytab[1]*(1.+frac)*(1.-frac)*(2.-frac)/2.
    +ytab[2]*(1.+frac)*frac*(2.-frac)/2.
    -ytab[3]*(1.+frac)*frac*(1.-frac)/6.
  );
}

variable_types: dx double

variable_types:
ytab
double *

variable_types: x double

variable_types: ix long

variable_types: frac double


original_code:
double rec_interp2d(double x10, double dx1, double x20, double dx2, double **ytab,
  unsigned int Nx1, unsigned int Nx2, double x1, double x2, int *error, char error_message[2048]) {
  int j;
  long ix1;
  double frac1;
  double temp[4];
  char sub_message[128];
  if (*error == 1) return 0.;
  if (x1<x10 || x1>x10+dx1*(Nx1-1)) {
    sprintf(sub_message,"x-value out of range in interpolation in rec_interp2d.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  ix1 = (long)floor((x1-x10)/dx1);
  if (ix1<1) ix1=1;
  if (ix1>Nx1-3) ix1=Nx1-3;
  frac1 = (x1-x10)/dx1-ix1;
  ytab += ix1-1;
  for(j=0;j<4;j++) temp[j] = rec_interp1d(x20,dx2,ytab[j],Nx2,x2, error, error_message);
  return(
    -temp[0]*frac1*(1.-frac1)*(2.-frac1)/6.
    +temp[1]*(1.+frac1)*(1.-frac1)*(2.-frac1)/2.
    +temp[2]*(1.+frac1)*frac1*(2.-frac1)/2.
    +temp[3]*(1.+frac1)*frac1*(frac1-1.)/6.
  );
}

variable_types:
ytab
double **

variable_types: j int

variable_types:
temp
double [4]


original_code:
double rec_interpol_G(double x, double *xtab, double *ytab, unsigned int Nx, int *error, char error_message[2048]) {
  char sub_message[128];
  if (*error == 1) return 0.;
  if (Nx < 4) {
    sprintf(sub_message, "Table needs to be of dimension 4 at least in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  if (xtab[0] > xtab[1]) {
    sprintf(sub_message, "Array does not seem to be increasing in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  if (x < xtab[0] || x >= xtab[Nx-1]) {
    sprintf(sub_message, "x-value out of range in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  long int ix;
  long int ilo = 0;
  long int ihi = Nx-1;
  long int imid;
  while (ihi - ilo > 1) {
    imid = (ihi + ilo)/2;
    if (x >= xtab[imid]) ilo = imid;
    if (x < xtab[imid]) ihi = imid;
  }
  ix = ilo;
  if (ix<1) ix = 1;
  if (ix>Nx-3) ix = Nx-3;
  xtab += ix-1;
  ytab += ix-1;
  return(
     ytab[0] *(x-xtab[1])*(x-xtab[2])*(x-xtab[3])
             /(xtab[0]-xtab[1])/(xtab[0]-xtab[2])/(xtab[0]-xtab[3])
           + ytab[1] *(x-xtab[0])*(x-xtab[2])*(x-xtab[3])
             /(xtab[1]-xtab[0])/(xtab[1]-xtab[2])/(xtab[1]-xtab[3])
           + ytab[2] *(x-xtab[0])*(x-xtab[1])*(x-xtab[3])
             /(xtab[2]-xtab[0])/(xtab[2]-xtab[1])/(xtab[2]-xtab[3])
           + ytab[3] *(x-xtab[0])*(x-xtab[1])*(x-xtab[2])
             /(xtab[3]-xtab[0])/(xtab[3]-xtab[1])/(xtab[3]-xtab[2])
  );
}

canonical_original_code:
double rec_interpol_G(double x, double *xtab, double *ytab, unsigned int Nx, int *error, char error_message[2048]) {
  char sub_message[128];
  if (*error == 1) return 0.;
  if (Nx < 4) {
    sprintf(sub_message, "Table needs to be of dimension 4 at least in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  if (xtab[0] > xtab[1]) {
    sprintf(sub_message, "Array does not seem to be increasing in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  if (x < xtab[0] || x >= xtab[Nx-1]) {
    sprintf(sub_message, "x-value out of range in rec_interpol_G.\n");
    strcat(error_message, sub_message);
    *error = 1;
    return 0.;
  }
  long ix;
  long ilo = 0;
  long ihi = Nx-1;
  long imid;
  while (ihi - ilo > 1) {
    imid = (ihi + ilo)/2;
    if (x >= xtab[imid]) ilo = imid;
    if (x < xtab[imid]) ihi = imid;
  }
  ix = ilo;
  if (ix<1) ix = 1;
  if (ix>Nx-3) ix = Nx-3;
  xtab += ix-1;
  ytab += ix-1;
  return(
     ytab[0] *(x-xtab[1])*(x-xtab[2])*(x-xtab[3])
             /(xtab[0]-xtab[1])/(xtab[0]-xtab[2])/(xtab[0]-xtab[3])
           + ytab[1] *(x-xtab[0])*(x-xtab[2])*(x-xtab[3])
             /(xtab[1]-xtab[0])/(xtab[1]-xtab[2])/(xtab[1]-xtab[3])
           + ytab[2] *(x-xtab[0])*(x-xtab[1])*(x-xtab[3])
             /(xtab[2]-xtab[0])/(xtab[2]-xtab[1])/(xtab[2]-xtab[3])
           + ytab[3] *(x-xtab[0])*(x-xtab[1])*(x-xtab[2])
             /(xtab[3]-xtab[0])/(xtab[3]-xtab[1])/(xtab[3]-xtab[2])
  );
}

variable_types:
error
int *

variable_types: ilo long

variable_types: ihi long

variable_types: imid long


decompiled_code:
__int64 __fastcall evolver_rk(unsigned int (__fastcall *a1)(__int64, void *, __int64, const char *, double, double, double, double, double, double, double, double), __int64 a2, double a3, double a4, double a5, double a6, double a7, __int64 a8, unsigned int a9, __int64 a10, unsigned int (__fastcall *a11)(__int64, double *, const char *), double *a12, int a13, unsigned int (__fastcall *a14)(__int64, void *, _QWORD, __int64, const char *, double), unsigned int (__fastcall *a15)(__int64, void *, __int64, const char *, double, double, double, double, double, double, double, double), const char *a16)
{
__int64 v18; // rax
signed int v19; // ebx
void *v20; // r14
double v21; // xmm4_8
double v22; // xmm5_8
double v23; // xmm2_8
double v24; // xmm1_8
__int16 v25; // r15
double v26; // xmm1_8
double v27; // xmm3_8
const char *v28; // r8
__int64 v29; // rcx
double v32; // xmm0_8
double v33; // [rsp+8h] [rbp-1910h]
double v39; // [rsp+68h] [rbp-18B0h] BYREF
char v40[2048]; // [rsp+70h] [rbp-18A8h] BYREF
char v41[2048]; // [rsp+870h] [rbp-10A8h] BYREF
char v42[104]; // [rsp+1070h] [rbp-8A8h] BYREF
char v43[2112]; // [rsp+10D8h] [rbp-840h] BYREF

v33 = a3;
if ( a3 > a12[a13 - 1] )
{
class_protect_sprintf(v41, "called with x=%e, last x_sampling=%e", a3);
class_protect_sprintf(v42, "condition (%s) is true; %s", a3);
v28 = v42;
v29 = 42LL;
goto LABEL_28;
}
v18 = 1LL;
if ( a3 <= *a12 )
{
v19 = 0;
}
else
{
do
v19 = v18++;
while ( a3 > a12[v18 - 1] );
}
if ( (unsigned int)initialize_generic_integrator(a9, v42, a12) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", a3);
v28 = v41;
v29 = 50LL;
goto LABEL_28;
}
v20 = malloc(8LL * (int)a9);
if ( !v20 )
{
class_protect_sprintf(v41, "could not allocate %s with size %d", a3);
v28 = v41;
v29 = 54LL;
goto LABEL_28;
}
if ( a4 > a3 && a13 > v19 )
{
while ( 1 )
{
if ( a11(a10, &v39, a16) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", a3);
v28 = v41;
v29 = 62LL;
goto LABEL_28;
}
v23 = a7 * v39;
*(_QWORD *)&v24 = COERCE_UNSIGNED_INT64(a7 * v39 / a3) & LC9;
if ( a6 > v24 )
{
class_protect_sprintf(
v40,
"integration step =%e < machine precision : leads either to numerical error or infinite loop",
v24);
class_protect_sprintf(v41, "condition (%s) is true; %s", "fabs(timestep/x1) < minimum_variation", v40);
v28 = v41;
v29 = 71LL;
goto LABEL_28;
}
v25 = 1;
v26 = a12[v19];
v27 = v23 + v23 + a3;
if ( v26 > v27 )
{
v23 = v23 + a3;
v25 = 0;
v26 = v23;
}
if ( v26 > a4 )
{
v26 = a4;
v25 = 0;
}
if ( a15 )
{
if ( v33 == a3 && a1(a2, v20, a10, a16, a3, v26, v23, v27, v21, v22, a4, v33) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 92LL;
goto LABEL_28;
}
if ( a15(a2, v20, a10, a16, a3, v26, v23, v27, v21, v22, a4, v33) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 101LL;
goto LABEL_28;
}
}
if ( (unsigned int)generic_integrator(a1, a2, a10, v42, a3, v26, a5, a6 * a3) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi)",
v43);
v28 = v41;
v29 = 110LL;
goto LABEL_28;
}
if ( v25 == 1 )
{
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a1)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 123LL;
goto LABEL_28;
}
if ( a14(a2, v20, (unsigned int)v19, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 131LL;
goto LABEL_28;
}
++v19;
}
if ( a4 <= v26 || v19 >= a13 )
goto LABEL_31;
a3 = v26;
}
}
v26 = a3;
LABEL_31:
v32 = v26;
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a1)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 153LL;
LABEL_28:
class_protect_sprintf(a16, "%s(L:%d) :%s", "evolver_rk", v29, v28);
return 1;
}
if ( a15 )
{
v32 = v26;
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a15)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 162LL;
goto LABEL_28;
}
}
if ( (unsigned int)cleanup_generic_integrator(v42, v32, v26) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", "cleanup_generic_integrator(&gi)", v43);
v28 = v41;
v29 = 170LL;
goto LABEL_28;
}
free(v20);
return 0;
}

canonical_decompiled_code:
__int64 __fastcall func0(unsigned int (__fastcall *a1)(__int64, void *, __int64, const char *, double, double, double, double, double, double, double, double), __int64 a2, double a3, double a4, double a5, double a6, double a7, __int64 a8, unsigned int a9, __int64 a10, unsigned int (__fastcall *a11)(__int64, double *, const char *), double *a12, int a13, unsigned int (__fastcall *a14)(__int64, void *, _QWORD, __int64, const char *, double), unsigned int (__fastcall *a15)(__int64, void *, __int64, const char *, double, double, double, double, double, double, double, double), const char *a16)
{
__int64 v18; // rax
signed int v19; // ebx
void *v20; // r14
double v21; // xmm4_8
double v22; // xmm5_8
double v23; // xmm2_8
double v24; // xmm1_8
__int16 v25; // r15
double v26; // xmm1_8
double v27; // xmm3_8
const char *v28; // r8
__int64 v29; // rcx
double v32; // xmm0_8
double v33; // [rsp+8h] [rbp-1910h]
double v39; // [rsp+68h] [rbp-18B0h] BYREF
char v40[2048]; // [rsp+70h] [rbp-18A8h] BYREF
char v41[2048]; // [rsp+870h] [rbp-10A8h] BYREF
char v42[104]; // [rsp+1070h] [rbp-8A8h] BYREF
char v43[2112]; // [rsp+10D8h] [rbp-840h] BYREF

v33 = a3;
if ( a3 > a12[a13 - 1] )
{
class_protect_sprintf(v41, "called with x=%e, last x_sampling=%e", a3);
class_protect_sprintf(v42, "condition (%s) is true; %s", a3);
v28 = v42;
v29 = 42LL;
goto LABEL_28;
}
v18 = 1LL;
if ( a3 <= *a12 )
{
v19 = 0;
}
else
{
do
v19 = v18++;
while ( a3 > a12[v18 - 1] );
}
if ( (unsigned int)initialize_generic_integrator(a9, v42, a12) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", a3);
v28 = v41;
v29 = 50LL;
goto LABEL_28;
}
v20 = malloc(8LL * (int)a9);
if ( !v20 )
{
class_protect_sprintf(v41, "could not allocate %s with size %d", a3);
v28 = v41;
v29 = 54LL;
goto LABEL_28;
}
if ( a4 > a3 && a13 > v19 )
{
while ( 1 )
{
if ( a11(a10, &v39, a16) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", a3);
v28 = v41;
v29 = 62LL;
goto LABEL_28;
}
v23 = a7 * v39;
*(_QWORD *)&v24 = COERCE_UNSIGNED_INT64(a7 * v39 / a3) & LC9;
if ( a6 > v24 )
{
class_protect_sprintf(
v40,
"integration step =%e < machine precision : leads either to numerical error or infinite loop",
v24);
class_protect_sprintf(v41, "condition (%s) is true; %s", "fabs(timestep/x1) < minimum_variation", v40);
v28 = v41;
v29 = 71LL;
goto LABEL_28;
}
v25 = 1;
v26 = a12[v19];
v27 = v23 + v23 + a3;
if ( v26 > v27 )
{
v23 = v23 + a3;
v25 = 0;
v26 = v23;
}
if ( v26 > a4 )
{
v26 = a4;
v25 = 0;
}
if ( a15 )
{
if ( v33 == a3 && a1(a2, v20, a10, a16, a3, v26, v23, v27, v21, v22, a4, v33) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 92LL;
goto LABEL_28;
}
if ( a15(a2, v20, a10, a16, a3, v26, v23, v27, v21, v22, a4, v33) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 101LL;
goto LABEL_28;
}
}
if ( (unsigned int)generic_integrator(a1, a2, a10, v42, a3, v26, a5, a6 * a3) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi)",
v43);
v28 = v41;
v29 = 110LL;
goto LABEL_28;
}
if ( v25 == 1 )
{
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a1)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 123LL;
goto LABEL_28;
}
if ( a14(a2, v20, (unsigned int)v19, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 131LL;
goto LABEL_28;
}
++v19;
}
if ( a4 <= v26 || v19 >= a13 )
goto LABEL_31;
a3 = v26;
}
}
v26 = a3;
LABEL_31:
v32 = v26;
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a1)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 153LL;
LABEL_28:
class_protect_sprintf(a16, "%s(L:%d) :%s", "evolver_rk", v29, v28);
return 1;
}
if ( a15 )
{
v32 = v26;
if ( ((unsigned int (__fastcall *)(__int64, void *, __int64, const char *, double))a15)(a2, v20, a10, a16, v26) == 1 )
{
class_protect_sprintf(
v41,
"error in %s;\n=>%s",
"(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",
a16);
v28 = v41;
v29 = 162LL;
goto LABEL_28;
}
}
if ( (unsigned int)cleanup_generic_integrator(v42, v32, v26) == 1 )
{
class_protect_sprintf(v41, "error in %s;\n=>%s", "cleanup_generic_integrator(&gi)", v43);
v28 = v41;
v29 = 170LL;
goto LABEL_28;
}
free(v20);
return 0;
}

original_code:
int evolver_rk(int (*derivs)(double x,
      double * y,
      double * dy,
      void * parameters_and_workspace,
      ErrorMsg error_message),
      double x_ini,
      double x_end,
      double * y,
      int * used_in_output,
      int y_size,
      void * parameters_and_workspace_for_derivs,
      double tolerance,
      double minimum_variation,
      int (*evaluate_timescale)(double x,
           void * parameters_and_workspace,
           double * timescale,
           ErrorMsg error_message),
      double timestep_over_timescale,
      double * x_sampling,
      int x_size,
      int (*output)(double x,
      double y[],
      double dy[],
      int index_x,
      void * parameters_and_workspace,
      ErrorMsg error_message),
      int (*print_variables)(double x,
        double y[],
        double dy[],
        void * parameters_and_workspace,
        ErrorMsg error_message),
      ErrorMsg error_message) {
  int next_index_x;
  double x1,x2=0.,timestep,timescale;
  struct generic_integrator_workspace gi;
  double * dy;
  short call_output;
  { if (x_ini > x_sampling[x_size-1]) { { ErrorMsg Optional_arguments; class_protect_sprintf(Optional_arguments,"called with x=%e, last x_sampling=%e",x_ini,x_sampling[x_size-1]); { ErrorMsg FMsg; class_protect_sprintf(FMsg,"condition (%s) is true; %s","x_ini > x_sampling[x_size-1]",Optional_arguments); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,42,FMsg); }; }; return 1; } };
  next_index_x=0;
  while (x_sampling[next_index_x] < x_ini) next_index_x++;
  { if (initialize_generic_integrator(y_size, &gi) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","initialize_generic_integrator(y_size, &gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,50,FMsg); };; ; return 1; } };
  { dy=malloc(y_size*sizeof(double)); if (dy == ((void *)0)) { int size_int; size_int = y_size*sizeof(double); { ErrorMsg FMsg; class_protect_sprintf(FMsg,"could not allocate %s with size %d","dy",size_int); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,54,FMsg); };; return 1; } };
  x1=x_ini;
  call_output = 0;
  while ((x1 < x_end) && (next_index_x<x_size)) {
    { if ((*evaluate_timescale)(x1, parameters_and_workspace_for_derivs, &timescale, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*evaluate_timescale)(x1, parameters_and_workspace_for_derivs, &timescale, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,62,FMsg); };; ; return 1; } };
    timestep = timestep_over_timescale * timescale;
    { if (fabs(timestep/x1) < minimum_variation) { { ErrorMsg Optional_arguments; class_protect_sprintf(Optional_arguments,"integration step =%e < machine precision : leads either to numerical error or infinite loop",fabs(timestep/x1)); { ErrorMsg FMsg; class_protect_sprintf(FMsg,"condition (%s) is true; %s","fabs(timestep/x1) < minimum_variation",Optional_arguments); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,71,FMsg); }; }; return 1; } };
    if (x1 + 2.* timestep < x_sampling[next_index_x]) {
      x2 = x1 + timestep;
    }
    else {
      x2 = x_sampling[next_index_x];
      call_output = 1;
    }
    if (x2 > x_end) {
      x2 = x_end;
      call_output = 0;
    }
    if (print_variables != ((void *)0)) {
      if (x1 == x_ini) {
 { if ((*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,92,FMsg); };; ; return 1; } };
      }
      { if ((*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,101,FMsg); };; ; return 1; } };
    }
    { if (generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,110,FMsg); };; ; return 1; } };
    if (call_output == 1) {
      { if ((*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,123,FMsg); };; ; return 1; } };
      { if ((*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,131,FMsg); };; ; return 1; } };
      call_output = 0;
      next_index_x++;
    }
    x1 = x2;
  }
  { if ((*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,153,FMsg); };; ; return 1; } };
  if (print_variables != ((void *)0))
    { if ((*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,162,FMsg); };; ; return 1; } };
  { if (cleanup_generic_integrator(&gi) == 1) { { ErrorMsg FMsg; class_protect_sprintf(FMsg,"error in %s;\n=>%s","cleanup_generic_integrator(&gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,170,FMsg); };; ; return 1; } };
  free(dy);
  return 0;
}

canonical_original_code:
int evolver_rk(int (*derivs)(double x, double *y, double *dy, void *parameters_and_workspace, char error_message[2048]), double x_ini, double x_end, double *y, int *used_in_output, int y_size, void *parameters_and_workspace_for_derivs, double tolerance, double minimum_variation, int (*evaluate_timescale)(double x, void *parameters_and_workspace, double *timescale, char error_message[2048]), double timestep_over_timescale, double *x_sampling, int x_size, int (*output)(double x, double y[], double dy[], int index_x, void *parameters_and_workspace, char error_message[2048]), int (*print_variables)(double x, double y[], double dy[], void *parameters_and_workspace, char error_message[2048]), char error_message[2048]) {
  int next_index_x;
  double x1; double x2 = 0.; double timestep; double timescale;
  struct generic_integrator_workspace gi;
  double *dy;
  short call_output;
  { if (x_ini > x_sampling[x_size-1]) { { char Optional_arguments[2048]; class_protect_sprintf(Optional_arguments,"called with x=%e, last x_sampling=%e",x_ini,x_sampling[x_size-1]); { char FMsg[2048]; class_protect_sprintf(FMsg,"condition (%s) is true; %s","x_ini > x_sampling[x_size-1]",Optional_arguments); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,42,FMsg); }; }; return 1; } };
  next_index_x=0;
  while (x_sampling[next_index_x] < x_ini) next_index_x++;
  { if (initialize_generic_integrator(y_size, &gi) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","initialize_generic_integrator(y_size, &gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,50,FMsg); };; ; return 1; } };
  { dy=malloc(y_size*sizeof(double)); if (dy == ((void *)0)) { int size_int; size_int = y_size*sizeof(double); { char FMsg[2048]; class_protect_sprintf(FMsg,"could not allocate %s with size %d","dy",size_int); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,54,FMsg); };; return 1; } };
  x1=x_ini;
  call_output = 0;
  while ((x1 < x_end) && (next_index_x<x_size)) {
    { if ((*evaluate_timescale)(x1, parameters_and_workspace_for_derivs, &timescale, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*evaluate_timescale)(x1, parameters_and_workspace_for_derivs, &timescale, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,62,FMsg); };; ; return 1; } };
    timestep = timestep_over_timescale * timescale;
    { if (fabs(timestep/x1) < minimum_variation) { { char Optional_arguments[2048]; class_protect_sprintf(Optional_arguments,"integration step =%e < machine precision : leads either to numerical error or infinite loop",fabs(timestep/x1)); { char FMsg[2048]; class_protect_sprintf(FMsg,"condition (%s) is true; %s","fabs(timestep/x1) < minimum_variation",Optional_arguments); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,71,FMsg); }; }; return 1; } };
    if (x1 + 2.* timestep < x_sampling[next_index_x]) {
      x2 = x1 + timestep;
    }
    else {
      x2 = x_sampling[next_index_x];
      call_output = 1;
    }
    if (x2 > x_end) {
      x2 = x_end;
      call_output = 0;
    }
    if (print_variables != ((void *)0)) {
      if (x1 == x_ini) {
 { if ((*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,92,FMsg); };; ; return 1; } };
      }
      { if ((*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,101,FMsg); };; ; return 1; } };
    }
    { if (generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","generic_integrator(derivs, x1, x2, y, parameters_and_workspace_for_derivs, tolerance, x1*minimum_variation, &gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,110,FMsg); };; ; return 1; } };
    if (call_output == 1) {
      { if ((*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x2, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,123,FMsg); };; ; return 1; } };
      { if ((*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*output)(x2, y, dy, next_index_x, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,131,FMsg); };; ; return 1; } };
      call_output = 0;
      next_index_x++;
    }
    x1 = x2;
  }
  { if ((*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*derivs)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,153,FMsg); };; ; return 1; } };
  if (print_variables != ((void *)0))
    { if ((*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","(*print_variables)(x1, y, dy, parameters_and_workspace_for_derivs, error_message)",error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,162,FMsg); };; ; return 1; } };
  { if (cleanup_generic_integrator(&gi) == 1) { { char FMsg[2048]; class_protect_sprintf(FMsg,"error in %s;\n=>%s","cleanup_generic_integrator(&gi)",gi.error_message); class_protect_sprintf(error_message,"%s(L:%d) :%s",__func__,170,FMsg); };; ; return 1; } };
  free(dy);
  return 0;
}

variable_types: int (*)(double x, double *y, double *dy, void *parameters_and_workspace, char error_message[2048])

variable_types:
y
double *

variable_types: tolerance double

variable_types: int (*)(double x, void *parameters_and_workspace, double *timescale, char error_message[2048])

variable_types: int (*)(double x, double y[], double dy[], int index_x, void *parameters_and_workspace, char error_message[2048])

variable_types: int (*)(double x, double y[], double dy[], void *parameters_and_workspace, char error_message[2048])

variable_types: timestep double

variable_types: timescale double

variable_types: struct generic_integrator_workspace { int n; double *yscal; double *y; double *dydx; double *yerr; double *ytempo; double *ak2; double *ak3; double *ak4; double *ak5; double *ak6; double *ytemp; double stepmin; char error_message[2048]; }

variable_types:
dy
double *

variable_types:
FMsg
char [2048]