/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
#include "stdlib.h"
int main(void)
{
  int __retres;
  int *a;
  int *b;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_store_block((void *)(& b),(size_t)8);
  __e_acsl_store_block((void *)(& a),(size_t)8);
  int n = 0;
  {
    int __gen_e_acsl_initialized;
    int __gen_e_acsl_and;
    int __gen_e_acsl_and_3;
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& a),
                                                    sizeof(int *));
    if (__gen_e_acsl_initialized) {
      int __gen_e_acsl_valid;
      __gen_e_acsl_valid = __e_acsl_valid((void *)a,sizeof(int),(void *)a,
                                          (void *)(& a));
      __gen_e_acsl_and = __gen_e_acsl_valid;
    }
    else __gen_e_acsl_and = 0;
    if (! __gen_e_acsl_and) {
      int __gen_e_acsl_initialized_2;
      int __gen_e_acsl_and_2;
      __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& b),
                                                        sizeof(int *));
      if (__gen_e_acsl_initialized_2) {
        int __gen_e_acsl_valid_2;
        __gen_e_acsl_valid_2 = __e_acsl_valid((void *)b,sizeof(int),
                                              (void *)b,(void *)(& b));
        __gen_e_acsl_and_2 = __gen_e_acsl_valid_2;
      }
      else __gen_e_acsl_and_2 = 0;
      __gen_e_acsl_and_3 = ! __gen_e_acsl_and_2;
    }
    else __gen_e_acsl_and_3 = 0;
    __e_acsl_assert(__gen_e_acsl_and_3,"Assertion","main",
                    "!\\valid(a) && !\\valid(b)",
                    "tests/memory/valid_alias.c",9);
  }
  /*@ assert ¬\valid(a) ∧ ¬\valid(b); */ ;
  __e_acsl_full_init((void *)(& a));
  a = (int *)malloc(sizeof(int));
  __e_acsl_initialize((void *)a,sizeof(int));
  *a = n;
  __e_acsl_full_init((void *)(& b));
  b = a;
  {
    int __gen_e_acsl_initialized_3;
    int __gen_e_acsl_and_4;
    int __gen_e_acsl_and_6;
    __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(& a),
                                                      sizeof(int *));
    if (__gen_e_acsl_initialized_3) {
      int __gen_e_acsl_valid_3;
      __gen_e_acsl_valid_3 = __e_acsl_valid((void *)a,sizeof(int),(void *)a,
                                            (void *)(& a));
      __gen_e_acsl_and_4 = __gen_e_acsl_valid_3;
    }
    else __gen_e_acsl_and_4 = 0;
    if (__gen_e_acsl_and_4) {
      int __gen_e_acsl_initialized_4;
      int __gen_e_acsl_and_5;
      __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& b),
                                                        sizeof(int *));
      if (__gen_e_acsl_initialized_4) {
        int __gen_e_acsl_valid_4;
        __gen_e_acsl_valid_4 = __e_acsl_valid((void *)b,sizeof(int),
                                              (void *)b,(void *)(& b));
        __gen_e_acsl_and_5 = __gen_e_acsl_valid_4;
      }
      else __gen_e_acsl_and_5 = 0;
      __gen_e_acsl_and_6 = __gen_e_acsl_and_5;
    }
    else __gen_e_acsl_and_6 = 0;
    __e_acsl_assert(__gen_e_acsl_and_6,"Assertion","main",
                    "\\valid(a) && \\valid(b)","tests/memory/valid_alias.c",
                    13);
  }
  /*@ assert \valid(a) ∧ \valid(b); */ ;
  {
    int __gen_e_acsl_initialized_5;
    int __gen_e_acsl_and_7;
    __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)(& b),
                                                      sizeof(int *));
    if (__gen_e_acsl_initialized_5) {
      int __gen_e_acsl_valid_read;
      __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)b,sizeof(int),
                                                    (void *)b,(void *)(& b));
      __gen_e_acsl_and_7 = __gen_e_acsl_valid_read;
    }
    else __gen_e_acsl_and_7 = 0;
    __e_acsl_assert(__gen_e_acsl_and_7,"RTE","main",
                    "mem_access: \\valid_read(b)",
                    "tests/memory/valid_alias.c",14);
    __e_acsl_assert(*b == n,"Assertion","main","*b == n",
                    "tests/memory/valid_alias.c",14);
  }
  /*@ assert *b ≡ n; */ ;
  free((void *)b);
  {
    int __gen_e_acsl_initialized_6;
    int __gen_e_acsl_and_8;
    int __gen_e_acsl_and_10;
    __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)(& a),
                                                      sizeof(int *));
    if (__gen_e_acsl_initialized_6) {
      int __gen_e_acsl_valid_5;
      /*@ assert Eva: dangling_pointer: ¬\dangling(&a); */
      __gen_e_acsl_valid_5 = __e_acsl_valid((void *)a,sizeof(int),(void *)a,
                                            (void *)(& a));
      __gen_e_acsl_and_8 = __gen_e_acsl_valid_5;
    }
    else __gen_e_acsl_and_8 = 0;
    if (! __gen_e_acsl_and_8) {
      int __gen_e_acsl_initialized_7;
      int __gen_e_acsl_and_9;
      __gen_e_acsl_initialized_7 = __e_acsl_initialized((void *)(& b),
                                                        sizeof(int *));
      if (__gen_e_acsl_initialized_7) {
        int __gen_e_acsl_valid_6;
        __gen_e_acsl_valid_6 = __e_acsl_valid((void *)b,sizeof(int),
                                              (void *)b,(void *)(& b));
        __gen_e_acsl_and_9 = __gen_e_acsl_valid_6;
      }
      else __gen_e_acsl_and_9 = 0;
      __gen_e_acsl_and_10 = ! __gen_e_acsl_and_9;
    }
    else __gen_e_acsl_and_10 = 0;
    __e_acsl_assert(__gen_e_acsl_and_10,"Assertion","main",
                    "!\\valid(a) && !\\valid(b)",
                    "tests/memory/valid_alias.c",16);
  }
  /*@ assert ¬\valid(a) ∧ ¬\valid(b); */ ;
  __retres = 0;
  __e_acsl_delete_block((void *)(& b));
  __e_acsl_delete_block((void *)(& a));
  __e_acsl_memory_clean();
  return __retres;
}


