/* Generated by Frama-C */
#include "pthread.h"
#include "sched.h"
#include "signal.h"
#include "stddef.h"
#include "stdint.h"
#include "stdio.h"
#include "time.h"
char *__gen_e_acsl_literal_string;
char *__gen_e_acsl_literal_string_2;
extern  __attribute__((__FC_BUILTIN__)) int __e_acsl_sound_verdict;

/*@ requires valid_filename: valid_read_string(filename);
    requires valid_mode: valid_read_string(mode);
    ensures
      result_null_or_valid_fd:
        \result == \null || \subset(\result, &__fc_fopen[0 .. 16 - 1]);
    assigns \result;
    assigns \result
      \from (indirect: *(filename + (0 .. strlen{Old}(filename)))),
            (indirect: *(mode + (0 .. strlen{Old}(mode)))), __fc_p_fopen;
 */
FILE *__gen_e_acsl_fopen(char const * restrict filename,
                         char const * restrict mode);

/*@ requires valid_ptr_block: \valid((char *)ptr + (0 .. nmemb * size - 1));
    requires valid_stream: \valid(stream);
    ensures size_read: \result <= \old(nmemb);
    ensures
      initialization:
        \initialized((char *)\old(ptr) + (0 .. \result * \old(size) - 1));
    assigns *((char *)ptr + (0 .. nmemb * size - 1)), *stream, \result;
    assigns *((char *)ptr + (0 .. nmemb * size - 1))
      \from (indirect: size), (indirect: nmemb), (indirect: *stream);
    assigns *stream
      \from (indirect: size), (indirect: nmemb), (indirect: *stream);
    assigns \result \from size, (indirect: *stream);
 */
size_t __gen_e_acsl_fread(void * restrict ptr, size_t size, size_t nmemb,
                          FILE * restrict stream);

/*@ requires valid_ptr_block: \valid((char *)ptr + (0 .. nmemb * size - 1));
    requires valid_stream: \valid(stream);
    ensures size_read: \result <= \old(nmemb);
    ensures
      initialization:
        \initialized((char *)\old(ptr) + (0 .. \result * \old(size) - 1));
    assigns *((char *)ptr + (0 .. nmemb * size - 1)), *stream, \result;
    assigns *((char *)ptr + (0 .. nmemb * size - 1))
      \from (indirect: size), (indirect: nmemb), (indirect: *stream);
    assigns *stream
      \from (indirect: size), (indirect: nmemb), (indirect: *stream);
    assigns \result \from size, (indirect: *stream);
 */
size_t __gen_e_acsl_fread(void * restrict ptr, size_t size, size_t nmemb,
                          FILE * restrict stream)
{
  size_t __gen_e_acsl_at_3;
  __e_acsl_mpz_t __gen_e_acsl_at_2;
  void *__gen_e_acsl_at;
  size_t __retres;
  {
    __e_acsl_mpz_t __gen_e_acsl_size;
    __e_acsl_mpz_t __gen_e_acsl_size_2;
    __e_acsl_mpz_t __gen_e_acsl_sizeof;
    __e_acsl_mpz_t __gen_e_acsl_nmemb;
    __e_acsl_mpz_t __gen_e_acsl_size_3;
    __e_acsl_mpz_t __gen_e_acsl_mul;
    __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_2;
    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;
    unsigned long __gen_e_acsl_size_4;
    int __gen_e_acsl_valid;
    int __gen_e_acsl_valid_2;
    __e_acsl_store_block((void *)(& stream),8UL);
    __e_acsl_store_block((void *)(& ptr),8UL);
    __gen_e_acsl_at = ptr;
    __gmpz_init_set_ui(__gen_e_acsl_size,size);
    __gmpz_init_set(__gen_e_acsl_at_2,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_size));
    __gen_e_acsl_at_3 = nmemb;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data = {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data,"ptr",ptr);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"sizeof(char)",0,
                                 1);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,"sizeof(char)",0,
                                 1);
    __gmpz_init_set_si(__gen_e_acsl_sizeof,1L);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,"nmemb",0,
                                   nmemb);
    __gmpz_init_set_ui(__gen_e_acsl_nmemb,nmemb);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,"size",0,size);
    __gmpz_init_set_ui(__gen_e_acsl_size_3,size);
    __gmpz_init(__gen_e_acsl_mul);
    __gmpz_mul(__gen_e_acsl_mul,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_nmemb),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_3));
    __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_mul),
               (__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_2);
    __gmpz_mul(__gen_e_acsl_mul_2,
               (__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_2,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_2));
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data,"size",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2));
    __gen_e_acsl_le = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2),
                                 (__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 {
      __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data,"size",0,
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2));
      __gmpz_init_set(__gen_e_acsl_if,
                      (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_2));
    }
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_2 =
      {.values = (void *)0};
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_2,
                                 "__gen_e_acsl_if",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_if));
    __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));
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data,
                                 "__gen_e_acsl_if",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_if));
    __gen_e_acsl_assert_data_2.blocking = 1;
    __gen_e_acsl_assert_data_2.kind = "RTE";
    __gen_e_acsl_assert_data_2.pred_txt = "(\\let size = sizeof(char) * (((nmemb * size - 1) - 0) + 1);\n size <= 0? 0: size)\n<= 18446744073709551615";
    __gen_e_acsl_assert_data_2.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_2.fct = "fread";
    __gen_e_acsl_assert_data_2.line = 351;
    __gen_e_acsl_assert_data_2.name = "offset_lesser_or_eq_than_SIZE_MAX";
    __e_acsl_assert(__gen_e_acsl_le_2 <= 0,& __gen_e_acsl_assert_data_2);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_2);
    __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 + 1 * 0),
                                        __gen_e_acsl_size_4,ptr,
                                        (void *)(& ptr));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,
                                 "valid_ptr_block: \\valid((char *)ptr + (0 .. nmemb * size - 1))",
                                 0,__gen_e_acsl_valid);
    __gen_e_acsl_assert_data.blocking = 1;
    __gen_e_acsl_assert_data.kind = "Precondition";
    __gen_e_acsl_assert_data.pred_txt = "\\valid((char *)ptr + (0 .. nmemb * size - 1))";
    __gen_e_acsl_assert_data.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data.fct = "fread";
    __gen_e_acsl_assert_data.line = 351;
    __gen_e_acsl_assert_data.name = "valid_ptr_block";
    __e_acsl_assert(__gen_e_acsl_valid,& __gen_e_acsl_assert_data);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_3 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_3,"stream",
                                 (void *)stream);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_3,
                                   "sizeof(FILE)",0,sizeof(FILE));
    __gen_e_acsl_valid_2 = __e_acsl_valid((void *)stream,sizeof(FILE),
                                          (void *)stream,(void *)(& stream));
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_3,
                                 "\\valid(stream)",0,__gen_e_acsl_valid_2);
    __gen_e_acsl_assert_data_3.blocking = 1;
    __gen_e_acsl_assert_data_3.kind = "Precondition";
    __gen_e_acsl_assert_data_3.pred_txt = "\\valid(stream)";
    __gen_e_acsl_assert_data_3.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_3.fct = "fread";
    __gen_e_acsl_assert_data_3.line = 352;
    __gen_e_acsl_assert_data_3.name = "valid_stream";
    __e_acsl_assert(__gen_e_acsl_valid_2,& __gen_e_acsl_assert_data_3);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_3);
    __gmpz_clear(__gen_e_acsl_size);
    __gmpz_clear(__gen_e_acsl_size_2);
    __gmpz_clear(__gen_e_acsl_sizeof);
    __gmpz_clear(__gen_e_acsl_nmemb);
    __gmpz_clear(__gen_e_acsl_size_3);
    __gmpz_clear(__gen_e_acsl_mul);
    __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_2);
    __gmpz_clear(__gen_e_acsl_if);
    __gmpz_clear(__gen_e_acsl__4);
  }
  __retres = fread(ptr,size,nmemb,stream);
  {
    __e_acsl_mpz_t __gen_e_acsl___retres;
    __e_acsl_mpz_t __gen_e_acsl_size_5;
    __e_acsl_mpz_t __gen_e_acsl_mul_3;
    __e_acsl_mpz_t __gen_e_acsl__5;
    int __gen_e_acsl_le_3;
    unsigned long __gen_e_acsl_size_6;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_4 =
      {.values = (void *)0};
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,"__retres",0,
                                   __retres);
    __gmpz_init_set_ui(__gen_e_acsl___retres,__retres);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_4,"size",0,
                                   size);
    __gmpz_init_set_ui(__gen_e_acsl_size_5,size);
    __gmpz_init(__gen_e_acsl_mul_3);
    __gmpz_mul(__gen_e_acsl_mul_3,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl___retres),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_5));
    __gmpz_init_set_ui(__gen_e_acsl__5,18446744073709551615UL);
    __gen_e_acsl_le_3 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_3),
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl__5));
    __gen_e_acsl_assert_data_4.blocking = 1;
    __gen_e_acsl_assert_data_4.kind = "RTE";
    __gen_e_acsl_assert_data_4.pred_txt = "__retres * size <= 18446744073709551615";
    __gen_e_acsl_assert_data_4.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_4.fct = "fread";
    __gen_e_acsl_assert_data_4.line = 350;
    __gen_e_acsl_assert_data_4.name = "size_lesser_or_eq_than_SIZE_MAX";
    __e_acsl_assert(__gen_e_acsl_le_3 <= 0,& __gen_e_acsl_assert_data_4);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_4);
    __gen_e_acsl_size_6 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_3));
    __e_acsl_initialize(ptr,__gen_e_acsl_size_6);
    __gmpz_clear(__gen_e_acsl___retres);
    __gmpz_clear(__gen_e_acsl_size_5);
    __gmpz_clear(__gen_e_acsl_mul_3);
    __gmpz_clear(__gen_e_acsl__5);
  }
  {
    __e_acsl_mpz_t __gen_e_acsl_size_7;
    __e_acsl_mpz_t __gen_e_acsl_sizeof_2;
    __e_acsl_mpz_t __gen_e_acsl_result;
    __e_acsl_mpz_t __gen_e_acsl_mul_4;
    __e_acsl_mpz_t __gen_e_acsl__6;
    __e_acsl_mpz_t __gen_e_acsl_sub_3;
    __e_acsl_mpz_t __gen_e_acsl__7;
    __e_acsl_mpz_t __gen_e_acsl_sub_4;
    __e_acsl_mpz_t __gen_e_acsl_add_2;
    __e_acsl_mpz_t __gen_e_acsl_mul_5;
    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;
    unsigned long __gen_e_acsl_size_8;
    int __gen_e_acsl_initialized;
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_5 =
      {.values = (void *)0};
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_5,"\\result",0,
                                   __retres);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_5,
                                   "\\old(nmemb)",0,__gen_e_acsl_at_3);
    __gen_e_acsl_assert_data_5.blocking = 1;
    __gen_e_acsl_assert_data_5.kind = "Postcondition";
    __gen_e_acsl_assert_data_5.pred_txt = "\\result <= \\old(nmemb)";
    __gen_e_acsl_assert_data_5.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_5.fct = "fread";
    __gen_e_acsl_assert_data_5.line = 356;
    __gen_e_acsl_assert_data_5.name = "size_read";
    __e_acsl_assert(__retres <= __gen_e_acsl_at_3,
                    & __gen_e_acsl_assert_data_5);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_5);
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_6 =
      {.values = (void *)0};
    __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data_6,"\\old(ptr)",
                                 __gen_e_acsl_at);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_6,"sizeof(char)",
                                 0,1);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_6,"sizeof(char)",
                                 0,1);
    __gmpz_init_set_si(__gen_e_acsl_sizeof_2,1L);
    __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data_6,"\\result",0,
                                   __retres);
    __gmpz_init_set_ui(__gen_e_acsl_result,__retres);
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_6,"\\old(size)",
                                 0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_at_2));
    __gmpz_init(__gen_e_acsl_mul_4);
    __gmpz_mul(__gen_e_acsl_mul_4,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_result),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_at_2));
    __gmpz_init_set_si(__gen_e_acsl__6,1L);
    __gmpz_init(__gen_e_acsl_sub_3);
    __gmpz_sub(__gen_e_acsl_sub_3,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_4),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__6));
    __gmpz_init_set_si(__gen_e_acsl__7,0L);
    __gmpz_init(__gen_e_acsl_sub_4);
    __gmpz_sub(__gen_e_acsl_sub_4,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_3),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__7));
    __gmpz_init(__gen_e_acsl_add_2);
    __gmpz_add(__gen_e_acsl_add_2,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sub_4),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl__6));
    __gmpz_init(__gen_e_acsl_mul_5);
    __gmpz_mul(__gen_e_acsl_mul_5,
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_sizeof_2),
               (__e_acsl_mpz_struct const *)(__gen_e_acsl_add_2));
    __gmpz_init_set(__gen_e_acsl_size_7,
                    (__e_acsl_mpz_struct const *)(__gen_e_acsl_mul_5));
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_6,"size",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_7));
    __gen_e_acsl_le_4 = __gmpz_cmp((__e_acsl_mpz_struct const *)(__gen_e_acsl_size_7),
                                   (__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 {
      __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_6,"size",0,
                                   (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_7));
      __gmpz_init_set(__gen_e_acsl_if_2,
                      (__e_acsl_mpz_struct const *)(__gen_e_acsl_size_7));
    }
    __e_acsl_assert_data_t __gen_e_acsl_assert_data_7 =
      {.values = (void *)0};
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_7,
                                 "__gen_e_acsl_if_2",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2));
    __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));
    __e_acsl_assert_register_mpz(& __gen_e_acsl_assert_data_6,
                                 "__gen_e_acsl_if_2",0,
                                 (__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2));
    __gen_e_acsl_assert_data_7.blocking = 1;
    __gen_e_acsl_assert_data_7.kind = "RTE";
    __gen_e_acsl_assert_data_7.pred_txt = "(\\let size = sizeof(char) * (((\\result * \\old(size) - 1) - 0) + 1);\n size <= 0? 0: size)\n<= 18446744073709551615";
    __gen_e_acsl_assert_data_7.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_7.fct = "fread";
    __gen_e_acsl_assert_data_7.line = 357;
    __gen_e_acsl_assert_data_7.name = "offset_lesser_or_eq_than_SIZE_MAX";
    __e_acsl_assert(__gen_e_acsl_le_5 <= 0,& __gen_e_acsl_assert_data_7);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_7);
    __gen_e_acsl_size_8 = __gmpz_get_ui((__e_acsl_mpz_struct const *)(__gen_e_acsl_if_2));
    __gen_e_acsl_initialized = __e_acsl_initialized((void *)((char *)__gen_e_acsl_at + 
                                                             1 * 0),
                                                    __gen_e_acsl_size_8);
    __e_acsl_assert_register_int(& __gen_e_acsl_assert_data_6,
                                 "initialization:\n  \\initialized((char *)\\old(ptr) + (0 .. \\result * \\old(size) - 1))",
                                 0,__gen_e_acsl_initialized);
    __gen_e_acsl_assert_data_6.blocking = 1;
    __gen_e_acsl_assert_data_6.kind = "Postcondition";
    __gen_e_acsl_assert_data_6.pred_txt = "\\initialized((char *)\\old(ptr) + (0 .. \\result * \\old(size) - 1))";
    __gen_e_acsl_assert_data_6.file = "FRAMAC_SHARE/libc/stdio.h";
    __gen_e_acsl_assert_data_6.fct = "fread";
    __gen_e_acsl_assert_data_6.line = 357;
    __gen_e_acsl_assert_data_6.name = "initialization";
    __e_acsl_assert(__gen_e_acsl_initialized,& __gen_e_acsl_assert_data_6);
    __e_acsl_assert_clean(& __gen_e_acsl_assert_data_6);
    __e_acsl_delete_block((void *)(& stream));
    __e_acsl_delete_block((void *)(& ptr));
    __gmpz_clear(__gen_e_acsl_size_7);
    __gmpz_clear(__gen_e_acsl_sizeof_2);
    __gmpz_clear(__gen_e_acsl_result);
    __gmpz_clear(__gen_e_acsl_mul_4);
    __gmpz_clear(__gen_e_acsl__6);
    __gmpz_clear(__gen_e_acsl_sub_3);
    __gmpz_clear(__gen_e_acsl__7);
    __gmpz_clear(__gen_e_acsl_sub_4);
    __gmpz_clear(__gen_e_acsl_add_2);
    __gmpz_clear(__gen_e_acsl_mul_5);
    __gmpz_clear(__gen_e_acsl_if_2);
    __gmpz_clear(__gen_e_acsl__9);
    __gmpz_clear(__gen_e_acsl_at_2);
    return __retres;
  }
}

/*@ requires valid_filename: valid_read_string(filename);
    requires valid_mode: valid_read_string(mode);
    ensures
      result_null_or_valid_fd:
        \result == \null || \subset(\result, &__fc_fopen[0 .. 16 - 1]);
    assigns \result;
    assigns \result
      \from (indirect: *(filename + (0 .. strlen{Old}(filename)))),
            (indirect: *(mode + (0 .. strlen{Old}(mode)))), __fc_p_fopen;
 */
FILE *__gen_e_acsl_fopen(char const * restrict filename,
                         char const * restrict mode)
{
  FILE *__retres;
  __e_acsl_store_block((void *)(& __retres),8UL);
  __retres = fopen(filename,mode);
  __e_acsl_delete_block((void *)(& __retres));
  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 = "r";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string,sizeof("r"));
    __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 = "/dev/urandom";
    __e_acsl_store_block((void *)__gen_e_acsl_literal_string_2,
                         sizeof("/dev/urandom"));
    __e_acsl_full_init((void *)__gen_e_acsl_literal_string_2);
    __e_acsl_mark_readonly((void *)__gen_e_acsl_literal_string_2);
  }
  return;
}

int main(void)
{
  int __retres;
  char buf[4];
  __e_acsl_memory_init((int *)0,(char ***)0,8UL);
  __e_acsl_globals_init();
  FILE *f =
    __gen_e_acsl_fopen(__gen_e_acsl_literal_string_2,
                       __gen_e_acsl_literal_string);
  __e_acsl_store_block((void *)(& f),8UL);
  __e_acsl_full_init((void *)(& f));
  if (f) {
    char buf_0[4];
    size_t tmp_0;
    __e_acsl_store_block((void *)(buf_0),4UL);
    tmp_0 = __gen_e_acsl_fread((void *)(buf_0),(size_t)1,(size_t)4,f);
    int res = (int)tmp_0;
    if (res == 4) {
      {
        int __gen_e_acsl_initialized;
        __e_acsl_assert_data_t __gen_e_acsl_assert_data =
          {.values = (void *)0};
        __e_acsl_assert_register_ptr(& __gen_e_acsl_assert_data,"&buf_0[3]",
                                     (void *)(& buf_0[3]));
        __e_acsl_assert_register_ulong(& __gen_e_acsl_assert_data,
                                       "sizeof(char)",0,sizeof(char));
        __gen_e_acsl_initialized = __e_acsl_initialized((void *)(& buf_0[3]),
                                                        sizeof(char));
        __e_acsl_assert_register_int(& __gen_e_acsl_assert_data,
                                     "\\initialized(&buf_0[3])",0,
                                     __gen_e_acsl_initialized);
        __gen_e_acsl_assert_data.blocking = 1;
        __gen_e_acsl_assert_data.kind = "Assertion";
        __gen_e_acsl_assert_data.pred_txt = "\\initialized(&buf_0[3])";
        __gen_e_acsl_assert_data.file = "issue-eacsl-40.c";
        __gen_e_acsl_assert_data.fct = "main";
        __gen_e_acsl_assert_data.line = 15;
        __e_acsl_assert(__gen_e_acsl_initialized,& __gen_e_acsl_assert_data);
        __e_acsl_assert_clean(& __gen_e_acsl_assert_data);
      }
      /*@ assert \initialized(&buf_0[3]); */ ;
      __e_acsl_initialize((void *)(buf_0),sizeof(char));
      buf_0[0] = buf_0[3];
    }
    else {
      __retres = 2;
      __e_acsl_delete_block((void *)(buf_0));
      goto return_label;
    }
    __e_acsl_delete_block((void *)(buf_0));
  }
  else {
    __retres = 1;
    goto return_label;
  }
  __retres = 0;
  return_label:
  {
    __e_acsl_delete_block((void *)(& f));
    __e_acsl_memory_clean();
    return __retres;
  }
}


