/* 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;
  __e_acsl_memory_init((int *)0,(char ***)0,8UL);
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  int **p = malloc(sizeof(int *) * (unsigned long)3);
  __e_acsl_temporal_store_nblock((void *)(& p),(void *)*(& p));
  __e_acsl_store_block((void *)(& p),8UL);
  __e_acsl_full_init((void *)(& p));
  int i = 0;
  while (i < 3) {
    {
      int __gen_e_acsl_valid;
      __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_int(& __gen_e_acsl_assert_data,"i",0,i);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,
                                     "sizeof(int *)",0,sizeof(int *));
      __gen_e_acsl_valid = __e_acsl_valid((void *)(p + i),sizeof(int *),
                                          (void *)p,(void *)(& p));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,
                                   "\\valid(p + i)",0,__gen_e_acsl_valid);
      __gen_e_acsl_assert_data.blocking = 1;
      __gen_e_acsl_assert_data.kind = "Assertion";
      __gen_e_acsl_assert_data.pred_txt = "\\valid(p + i)";
      __gen_e_acsl_assert_data.file = "t_dpointer.c";
      __gen_e_acsl_assert_data.fct = "main";
      __gen_e_acsl_assert_data.line = 13;
      __e_acsl_assert(__gen_e_acsl_valid,& __gen_e_acsl_assert_data);
      __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
    }
    /*@ assert \valid(p + i); */ ;
    __e_acsl_initialize((void *)(p + i),sizeof(int *));
    __e_acsl_temporal_reset_parameters();
    __e_acsl_temporal_reset_return();
    *(p + i) = (int *)malloc(sizeof(int));
    __e_acsl_temporal_store_nblock((void *)(p + i),(void *)*(p + i));
    {
      int __gen_e_acsl_initialized;
      int __gen_e_acsl_and;
      __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,"p",
                                   (void *)p);
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,"i",0,i);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_2,
                                     "sizeof(int *)",0,sizeof(int *));
      __gen_e_acsl_initialized = __e_acsl_initialized((void *)(p + i),
                                                      sizeof(int *));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,
                                   "\\initialized(p + i)",0,
                                   __gen_e_acsl_initialized);
      if (__gen_e_acsl_initialized) {
        int __gen_e_acsl_valid_read;
        int __gen_e_acsl_valid_2;
        __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_2,"*(p + i)",
                                     (void *)*(p + i));
        __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_int(& __gen_e_acsl_assert_data_3,"i",0,i);
        __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_3,
                                       "sizeof(int *)",0,sizeof(int *));
        __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(p + i),
                                                      sizeof(int *),
                                                      (void *)p,
                                                      (void *)(& p));
        __gen_e_acsl_assert_data_3.blocking = 1;
        __gen_e_acsl_assert_data_3.kind = "RTE";
        __gen_e_acsl_assert_data_3.pred_txt = "\\valid_read(p + i)";
        __gen_e_acsl_assert_data_3.file = "t_dpointer.c";
        __gen_e_acsl_assert_data_3.fct = "main";
        __gen_e_acsl_assert_data_3.line = 15;
        __gen_e_acsl_assert_data_3.name = "mem_access";
        __e_acsl_assert(__gen_e_acsl_valid_read,& __gen_e_acsl_assert_data_3);
        __e_acsl_assert_clean(& __gen_e_acsl_assert_data_3);
        __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 *)*(p + i),sizeof(int),
                                              (void *)*(p + i),
                                              (void *)(p + i));
        __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_2,
                                     "\\valid(*(p + i))",0,
                                     __gen_e_acsl_valid_2);
        __gen_e_acsl_and = __gen_e_acsl_valid_2;
      }
      else __gen_e_acsl_and = 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(*(p + i))";
      __gen_e_acsl_assert_data_2.file = "t_dpointer.c";
      __gen_e_acsl_assert_data_2.fct = "main";
      __gen_e_acsl_assert_data_2.line = 15;
      __e_acsl_assert(__gen_e_acsl_and,& __gen_e_acsl_assert_data_2);
      __e_acsl_assert_clean(& __gen_e_acsl_assert_data_2);
    }
    /*@ assert \valid(*(p + i)); */ ;
    i ++;
  }
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  __e_acsl_temporal_save_nreferent_parameter((void *)(p + 2),0U);
  free((void *)*(p + 2));
  __e_acsl_temporal_reset_parameters();
  __e_acsl_temporal_reset_return();
  malloc(sizeof(int));
  {
    int __gen_e_acsl_initialized_2;
    int __gen_e_acsl_and_2;
    __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,"p",(void *)p);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,
                                   "sizeof(int *)",0,sizeof(int *));
    __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(p + 2),
                                                      sizeof(int *));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_4,
                                 "\\initialized(p + 2)",0,
                                 __gen_e_acsl_initialized_2);
    if (__gen_e_acsl_initialized_2) {
      int __gen_e_acsl_valid_read_2;
      int __gen_e_acsl_valid_3;
      /*@ assert Eva: dangling_pointer: !\dangling(p + 2); */
      __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_4,"*(p + 2)",
                                   (void *)*(p + 2));
      __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_valid_read_2 = __e_acsl_valid_read((void *)(p + 2),
                                                      sizeof(int *),
                                                      (void *)p,
                                                      (void *)(& p));
      __gen_e_acsl_assert_data_5.blocking = 1;
      __gen_e_acsl_assert_data_5.kind = "RTE";
      __gen_e_acsl_assert_data_5.pred_txt = "\\valid_read(p + 2)";
      __gen_e_acsl_assert_data_5.file = "t_dpointer.c";
      __gen_e_acsl_assert_data_5.fct = "main";
      __gen_e_acsl_assert_data_5.line = 21;
      __gen_e_acsl_assert_data_5.name = "mem_access";
      __e_acsl_assert(__gen_e_acsl_valid_read_2,& __gen_e_acsl_assert_data_5);
      __e_acsl_assert_clean(& __gen_e_acsl_assert_data_5);
      __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,
                                     "sizeof(int)",0,sizeof(int));
      __gen_e_acsl_valid_3 = __e_acsl_valid((void *)*(p + 2),sizeof(int),
                                            (void *)*(p + 2),(void *)(
                                            p + 2));
      __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_4,
                                   "\\valid(*(p + 2))",0,
                                   __gen_e_acsl_valid_3);
      __gen_e_acsl_and_2 = __gen_e_acsl_valid_3;
    }
    else __gen_e_acsl_and_2 = 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(*(p + 2))";
    __gen_e_acsl_assert_data_4.file = "t_dpointer.c";
    __gen_e_acsl_assert_data_4.fct = "main";
    __gen_e_acsl_assert_data_4.line = 21;
    __e_acsl_assert(! __gen_e_acsl_and_2,& __gen_e_acsl_assert_data_4);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_4);
  }
  /*@ assert !\valid(*(p + 2)); */ ;
  __retres = 0;
  __e_acsl_delete_block((void *)(& p));
  __e_acsl_memory_clean();
  return __retres;
}


