/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
#include "stdlib.h"
extern int __e_acsl_sound_verdict;

struct S {
   int a[2] ;
   float *b ;
   float *c ;
};
/*@ requires ¬\valid(s + (3 .. n + 1000)); */
void __gen_e_acsl_f(char *s, long n);

void f(char *s, long n)
{
  return;
}

/*@ requires \valid(ptr + (0 .. size - 1));
    ensures ¬\valid(\old(ptr) + (0 .. \old(size) + 1));
 */
void __gen_e_acsl_g(long *ptr, size_t size);

void g(long *ptr, size_t size)
{
  __e_acsl_store_block((void *)(& ptr),(size_t)8);
  __e_acsl_delete_block((void *)(& ptr));
  return;
}

int main(void)
{
  int __retres;
  int *a;
  char *b;
  double t2[4];
  float t3[7][2][4];
  int t4[10][10][10];
  struct S s;
  int **multi_dynamic;
  int i;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_store_block((void *)(& multi_dynamic),(size_t)8);
  __e_acsl_store_block((void *)(& s),(size_t)24);
  __e_acsl_store_block((void *)(t4),(size_t)4000);
  __e_acsl_store_block((void *)(t3),(size_t)224);
  __e_acsl_store_block((void *)(t2),(size_t)32);
  __e_acsl_store_block((void *)(& b),(size_t)8);
  __e_acsl_store_block((void *)(& a),(size_t)8);
  __e_acsl_full_init((void *)(& a));
  a = (int *)malloc((unsigned long)10 * sizeof(int));
  {
    int __gen_e_acsl_size;
    int __gen_e_acsl_if;
    int __gen_e_acsl_valid;
    __gen_e_acsl_size = 4 * ((4 - 0) + 1);
    if (__gen_e_acsl_size <= 0) __gen_e_acsl_if = 0;
    else __gen_e_acsl_if = __gen_e_acsl_size;
    __gen_e_acsl_valid = __e_acsl_valid((void *)((char *)a + 4 * 0),
                                        (size_t)__gen_e_acsl_if,(void *)a,
                                        (void *)(& a));
    __e_acsl_assert(__gen_e_acsl_valid,"Assertion","main",
                    "\\valid(a + (0 .. 4))",
                    "tests/memory/ranges_in_builtins.c",19);
  }
  /*@ assert \valid(a + (0 .. 4)); */ ;
  int j = 2;
  {
    long __gen_e_acsl_size_2;
    long __gen_e_acsl_if_2;
    int __gen_e_acsl_valid_2;
    __gen_e_acsl_size_2 = 4L * (((7L + j) - 4L) + 1L);
    if (__gen_e_acsl_size_2 <= 0L) __gen_e_acsl_if_2 = 0L;
    else __gen_e_acsl_if_2 = __gen_e_acsl_size_2;
    __gen_e_acsl_valid_2 = __e_acsl_valid((void *)((char *)a + 4 * 4),
                                          (size_t)__gen_e_acsl_if_2,
                                          (void *)a,(void *)(& a));
    __e_acsl_assert(__gen_e_acsl_valid_2,"Assertion","main",
                    "\\valid(a + (4 .. 7 + j))",
                    "tests/memory/ranges_in_builtins.c",21);
  }
  /*@ assert \valid(a + (4 .. 7 + j)); */ ;
  {
    int __gen_e_acsl_size_3;
    int __gen_e_acsl_if_3;
    int __gen_e_acsl_valid_3;
    __gen_e_acsl_size_3 = 4 * ((11 - 10) + 1);
    if (__gen_e_acsl_size_3 <= 0) __gen_e_acsl_if_3 = 0;
    else __gen_e_acsl_if_3 = __gen_e_acsl_size_3;
    __gen_e_acsl_valid_3 = __e_acsl_valid((void *)((char *)a + 4 * 10),
                                          (size_t)__gen_e_acsl_if_3,
                                          (void *)a,(void *)(& a));
    __e_acsl_assert(! __gen_e_acsl_valid_3,"Assertion","main",
                    "!\\valid(a + (10 .. 11))",
                    "tests/memory/ranges_in_builtins.c",22);
  }
  /*@ assert ¬\valid(a + (10 .. 11)); */ ;
  free((void *)a);
  __e_acsl_full_init((void *)(& b));
  b = (char *)malloc((unsigned long)10 * sizeof(char));
  {
    int __gen_e_acsl_size_4;
    int __gen_e_acsl_if_4;
    int __gen_e_acsl_valid_4;
    __gen_e_acsl_size_4 = 1 * ((9 - 0) + 1);
    if (__gen_e_acsl_size_4 <= 0) __gen_e_acsl_if_4 = 0;
    else __gen_e_acsl_if_4 = __gen_e_acsl_size_4;
    __gen_e_acsl_valid_4 = __e_acsl_valid((void *)(b + 1 * 0),
                                          (size_t)__gen_e_acsl_if_4,
                                          (void *)b,(void *)(& b));
    __e_acsl_assert(__gen_e_acsl_valid_4,"Assertion","main",
                    "\\valid(b + (0 .. 9))",
                    "tests/memory/ranges_in_builtins.c",27);
  }
  /*@ assert \valid(b + (0 .. 9)); */ ;
  {
    int __gen_e_acsl_size_5;
    int __gen_e_acsl_if_5;
    int __gen_e_acsl_valid_5;
    __gen_e_acsl_size_5 = 1 * ((15 - 10) + 1);
    if (__gen_e_acsl_size_5 <= 0) __gen_e_acsl_if_5 = 0;
    else __gen_e_acsl_if_5 = __gen_e_acsl_size_5;
    __gen_e_acsl_valid_5 = __e_acsl_valid((void *)(b + 1 * 10),
                                          (size_t)__gen_e_acsl_if_5,
                                          (void *)b,(void *)(& b));
    __e_acsl_assert(! __gen_e_acsl_valid_5,"Assertion","main",
                    "!\\valid(b + (10 .. 15))",
                    "tests/memory/ranges_in_builtins.c",28);
  }
  /*@ assert ¬\valid(b + (10 .. 15)); */ ;
  long t[3] = {7l, 8l, 9l};
  __e_acsl_store_block((void *)(t),(size_t)24);
  __e_acsl_full_init((void *)(& t));
  {
    int __gen_e_acsl_size_6;
    int __gen_e_acsl_if_6;
    int __gen_e_acsl_valid_6;
    __gen_e_acsl_size_6 = 8 * ((2 - 0) + 1);
    if (__gen_e_acsl_size_6 <= 0) __gen_e_acsl_if_6 = 0;
    else __gen_e_acsl_if_6 = __gen_e_acsl_size_6;
    __gen_e_acsl_valid_6 = __e_acsl_valid((void *)((char *)(& t) + 8 * 0),
                                          (size_t)__gen_e_acsl_if_6,
                                          (void *)(& t),(void *)0);
    __e_acsl_assert(__gen_e_acsl_valid_6,"Assertion","main",
                    "\\valid(&t[0 .. 2])",
                    "tests/memory/ranges_in_builtins.c",31);
  }
  /*@ assert \valid(&t[0 .. 2]); */ ;
  {
    int __gen_e_acsl_size_7;
    int __gen_e_acsl_if_7;
    int __gen_e_acsl_valid_7;
    __gen_e_acsl_size_7 = 8 * ((5 - 3) + 1);
    if (__gen_e_acsl_size_7 <= 0) __gen_e_acsl_if_7 = 0;
    else __gen_e_acsl_if_7 = __gen_e_acsl_size_7;
    __gen_e_acsl_valid_7 = __e_acsl_valid((void *)((char *)(& t) + 8 * 3),
                                          (size_t)__gen_e_acsl_if_7,
                                          (void *)(& t),(void *)0);
    __e_acsl_assert(! __gen_e_acsl_valid_7,"Assertion","main",
                    "!\\valid(&t[3 .. 5])",
                    "tests/memory/ranges_in_builtins.c",32);
  }
  /*@ assert ¬\valid(&t[3 .. 5]); */ ;
  __gen_e_acsl_g(t,(unsigned long)3);
  __e_acsl_initialize((void *)(t2),sizeof(double));
  t2[0] = 0.5;
  __e_acsl_initialize((void *)(& t2[1]),sizeof(double));
  t2[1] = 1.5;
  {
    int __gen_e_acsl_size_8;
    int __gen_e_acsl_if_8;
    int __gen_e_acsl_initialized;
    __gen_e_acsl_size_8 = 8 * ((1 - 0) + 1);
    if (__gen_e_acsl_size_8 <= 0) __gen_e_acsl_if_8 = 0;
    else __gen_e_acsl_if_8 = __gen_e_acsl_size_8;
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)((char *)(& t2) + 
                                                             8 * 0),
                                                    (size_t)__gen_e_acsl_if_8);
    __e_acsl_assert(__gen_e_acsl_initialized,"Assertion","main",
                    "\\initialized(&t2[0 .. 1])",
                    "tests/memory/ranges_in_builtins.c",38);
  }
  /*@ assert \initialized(&t2[0 .. 1]); */ ;
  {
    int __gen_e_acsl_size_9;
    int __gen_e_acsl_if_9;
    int __gen_e_acsl_initialized_2;
    __gen_e_acsl_size_9 = 8 * ((3 - 2) + 1);
    if (__gen_e_acsl_size_9 <= 0) __gen_e_acsl_if_9 = 0;
    else __gen_e_acsl_if_9 = __gen_e_acsl_size_9;
    __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)((char *)(& t2) + 
                                                               8 * 2),
                                                      (size_t)__gen_e_acsl_if_9);
    __e_acsl_assert(! __gen_e_acsl_initialized_2,"Assertion","main",
                    "!\\initialized(&t2[2 .. 3])",
                    "tests/memory/ranges_in_builtins.c",39);
  }
  /*@ assert ¬\initialized(&t2[2 .. 3]); */ ;
  {
    int __gen_e_acsl_size_10;
    int __gen_e_acsl_if_10;
    int __gen_e_acsl_initialized_3;
    __gen_e_acsl_size_10 = 1 * ((9 - 0) + 1);
    if (__gen_e_acsl_size_10 <= 0) __gen_e_acsl_if_10 = 0;
    else __gen_e_acsl_if_10 = __gen_e_acsl_size_10;
    __gen_e_acsl_initialized_3 = __e_acsl_initialized((void *)(b + 1 * 0),
                                                      (size_t)__gen_e_acsl_if_10);
    __e_acsl_assert(! __gen_e_acsl_initialized_3,"Assertion","main",
                    "!\\initialized(b + (0 .. 9))",
                    "tests/memory/ranges_in_builtins.c",41);
  }
  /*@ assert ¬\initialized(b + (0 .. 9)); */ ;
  free((void *)b);
  int n = 2;
  {
    int __gen_e_acsl_forall;
    int __gen_e_acsl_range_2;
    __gen_e_acsl_forall = 1;
    __gen_e_acsl_range_2 = 0;
    while (1) {
      if (__gen_e_acsl_range_2 <= 1) ; else break;
      {
        int __gen_e_acsl_forall_2;
        long __gen_e_acsl_range;
        __gen_e_acsl_forall_2 = 1;
        __gen_e_acsl_range = n - 1L;
        while (1) {
          if (__gen_e_acsl_range <= n + 2L) ; else break;
          {
            int __gen_e_acsl_initialized_4;
            __gen_e_acsl_initialized_4 = __e_acsl_initialized((void *)(& t3[__gen_e_acsl_range][1][__gen_e_acsl_range_2]),
                                                              sizeof(float));
            if (__gen_e_acsl_initialized_4) ;
            else {
              __gen_e_acsl_forall_2 = 0;
              goto e_acsl_end_loop1;
            }
          }
          __gen_e_acsl_range ++;
        }
        e_acsl_end_loop1: ;
        if (__gen_e_acsl_forall_2) ;
        else {
          __gen_e_acsl_forall = 0;
          goto e_acsl_end_loop2;
        }
      }
      __gen_e_acsl_range_2 ++;
    }
    e_acsl_end_loop2: ;
    __e_acsl_assert(! __gen_e_acsl_forall,"Assertion","main",
                    "!\\initialized(&t3[n - 1 .. n + 2][1][0 .. 1])",
                    "tests/memory/ranges_in_builtins.c",46);
  }
  /*@ assert ¬\initialized(&t3[n - 1 .. n + 2][1][0 .. 1]); */ ;
  {
    int __gen_e_acsl_size_11;
    int __gen_e_acsl_if_11;
    int __gen_e_acsl_valid_read;
    __gen_e_acsl_size_11 = 4 * ((10 - 2) + 1);
    if (__gen_e_acsl_size_11 <= 0) __gen_e_acsl_if_11 = 0;
    else __gen_e_acsl_if_11 = __gen_e_acsl_size_11;
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)((char *)(& t3[6][1][0]) + 
                                                           4 * 2),
                                                  (size_t)__gen_e_acsl_if_11,
                                                  (void *)(& t3[6][1][0]),
                                                  (void *)0);
    __e_acsl_assert(! __gen_e_acsl_valid_read,"Assertion","main",
                    "!\\valid_read(&t3[6][1][0] + (2 .. 10))",
                    "tests/memory/ranges_in_builtins.c",48);
  }
  /*@ assert ¬\valid_read(&t3[6][1][0] + (2 .. 10)); */ ;
  {
    int __gen_e_acsl_forall_3;
    long __gen_e_acsl_range_3;
    __gen_e_acsl_forall_3 = 1;
    __gen_e_acsl_range_3 = n - 1L;
    while (1) {
      if (__gen_e_acsl_range_3 <= n + 2L) ; else break;
      {
        int __gen_e_acsl_valid_read_2;
        __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)(& t3[__gen_e_acsl_range_3][1]),
                                                        sizeof(float [4]),
                                                        (void *)(& t3[__gen_e_acsl_range_3][1]),
                                                        (void *)0);
        if (__gen_e_acsl_valid_read_2) ;
        else {
          __gen_e_acsl_forall_3 = 0;
          goto e_acsl_end_loop3;
        }
      }
      __gen_e_acsl_range_3 ++;
    }
    e_acsl_end_loop3: ;
    __e_acsl_assert(__gen_e_acsl_forall_3,"Assertion","main",
                    "\\valid_read(&t3[n - 1 .. n + 2][1])",
                    "tests/memory/ranges_in_builtins.c",49);
  }
  /*@ assert \valid_read(&t3[n - 1 .. n + 2][1]); */ ;
  {
    int __gen_e_acsl_x;
    int __gen_e_acsl_forall_4;
    int __gen_e_acsl_range_4;
    __gen_e_acsl_x = 5;
    __gen_e_acsl_forall_4 = 1;
    __gen_e_acsl_range_4 = 0;
    while (1) {
      if (__gen_e_acsl_range_4 <= __gen_e_acsl_x) ; else break;
      {
        int __gen_e_acsl_valid_8;
        __gen_e_acsl_valid_8 = __e_acsl_valid((void *)(& t4[4][__gen_e_acsl_range_4][2]),
                                              sizeof(int),
                                              (void *)(& t4[4][__gen_e_acsl_range_4][2]),
                                              (void *)0);
        if (__gen_e_acsl_valid_8) ;
        else {
          __gen_e_acsl_forall_4 = 0;
          goto e_acsl_end_loop4;
        }
      }
      __gen_e_acsl_range_4 ++;
    }
    e_acsl_end_loop4: ;
    __e_acsl_assert(__gen_e_acsl_forall_4,"Assertion","main",
                    "\\let x = 5; \\valid(&t4[4][0 .. x][2])",
                    "tests/memory/ranges_in_builtins.c",52);
  }
  /*@ assert \let x = 5; \valid(&t4[4][0 .. x][2]); */ ;
  __e_acsl_initialize((void *)(& s.a[0]),sizeof(int));
  s.a[0] = 7;
  __e_acsl_initialize((void *)(& s.a[1]),sizeof(int));
  s.a[1] = 8;
  {
    int __gen_e_acsl_size_12;
    int __gen_e_acsl_if_12;
    int __gen_e_acsl_initialized_5;
    __gen_e_acsl_size_12 = 4 * ((1 - 1) + 1);
    if (__gen_e_acsl_size_12 <= 0) __gen_e_acsl_if_12 = 0;
    else __gen_e_acsl_if_12 = __gen_e_acsl_size_12;
    __gen_e_acsl_initialized_5 = __e_acsl_initialized((void *)((char *)(& s.a[0]) + 
                                                               4 * 1),
                                                      (size_t)__gen_e_acsl_if_12);
    __e_acsl_assert(__gen_e_acsl_initialized_5,"Assertion","main",
                    "\\initialized(&s.a[0] + (1 .. 1))",
                    "tests/memory/ranges_in_builtins.c",56);
  }
  /*@ assert \initialized(&s.a[0] + (1 .. 1)); */ ;
  {
    int __gen_e_acsl_size_13;
    int __gen_e_acsl_if_13;
    int __gen_e_acsl_initialized_6;
    __gen_e_acsl_size_13 = 4 * ((1 - 0) + 1);
    if (__gen_e_acsl_size_13 <= 0) __gen_e_acsl_if_13 = 0;
    else __gen_e_acsl_if_13 = __gen_e_acsl_size_13;
    /*@ assert Eva: initialization: \initialized(&s.b); */
    __gen_e_acsl_initialized_6 = __e_acsl_initialized((void *)((char *)s.b + 
                                                               4 * 0),
                                                      (size_t)__gen_e_acsl_if_13);
    __e_acsl_assert(! __gen_e_acsl_initialized_6,"Assertion","main",
                    "!\\initialized(s.b + (0 .. 1))",
                    "tests/memory/ranges_in_builtins.c",57);
  }
  /*@ assert ¬\initialized(s.b + (0 .. 1)); */ ;
  int size1 = 5;
  int size2 = 9;
  __e_acsl_full_init((void *)(& multi_dynamic));
  multi_dynamic = (int **)malloc((unsigned long)size1 * sizeof(*multi_dynamic));
  i = 0;
  while (i < size1) {
    __e_acsl_initialize((void *)(multi_dynamic + i),sizeof(int *));
    *(multi_dynamic + i) = (int *)malloc((unsigned long)size2 * sizeof(*(*(
                                         multi_dynamic + i))));
    i ++;
  }
  {
    int __gen_e_acsl_valid_read_3;
    int __gen_e_acsl_size_14;
    int __gen_e_acsl_if_14;
    int __gen_e_acsl_valid_9;
    __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)(multi_dynamic + 4),
                                                    sizeof(int *),
                                                    (void *)multi_dynamic,
                                                    (void *)(& multi_dynamic));
    __e_acsl_assert(__gen_e_acsl_valid_read_3,"RTE","main",
                    "mem_access: \\valid_read(multi_dynamic + 4)",
                    "tests/memory/ranges_in_builtins.c",66);
    __gen_e_acsl_size_14 = 4 * ((7 - 1) + 1);
    if (__gen_e_acsl_size_14 <= 0) __gen_e_acsl_if_14 = 0;
    else __gen_e_acsl_if_14 = __gen_e_acsl_size_14;
    __gen_e_acsl_valid_9 = __e_acsl_valid((void *)((char *)*(multi_dynamic + 4) + 
                                                   4 * 1),
                                          (size_t)__gen_e_acsl_if_14,
                                          (void *)*(multi_dynamic + 4),
                                          (void *)(multi_dynamic + 4));
    __e_acsl_assert(__gen_e_acsl_valid_9,"Assertion","main",
                    "\\valid(*(multi_dynamic + 4) + (1 .. 7))",
                    "tests/memory/ranges_in_builtins.c",66);
  }
  /*@ assert \valid(*(multi_dynamic + 4) + (1 .. 7)); */ ;
  /*@ assert \valid(*(multi_dynamic + (2 .. 4)) + (1 .. 7)); */ ;
  i --;
  while (i >= 0) {
    free((void *)*(multi_dynamic + i));
    i --;
  }
  free((void *)multi_dynamic);
  char c = (char)'w';
  __e_acsl_store_block((void *)(& c),(size_t)1);
  __e_acsl_full_init((void *)(& c));
  __gen_e_acsl_f(& c,(long)5);
  __retres = 0;
  __e_acsl_delete_block((void *)(& c));
  __e_acsl_delete_block((void *)(& multi_dynamic));
  __e_acsl_delete_block((void *)(& s));
  __e_acsl_delete_block((void *)(t4));
  __e_acsl_delete_block((void *)(t3));
  __e_acsl_delete_block((void *)(t2));
  __e_acsl_delete_block((void *)(t));
  __e_acsl_delete_block((void *)(& b));
  __e_acsl_delete_block((void *)(& a));
  __e_acsl_memory_clean();
  return __retres;
}

/*@ requires \valid(ptr + (0 .. size - 1));
    ensures ¬\valid(\old(ptr) + (0 .. \old(size) + 1));
 */
void __gen_e_acsl_g(long *ptr, size_t size)
{
  __e_acsl_mpz_t __gen_e_acsl_at_2;
  long *__gen_e_acsl_at;
  {
    __e_acsl_mpz_t __gen_e_acsl_size;
    __e_acsl_mpz_t __gen_e_acsl_sizeof;
    __e_acsl_mpz_t __gen_e_acsl_size_2;
    __e_acsl_mpz_t __gen_e_acsl_;
    __e_acsl_mpz_t __gen_e_acsl_sub;
    __e_acsl_mpz_t __gen_e_acsl__2;
    __e_acsl_mpz_t __gen_e_acsl_sub_2;
    __e_acsl_mpz_t __gen_e_acsl_add;
    __e_acsl_mpz_t __gen_e_acsl_mul;
    int __gen_e_acsl_le;
    __e_acsl_mpz_t __gen_e_acsl_if;
    __e_acsl_mpz_t __gen_e_acsl__4;
    int __gen_e_acsl_le_2;
    __e_acsl_mpz_t __gen_e_acsl_size_3;
    int __gen_e_acsl_le_3;
    unsigned long __gen_e_acsl_size_4;
    int __gen_e_acsl_valid;
    __e_acsl_store_block((void *)(& ptr),(size_t)8);
    __gmpz_init_set_si(__gen_e_acsl_sizeof,8L);
    __gmpz_init_set_ui(__gen_e_acsl_size_2,size);
    __gmpz_init_set_si(__gen_e_acsl_,1L);
    __gmpz_init(__gen_e_acsl_sub);
    __gmpz_sub(__gen_e_acsl_sub,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_));
    __gmpz_init_set_si(__gen_e_acsl__2,0L);
    __gmpz_init(__gen_e_acsl_sub_2);
    __gmpz_sub(__gen_e_acsl_sub_2,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__2));
    __gmpz_init(__gen_e_acsl_add);
    __gmpz_add(__gen_e_acsl_add,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_));
    __gmpz_init(__gen_e_acsl_mul);
    __gmpz_mul(__gen_e_acsl_mul,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add));
    __gmpz_init_set(__gen_e_acsl_size,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul));
    __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size),
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl__2));
    if (__gen_e_acsl_le <= 0) {
      __e_acsl_mpz_t __gen_e_acsl__3;
      __gmpz_init_set_si(__gen_e_acsl__3,0L);
      __gmpz_init_set(__gen_e_acsl_if,
                      (__e_acsl_mpz_struct const *)(__gen_e_acsl__3));
      __gmpz_clear(__gen_e_acsl__3);
    }
    else __gmpz_init_set(__gen_e_acsl_if,
                         (__e_acsl_mpz_struct const *)(__gen_e_acsl_size));
    __gmpz_init_set_ui(__gen_e_acsl__4,18446744073709551615UL);
    __gen_e_acsl_le_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_if),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__4));
    __gmpz_init_set(__gen_e_acsl_size_3,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul));
    __gen_e_acsl_le_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_3),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__2));
    __e_acsl_assert(__gen_e_acsl_le_2 <= 0,"RTE","g",
                    "\\valid(ptr + (0 .. size - 1))",
                    "tests/memory/ranges_in_builtins.c",7);
    __gen_e_acsl_size_4 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_if));
    __gen_e_acsl_valid = __e_acsl_valid((void *)((char *)ptr + 8 * 0),
                                        __gen_e_acsl_size_4,(void *)ptr,
                                        (void *)(& ptr));
    __e_acsl_assert(__gen_e_acsl_valid,"Precondition","g",
                    "\\valid(ptr + (0 .. size - 1))",
                    "tests/memory/ranges_in_builtins.c",7);
    __gmpz_clear(__gen_e_acsl_size);
    __gmpz_clear(__gen_e_acsl_sizeof);
    __gmpz_clear(__gen_e_acsl_size_2);
    __gmpz_clear(__gen_e_acsl_);
    __gmpz_clear(__gen_e_acsl_sub);
    __gmpz_clear(__gen_e_acsl__2);
    __gmpz_clear(__gen_e_acsl_sub_2);
    __gmpz_clear(__gen_e_acsl_add);
    __gmpz_clear(__gen_e_acsl_mul);
    __gmpz_clear(__gen_e_acsl_if);
    __gmpz_clear(__gen_e_acsl__4);
    __gmpz_clear(__gen_e_acsl_size_3);
  }
  {
    __e_acsl_mpz_t __gen_e_acsl_size_8;
    __gmpz_init_set_ui(__gen_e_acsl_size_8,size);
    __gmpz_init_set(__gen_e_acsl_at_2,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_8));
    __gmpz_clear(__gen_e_acsl_size_8);
  }
  {
    __e_acsl_mpz_t __gen_e_acsl_size_6;
    __gmpz_init_set_ui(__gen_e_acsl_size_6,size);
    __gmpz_init_set(__gen_e_acsl_at_2,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_6));
    __gmpz_clear(__gen_e_acsl_size_6);
  }
  __gen_e_acsl_at = ptr;
  g(ptr,size);
  {
    __e_acsl_mpz_t __gen_e_acsl_size_5;
    __e_acsl_mpz_t __gen_e_acsl_sizeof_2;
    __e_acsl_mpz_t __gen_e_acsl__6;
    __e_acsl_mpz_t __gen_e_acsl_add_2;
    __e_acsl_mpz_t __gen_e_acsl__7;
    __e_acsl_mpz_t __gen_e_acsl_sub_3;
    __e_acsl_mpz_t __gen_e_acsl_add_3;
    __e_acsl_mpz_t __gen_e_acsl_mul_2;
    int __gen_e_acsl_le_4;
    __e_acsl_mpz_t __gen_e_acsl_if_2;
    __e_acsl_mpz_t __gen_e_acsl__9;
    int __gen_e_acsl_le_5;
    __e_acsl_mpz_t __gen_e_acsl_size_7;
    int __gen_e_acsl_le_6;
    unsigned long __gen_e_acsl_size_9;
    int __gen_e_acsl_valid_2;
    __gmpz_init_set_si(__gen_e_acsl_sizeof_2,8L);
    __gmpz_init_set_si(__gen_e_acsl__6,1L);
    __gmpz_init(__gen_e_acsl_add_2);
    __gmpz_add(__gen_e_acsl_add_2,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_at_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__6));
    __gmpz_init_set_si(__gen_e_acsl__7,0L);
    __gmpz_init(__gen_e_acsl_sub_3);
    __gmpz_sub(__gen_e_acsl_sub_3,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__7));
    __gmpz_init(__gen_e_acsl_add_3);
    __gmpz_add(__gen_e_acsl_add_3,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_3),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__6));
    __gmpz_init(__gen_e_acsl_mul_2);
    __gmpz_mul(__gen_e_acsl_mul_2,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_3));
    __gmpz_init_set(__gen_e_acsl_size_5,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2));
    __gen_e_acsl_le_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_5),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__7));
    if (__gen_e_acsl_le_4 <= 0) {
      __e_acsl_mpz_t __gen_e_acsl__8;
      __gmpz_init_set_si(__gen_e_acsl__8,0L);
      __gmpz_init_set(__gen_e_acsl_if_2,
                      (__e_acsl_mpz_struct const *)(__gen_e_acsl__8));
      __gmpz_clear(__gen_e_acsl__8);
    }
    else __gmpz_init_set(__gen_e_acsl_if_2,
                         (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_5));
    __gmpz_init_set_ui(__gen_e_acsl__9,18446744073709551615UL);
    __gen_e_acsl_le_5 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__9));
    __gmpz_init_set(__gen_e_acsl_size_7,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2));
    __gen_e_acsl_le_6 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_7),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__7));
    __e_acsl_assert(__gen_e_acsl_le_5 <= 0,"RTE","g",
                    "\\valid(\\old(ptr) + (0 .. \\old(size) + 1))",
                    "tests/memory/ranges_in_builtins.c",8);
    __gen_e_acsl_size_9 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2));
    __gen_e_acsl_valid_2 = __e_acsl_valid((void *)((char *)__gen_e_acsl_at + 
                                                   8 * 0),
                                          __gen_e_acsl_size_9,
                                          (void *)__gen_e_acsl_at,
                                          (void *)(& __gen_e_acsl_at));
    __e_acsl_assert(! __gen_e_acsl_valid_2,"Postcondition","g",
                    "!\\valid(\\old(ptr) + (0 .. \\old(size) + 1))",
                    "tests/memory/ranges_in_builtins.c",8);
    __e_acsl_delete_block((void *)(& ptr));
    __gmpz_clear(__gen_e_acsl_size_5);
    __gmpz_clear(__gen_e_acsl_sizeof_2);
    __gmpz_clear(__gen_e_acsl__6);
    __gmpz_clear(__gen_e_acsl_add_2);
    __gmpz_clear(__gen_e_acsl__7);
    __gmpz_clear(__gen_e_acsl_sub_3);
    __gmpz_clear(__gen_e_acsl_add_3);
    __gmpz_clear(__gen_e_acsl_mul_2);
    __gmpz_clear(__gen_e_acsl_if_2);
    __gmpz_clear(__gen_e_acsl__9);
    __gmpz_clear(__gen_e_acsl_size_7);
    __gmpz_clear(__gen_e_acsl_at_2);
    return;
  }
}

/*@ requires ¬\valid(s + (3 .. n + 1000)); */
void __gen_e_acsl_f(char *s, long n)
{
  {
    __e_acsl_mpz_t __gen_e_acsl_size;
    __e_acsl_mpz_t __gen_e_acsl_sizeof;
    __e_acsl_mpz_t __gen_e_acsl_n;
    __e_acsl_mpz_t __gen_e_acsl_;
    __e_acsl_mpz_t __gen_e_acsl_add;
    __e_acsl_mpz_t __gen_e_acsl__2;
    __e_acsl_mpz_t __gen_e_acsl_sub;
    __e_acsl_mpz_t __gen_e_acsl__3;
    __e_acsl_mpz_t __gen_e_acsl_add_2;
    __e_acsl_mpz_t __gen_e_acsl_mul;
    __e_acsl_mpz_t __gen_e_acsl__4;
    int __gen_e_acsl_le;
    __e_acsl_mpz_t __gen_e_acsl_if;
    __e_acsl_mpz_t __gen_e_acsl__6;
    int __gen_e_acsl_le_2;
    __e_acsl_mpz_t __gen_e_acsl_size_2;
    int __gen_e_acsl_le_3;
    unsigned long __gen_e_acsl_size_3;
    int __gen_e_acsl_valid;
    __e_acsl_store_block((void *)(& s),(size_t)8);
    __gmpz_init_set_si(__gen_e_acsl_sizeof,1L);
    __gmpz_init_set_si(__gen_e_acsl_n,n);
    __gmpz_init_set_si(__gen_e_acsl_,1000L);
    __gmpz_init(__gen_e_acsl_add);
    __gmpz_add(__gen_e_acsl_add,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_n),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_));
    __gmpz_init_set_si(__gen_e_acsl__2,3L);
    __gmpz_init(__gen_e_acsl_sub);
    __gmpz_sub(__gen_e_acsl_sub,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__2));
    __gmpz_init_set_si(__gen_e_acsl__3,1L);
    __gmpz_init(__gen_e_acsl_add_2);
    __gmpz_add(__gen_e_acsl_add_2,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__3));
    __gmpz_init(__gen_e_acsl_mul);
    __gmpz_mul(__gen_e_acsl_mul,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2));
    __gmpz_init_set(__gen_e_acsl_size,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul));
    __gmpz_init_set_si(__gen_e_acsl__4,0L);
    __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size),
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl__4));
    if (__gen_e_acsl_le <= 0) {
      __e_acsl_mpz_t __gen_e_acsl__5;
      __gmpz_init_set_si(__gen_e_acsl__5,0L);
      __gmpz_init_set(__gen_e_acsl_if,
                      (__e_acsl_mpz_struct const *)(__gen_e_acsl__5));
      __gmpz_clear(__gen_e_acsl__5);
    }
    else __gmpz_init_set(__gen_e_acsl_if,
                         (__e_acsl_mpz_struct const *)(__gen_e_acsl_size));
    __gmpz_init_set_ui(__gen_e_acsl__6,18446744073709551615UL);
    __gen_e_acsl_le_2 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_if),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__6));
    __gmpz_init_set(__gen_e_acsl_size_2,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul));
    __gen_e_acsl_le_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__4));
    __e_acsl_assert(__gen_e_acsl_le_2 <= 0,"RTE","f",
                    "\\valid(s + (3 .. n + 1000))",
                    "tests/memory/ranges_in_builtins.c",5);
    __gen_e_acsl_size_3 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_if));
    __gen_e_acsl_valid = __e_acsl_valid((void *)(s + 1 * 3),
                                        __gen_e_acsl_size_3,(void *)s,
                                        (void *)(& s));
    __e_acsl_assert(! __gen_e_acsl_valid,"Precondition","f",
                    "!\\valid(s + (3 .. n + 1000))",
                    "tests/memory/ranges_in_builtins.c",5);
    __gmpz_clear(__gen_e_acsl_size);
    __gmpz_clear(__gen_e_acsl_sizeof);
    __gmpz_clear(__gen_e_acsl_n);
    __gmpz_clear(__gen_e_acsl_);
    __gmpz_clear(__gen_e_acsl_add);
    __gmpz_clear(__gen_e_acsl__2);
    __gmpz_clear(__gen_e_acsl_sub);
    __gmpz_clear(__gen_e_acsl__3);
    __gmpz_clear(__gen_e_acsl_add_2);
    __gmpz_clear(__gen_e_acsl_mul);
    __gmpz_clear(__gen_e_acsl__4);
    __gmpz_clear(__gen_e_acsl_if);
    __gmpz_clear(__gen_e_acsl__6);
    __gmpz_clear(__gen_e_acsl_size_2);
  }
  f(s,n);
  __e_acsl_delete_block((void *)(& s));
  return;
}


