/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
char *__gen_e_acsl_literal_string_6;
char *__gen_e_acsl_literal_string_5;
char *__gen_e_acsl_literal_string;
char *__gen_e_acsl_literal_string_4;
char *__gen_e_acsl_literal_string_3;
char *__gen_e_acsl_literal_string_2;
int main(void);

char *T = (char *)"bar";
int G = 0;
void f(void)
{
  {
    int __gen_e_acsl_valid_read;
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(T + G),
                                                  sizeof(char),(void *)T,
                                                  (void *)(& T));
    __e_acsl_assert(__gen_e_acsl_valid_read,"RTE","f",
                    "mem_access: \\valid_read(T + G)",
                    "tests/memory/literal_string.i",11);
    __e_acsl_assert((int)*(T + G) == 98,"Assertion","f","*(T + G) == \'b\'",
                    "tests/memory/literal_string.i",11);
  }
  /*@ assert *(T + G) ≡ 'b'; */ ;
  G ++;
  return;
}

char *S = (char *)"foo";
char *S2 = (char *)"foo2";
int IDX = 1;
int G2 = 2;
char const *s_str = "the cat";
char const *l_str = "the dog and the cat";
char *U = (char *)"baz";
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_6 = "the dog and the cat";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_6,
                         sizeof("the dog and the cat"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_6);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_6);
    __gen_e_acsl_literal_string_5 = "the cat";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_5,
                         sizeof("the cat"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_5);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_5);
    __gen_e_acsl_literal_string = "ss";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("ss"));
    __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_4 = "foo2";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_4,
                         sizeof("foo2"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_4);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_4);
    __gen_e_acsl_literal_string_3 = "foo";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_3,sizeof("foo"));
    __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_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 *)(& l_str),(size_t)8);
    __e_acsl_full_init((void *)(& l_str));
    __e_acsl_store_block((void *)(& s_str),(size_t)8);
    __e_acsl_full_init((void *)(& s_str));
    __e_acsl_store_block((void *)(& S2),(size_t)8);
    __e_acsl_full_init((void *)(& S2));
    __e_acsl_store_block((void *)(& S),(size_t)8);
    __e_acsl_full_init((void *)(& S));
    __e_acsl_store_block((void *)(& T),(size_t)8);
    __e_acsl_full_init((void *)(& T));
  }
  return;
}

void __e_acsl_globals_clean(void)
{
  __e_acsl_delete_block((void *)(& l_str));
  __e_acsl_delete_block((void *)(& s_str));
  __e_acsl_delete_block((void *)(& S2));
  __e_acsl_delete_block((void *)(& S));
  __e_acsl_delete_block((void *)(& T));
}

int main(void)
{
  int __retres;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_globals_init();
  char *SS = (char *)__gen_e_acsl_literal_string;
  __e_acsl_store_block((void *)(& SS),(size_t)8);
  __e_acsl_full_init((void *)(& SS));
  {
    int __gen_e_acsl_valid_read;
    __gen_e_acsl_valid_read = __e_acsl_valid_read((void *)(S + G2),
                                                  sizeof(char),(void *)S,
                                                  (void *)(& S));
    __e_acsl_assert(__gen_e_acsl_valid_read,"RTE","main",
                    "mem_access: \\valid_read(S + G2)",
                    "tests/memory/literal_string.i",25);
    __e_acsl_assert((int)*(S + G2) == 111,"Assertion","main",
                    "*(S + G2) == \'o\'","tests/memory/literal_string.i",25);
  }
  /*@ assert *(S + G2) ≡ 'o'; */ ;
  {
    int __gen_e_acsl_initialized;
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)S,sizeof(char));
    __e_acsl_assert(__gen_e_acsl_initialized,"Assertion","main",
                    "\\initialized(S)","tests/memory/literal_string.i",26);
  }
  /*@ assert \initialized(S); */ ;
  {
    int __gen_e_acsl_valid_read_2;
    __gen_e_acsl_valid_read_2 = __e_acsl_valid_read((void *)S2,sizeof(char),
                                                    (void *)S2,
                                                    (void *)(& S2));
    __e_acsl_assert(__gen_e_acsl_valid_read_2,"Assertion","main",
                    "\\valid_read(S2)","tests/memory/literal_string.i",27);
  }
  /*@ assert \valid_read(S2); */ ;
  {
    int __gen_e_acsl_initialized_2;
    int __gen_e_acsl_and;
    __gen_e_acsl_initialized_2 = __e_acsl_initialized((void *)(& SS),
                                                      sizeof(char *));
    if (__gen_e_acsl_initialized_2) {
      int __gen_e_acsl_valid;
      __gen_e_acsl_valid = __e_acsl_valid((void *)SS,sizeof(char),(void *)SS,
                                          (void *)(& SS));
      __gen_e_acsl_and = __gen_e_acsl_valid;
    }
    else __gen_e_acsl_and = 0;
    __e_acsl_assert(! __gen_e_acsl_and,"Assertion","main","!\\valid(SS)",
                    "tests/memory/literal_string.i",28);
  }
  /*@ assert ¬\valid(SS); */ ;
  f();
  s_str ++;
  l_str ++;
  __retres = 0;
  __e_acsl_delete_block((void *)(& SS));
  __e_acsl_globals_clean();
  __e_acsl_memory_clean();
  return __retres;
}


