/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
char *__gen_e_acsl_literal_string_3;
char *__gen_e_acsl_literal_string;
char *__gen_e_acsl_literal_string_2;
char *S = (char *)"foo";
int f(void)
{
  int __retres;
  char *s1 = (char *)__gen_e_acsl_literal_string;
  __e_acsl_store_block((void *)(& s1),(size_t)8);
  __e_acsl_full_init((void *)(& s1));
  char *s2 = (char *)__gen_e_acsl_literal_string_2;
  __e_acsl_store_block((void *)(& s2),(size_t)8);
  __e_acsl_full_init((void *)(& s2));
  {
    int __gen_e_acsl_valid_read;
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)S,sizeof(char),
                                                  (void *)S,(void *)(& S));
    __e_acsl_assert(__gen_e_acsl_valid_read,"Assertion","f",
                    "\\valid_read(S)","tests/bts/bts1837.i",10);
  }
  /*@ assert \valid_read(S); */ ;
  {
    int __gen_e_acsl_initialized;
    int __gen_e_acsl_and;
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& s1),
                                                    sizeof(char *));
    if (__gen_e_acsl_initialized) {
      int __gen_e_acsl_valid_read_2;
      __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)s1,
                                                      sizeof(char),
                                                      (void *)s1,
                                                      (void *)(& s1));
      __gen_e_acsl_and = __gen_e_acsl_valid_read_2;
    }
    else __gen_e_acsl_and = 0;
    __e_acsl_assert(__gen_e_acsl_and,"Assertion","f","\\valid_read(s1)",
                    "tests/bts/bts1837.i",11);
  }
  /*@ assert \valid_read(s1); */ ;
  {
    int __gen_e_acsl_initialized_2;
    int __gen_e_acsl_and_2;
    __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& s2),
                                                      sizeof(char *));
    if (__gen_e_acsl_initialized_2) {
      int __gen_e_acsl_valid_read_3;
      __gen_e_acsl_valid_read_3 = __e_acsl_valid_read((void *)s2,
                                                      sizeof(char),
                                                      (void *)s2,
                                                      (void *)(& s2));
      __gen_e_acsl_and_2 = __gen_e_acsl_valid_read_3;
    }
    else __gen_e_acsl_and_2 = 0;
    __e_acsl_assert(__gen_e_acsl_and_2,"Assertion","f","\\valid_read(s2)",
                    "tests/bts/bts1837.i",12);
  }
  /*@ assert \valid_read(s2); */ ;
  __retres = 0;
  __e_acsl_delete_block((void *)(& s2));
  __e_acsl_delete_block((void *)(& s1));
  return __retres;
}

void __e_acsl_globals_init(void)
{
  static char __e_acsl_already_run = 0;
  if (! __e_acsl_already_run) {
    __e_acsl_already_run = 1;
    __gen_e_acsl_literal_string_3 = "toto";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,
                         sizeof("toto"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_3);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_3);
    __gen_e_acsl_literal_string = "foo";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("foo"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string);
    __gen_e_acsl_literal_string_2 = "bar";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,sizeof("bar"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2);
    __e_acsl_store_block((void *)(& S),(size_t)8);
    __e_acsl_full_init((void *)(& S));
  }
  return;
}

void __e_acsl_globals_clean(void)
{
  __e_acsl_delete_block((void *)(& S));
}

int main(void)
{
  int __retres;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_globals_init();
  int i = 4;
  while (1) {
    int tmp;
    tmp = i;
    /*@ assert Eva: signed_overflow: -2147483648 ≤ i - 1; */
    i --;
    ;
    if (! tmp) break;
    {
      char *s = (char *)__gen_e_acsl_literal_string_3;
      __e_acsl_store_block((void *)(& s),(size_t)8);
      __e_acsl_full_init((void *)(& s));
      {
        int __gen_e_acsl_initialized;
        int __gen_e_acsl_and;
        __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& s),
                                                        sizeof(char *));
        if (__gen_e_acsl_initialized) {
          int __gen_e_acsl_valid_read;
          __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)s,
                                                        sizeof(char),
                                                        (void *)s,
                                                        (void *)(& s));
          __gen_e_acsl_and = __gen_e_acsl_valid_read;
        }
        else __gen_e_acsl_and = 0;
        __e_acsl_assert(__gen_e_acsl_and,"Assertion","main",
                        "\\valid_read(s)","tests/bts/bts1837.i",20);
      }
      /*@ assert \valid_read(s); */ ;
      {
        int __gen_e_acsl_initialized_2;
        int __gen_e_acsl_and_2;
        __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& s),
                                                          sizeof(char *));
        if (__gen_e_acsl_initialized_2) {
          int __gen_e_acsl_valid;
          __gen_e_acsl_valid = __e_acsl_valid((void *)s,sizeof(char),
                                              (void *)s,(void *)(& s));
          __gen_e_acsl_and_2 = __gen_e_acsl_valid;
        }
        else __gen_e_acsl_and_2 = 0;
        __e_acsl_assert(! __gen_e_acsl_and_2,"Assertion","main",
                        "!\\valid(s)","tests/bts/bts1837.i",21);
      }
      /*@ assert ¬\valid(s); */ ;
      __e_acsl_delete_block((void *)(& s));
    }
  }
  f();
  __retres = 0;
  __e_acsl_globals_clean();
  __e_acsl_memory_clean();
  return __retres;
}


