/* Generated by Frama-C */
#include "pthread.h"
#include "sched.h"
#include "signal.h"
#include "stddef.h"
#include "stdint.h"
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
extern  __attribute__((__FC_BUILTIN__)) int __e_acsl_sound_verdict;

int main(void)
{
  int __retres;
  int *p;
  int *q;
  __e_acsl_memory_init((int *)0,(char ***)0,8UL);
  __e_acsl_store_block((void *)(& q),8UL);
  __e_acsl_store_block((void *)(& p),8UL);
  {
    int __gen_e_acsl_initialized;
    int __gen_e_acsl_and;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data = {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data,"&p",
                                 (void *)(& p));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& p),
                                                    sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,
                                 "\\initialized(&p)",0,
                                 __gen_e_acsl_initialized);
    if (__gen_e_acsl_initialized) {
      int __gen_e_acsl_valid;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data,"p",(void *)p);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid = __e_acsl_valid((void *)p,sizeof(int),(void *)p,
                                          (void *)(& p));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"\\valid(p)",0,
                                   __gen_e_acsl_valid);
      __gen_e_acsl_and = __gen_e_acsl_valid;
    }
    else __gen_e_acsl_and = 0;
    __gen_e_acsl_assert_data.blocking = 1;
    __gen_e_acsl_assert_data.kind = "Assertion";
    __gen_e_acsl_assert_data.pred_txt = "!\\valid(p)";
    __gen_e_acsl_assert_data.file = "t_malloc.c";
    __gen_e_acsl_assert_data.fct = "main";
    __gen_e_acsl_assert_data.line = 11;
    __e_acsl_assert(! __gen_e_acsl_and,& __gen_e_acsl_assert_data);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
  }
  /*@ assert !\valid(p); */ ;
  {
    int __gen_e_acsl_initialized_2;
    int __gen_e_acsl_and_2;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_2 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_2,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_2,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& q),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_2);
    if (__gen_e_acsl_initialized_2) {
      int __gen_e_acsl_valid_2;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_2,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_2,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_2 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                            (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,"\\valid(q)",
                                   0,__gen_e_acsl_valid_2);
      __gen_e_acsl_and_2 = __gen_e_acsl_valid_2;
    }
    else __gen_e_acsl_and_2 = 0;
    __gen_e_acsl_assert_data_2.blocking = 1;
    __gen_e_acsl_assert_data_2.kind = "Assertion";
    __gen_e_acsl_assert_data_2.pred_txt = "!\\valid(q)";
    __gen_e_acsl_assert_data_2.file = "t_malloc.c";
    __gen_e_acsl_assert_data_2.fct = "main";
    __gen_e_acsl_assert_data_2.line = 12;
    __e_acsl_assert(! __gen_e_acsl_and_2,& __gen_e_acsl_assert_data_2);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_2);
  }
  /*@ assert !\valid(q); */ ;
  __e_acsl_full_init((void *)(& p));
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  p = (int *)malloc(sizeof(int));
  __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p));
  __e_acsl_full_init((void *)(& q));
  __e_acsl_temporal_store_nreferent((void *)(& q),(void *)(& p));
  q = p;
  {
    int __gen_e_acsl_initialized_3;
    int __gen_e_acsl_and_3;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_3 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_3,"&p",
                                 (void *)(& p));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_3,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& p),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_3,
                                 "\\initialized(&p)",0,
                                 __gen_e_acsl_initialized_3);
    if (__gen_e_acsl_initialized_3) {
      int __gen_e_acsl_valid_3;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_3,"p",
                                   (void *)p);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_3,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_3 = __e_acsl_valid((void *)p,sizeof(int),(void *)p,
                                            (void *)(& p));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_3,"\\valid(p)",
                                   0,__gen_e_acsl_valid_3);
      __gen_e_acsl_and_3 = __gen_e_acsl_valid_3;
    }
    else __gen_e_acsl_and_3 = 0;
    __gen_e_acsl_assert_data_3.blocking = 1;
    __gen_e_acsl_assert_data_3.kind = "Assertion";
    __gen_e_acsl_assert_data_3.pred_txt = "\\valid(p)";
    __gen_e_acsl_assert_data_3.file = "t_malloc.c";
    __gen_e_acsl_assert_data_3.fct = "main";
    __gen_e_acsl_assert_data_3.line = 17;
    __e_acsl_assert(__gen_e_acsl_and_3,& __gen_e_acsl_assert_data_3);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_3);
  }
  /*@ assert \valid(p); */ ;
  {
    int __gen_e_acsl_initialized_4;
    int __gen_e_acsl_and_4;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_4 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_4,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& q),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_4,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_4);
    if (__gen_e_acsl_initialized_4) {
      int __gen_e_acsl_valid_4;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_4,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_4 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                            (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_4,"\\valid(q)",
                                   0,__gen_e_acsl_valid_4);
      __gen_e_acsl_and_4 = __gen_e_acsl_valid_4;
    }
    else __gen_e_acsl_and_4 = 0;
    __gen_e_acsl_assert_data_4.blocking = 1;
    __gen_e_acsl_assert_data_4.kind = "Assertion";
    __gen_e_acsl_assert_data_4.pred_txt = "\\valid(q)";
    __gen_e_acsl_assert_data_4.file = "t_malloc.c";
    __gen_e_acsl_assert_data_4.fct = "main";
    __gen_e_acsl_assert_data_4.line = 18;
    __e_acsl_assert(__gen_e_acsl_and_4,& __gen_e_acsl_assert_data_4);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_4);
  }
  /*@ assert \valid(q); */ ;
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  __e_acsl_temporal_save_nreferent_parameter((void *)(& q),0U);
  free((void *)q);
  {
    int __gen_e_acsl_initialized_5;
    int __gen_e_acsl_and_5;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_5 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_5,"&p",
                                 (void *)(& p));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_5,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& p),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_5,
                                 "\\initialized(&p)",0,
                                 __gen_e_acsl_initialized_5);
    if (__gen_e_acsl_initialized_5) {
      int __gen_e_acsl_valid_5;
      /*@ assert Eva: dangling_pointer: !\dangling(&p); */
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_5,"p",
                                   (void *)p);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_5,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_5 = __e_acsl_valid((void *)p,sizeof(int),(void *)p,
                                            (void *)(& p));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_5,"\\valid(p)",
                                   0,__gen_e_acsl_valid_5);
      __gen_e_acsl_and_5 = __gen_e_acsl_valid_5;
    }
    else __gen_e_acsl_and_5 = 0;
    __gen_e_acsl_assert_data_5.blocking = 1;
    __gen_e_acsl_assert_data_5.kind = "Assertion";
    __gen_e_acsl_assert_data_5.pred_txt = "!\\valid(p)";
    __gen_e_acsl_assert_data_5.file = "t_malloc.c";
    __gen_e_acsl_assert_data_5.fct = "main";
    __gen_e_acsl_assert_data_5.line = 22;
    __e_acsl_assert(! __gen_e_acsl_and_5,& __gen_e_acsl_assert_data_5);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_5);
  }
  /*@ assert !\valid(p); */ ;
  {
    int __gen_e_acsl_initialized_6;
    int __gen_e_acsl_and_6;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_6 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_6,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_6,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& q),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_6,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_6);
    if (__gen_e_acsl_initialized_6) {
      int __gen_e_acsl_valid_6;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_6,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_6,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_6 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                            (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_6,"\\valid(q)",
                                   0,__gen_e_acsl_valid_6);
      __gen_e_acsl_and_6 = __gen_e_acsl_valid_6;
    }
    else __gen_e_acsl_and_6 = 0;
    __gen_e_acsl_assert_data_6.blocking = 1;
    __gen_e_acsl_assert_data_6.kind = "Assertion";
    __gen_e_acsl_assert_data_6.pred_txt = "!\\valid(q)";
    __gen_e_acsl_assert_data_6.file = "t_malloc.c";
    __gen_e_acsl_assert_data_6.fct = "main";
    __gen_e_acsl_assert_data_6.line = 23;
    __e_acsl_assert(! __gen_e_acsl_and_6,& __gen_e_acsl_assert_data_6);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_6);
  }
  /*@ assert !\valid(q); */ ;
  __e_acsl_full_init((void *)(& p));
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  p = (int *)malloc(sizeof(int));
  __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p));
  {
    int __gen_e_acsl_initialized_7;
    int __gen_e_acsl_and_7;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_7 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_7,"&p",
                                 (void *)(& p));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_7,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& p),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_7,
                                 "\\initialized(&p)",0,
                                 __gen_e_acsl_initialized_7);
    if (__gen_e_acsl_initialized_7) {
      int __gen_e_acsl_valid_7;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_7,"p",
                                   (void *)p);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_7,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_7 = __e_acsl_valid((void *)p,sizeof(int),(void *)p,
                                            (void *)(& p));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_7,"\\valid(p)",
                                   0,__gen_e_acsl_valid_7);
      __gen_e_acsl_and_7 = __gen_e_acsl_valid_7;
    }
    else __gen_e_acsl_and_7 = 0;
    __gen_e_acsl_assert_data_7.blocking = 1;
    __gen_e_acsl_assert_data_7.kind = "Assertion";
    __gen_e_acsl_assert_data_7.pred_txt = "\\valid(p)";
    __gen_e_acsl_assert_data_7.file = "t_malloc.c";
    __gen_e_acsl_assert_data_7.fct = "main";
    __gen_e_acsl_assert_data_7.line = 28;
    __e_acsl_assert(__gen_e_acsl_and_7,& __gen_e_acsl_assert_data_7);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_7);
  }
  /*@ assert \valid(p); */ ;
  {
    int __gen_e_acsl_initialized_8;
    int __gen_e_acsl_and_8;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_8 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_8,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_8,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_8 = __e_acsl_initialized((void *)(& q),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_8,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_8);
    if (__gen_e_acsl_initialized_8) {
      int __gen_e_acsl_valid_8;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_8,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_8,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_8 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                            (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_8,"\\valid(q)",
                                   0,__gen_e_acsl_valid_8);
      __gen_e_acsl_and_8 = __gen_e_acsl_valid_8;
    }
    else __gen_e_acsl_and_8 = 0;
    __gen_e_acsl_assert_data_8.blocking = 1;
    __gen_e_acsl_assert_data_8.kind = "Assertion";
    __gen_e_acsl_assert_data_8.pred_txt = "!\\valid(q)";
    __gen_e_acsl_assert_data_8.file = "t_malloc.c";
    __gen_e_acsl_assert_data_8.fct = "main";
    __gen_e_acsl_assert_data_8.line = 29;
    __e_acsl_assert(! __gen_e_acsl_and_8,& __gen_e_acsl_assert_data_8);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_8);
  }
  /*@ assert !\valid(q); */ ;
  __e_acsl_initialize((void *)q,sizeof(int));
  *q = 1;
  __e_acsl_initialize((void *)p,sizeof(int));
  *p = 2;
  __e_acsl_full_init((void *)(& q));
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  q = (int *)calloc((size_t)4096,(size_t)1);
  __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q));
  {
    int __gen_e_acsl_initialized_9;
    int __gen_e_acsl_and_9;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_9 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_9,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_9,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_9 = __e_acsl_initialized((void *)(& q),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_9,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_9);
    if (__gen_e_acsl_initialized_9) {
      int __gen_e_acsl_valid_9;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_9,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_9,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_9 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                            (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_9,"\\valid(q)",
                                   0,__gen_e_acsl_valid_9);
      __gen_e_acsl_and_9 = __gen_e_acsl_valid_9;
    }
    else __gen_e_acsl_and_9 = 0;
    __gen_e_acsl_assert_data_9.blocking = 1;
    __gen_e_acsl_assert_data_9.kind = "Assertion";
    __gen_e_acsl_assert_data_9.pred_txt = "\\valid(q)";
    __gen_e_acsl_assert_data_9.file = "t_malloc.c";
    __gen_e_acsl_assert_data_9.fct = "main";
    __gen_e_acsl_assert_data_9.line = 35;
    __e_acsl_assert(__gen_e_acsl_and_9,& __gen_e_acsl_assert_data_9);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_9);
  }
  /*@ assert \valid(q); */ ;
  __e_acsl_full_init((void *)(& q));
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  __e_acsl_temporal_save_nreferent_parameter((void *)(& q),0U);
  q = (int *)realloc((void *)q,(size_t)8192);
  __e_acsl_temporal_store_nblock((void *)(& q),(void *)*(& q));
  {
    int __gen_e_acsl_initialized_10;
    int __gen_e_acsl_and_10;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_10 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_10,"&q",
                                 (void *)(& q));
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_10,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_10 = __e_acsl_initialized((void *)(& q),
                                                       sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_10,
                                 "\\initialized(&q)",0,
                                 __gen_e_acsl_initialized_10);
    if (__gen_e_acsl_initialized_10) {
      int __gen_e_acsl_valid_10;
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_10,"q",
                                   (void *)q);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_10,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_10 = __e_acsl_valid((void *)q,sizeof(int),(void *)q,
                                             (void *)(& q));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_10,
                                   "\\valid(q)",0,__gen_e_acsl_valid_10);
      __gen_e_acsl_and_10 = __gen_e_acsl_valid_10;
    }
    else __gen_e_acsl_and_10 = 0;
    __gen_e_acsl_assert_data_10.blocking = 1;
    __gen_e_acsl_assert_data_10.kind = "Assertion";
    __gen_e_acsl_assert_data_10.pred_txt = "\\valid(q)";
    __gen_e_acsl_assert_data_10.file = "t_malloc.c";
    __gen_e_acsl_assert_data_10.fct = "main";
    __gen_e_acsl_assert_data_10.line = 39;
    __e_acsl_assert(__gen_e_acsl_and_10,& __gen_e_acsl_assert_data_10);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_10);
  }
  /*@ assert \valid(q); */ ;
  __retres = 0;
  __e_acsl_delete_block((void *)(& q));
  __e_acsl_delete_block((void *)(& p));
  __e_acsl_memory_clean();
  return __retres;
}


