/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
#include "stdlib.h"
struct list {
   int element ;
   struct list *next ;
};
struct list *add(struct list *l, int i)
{
  struct list *new;
  __e_acsl_store_block((void *)(& new),(size_t)8);
  __e_acsl_store_block((void *)(& l),(size_t)8);
  __e_acsl_full_init((void *)(& new));
  new = (struct list *)malloc(sizeof(struct list));
  {
    int __gen_e_acsl_initialized;
    int __gen_e_acsl_and;
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& new),
                                                    sizeof(struct list *));
    if (__gen_e_acsl_initialized) {
      int __gen_e_acsl_valid;
      __gen_e_acsl_valid = __e_acsl_valid((void *)new,sizeof(struct list),
                                          (void *)new,(void *)(& new));
      __gen_e_acsl_and = __gen_e_acsl_valid;
    }
    else __gen_e_acsl_and = 0;
    __e_acsl_assert(__gen_e_acsl_and,"Assertion","add","\\valid(new)",
                    "tests/memory/local_var.c",15);
  }
  /*@ assert \valid(new); */ ;
  __e_acsl_initialize((void *)(& new->element),sizeof(int));
  new->element = i;
  __e_acsl_initialize((void *)(& new->next),sizeof(struct list *));
  new->next = l;
  __e_acsl_delete_block((void *)(& l));
  __e_acsl_delete_block((void *)(& new));
  return new;
}

int main(void)
{
  int __retres;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  struct list *l = (struct list *)0;
  __e_acsl_store_block((void *)(& l),(size_t)8);
  __e_acsl_full_init((void *)(& l));
  __e_acsl_full_init((void *)(& l));
  l = add(l,4);
  __e_acsl_full_init((void *)(& l));
  l = add(l,7);
  __retres = 0;
  __e_acsl_delete_block((void *)(& l));
  __e_acsl_memory_clean();
  return __retres;
}


