[kernel] Parsing share/libc/__fc_builtin_for_normalization.i (no preprocessing)
[kernel] Parsing tests/scope/bts383.c (with preprocessing)
[value] Analyzing a complete application starting at main
[value] Computing initial state
[value] Initial state computed
[value] Values of globals at initialization
  v ∈ {0}
tests/scope/bts383.c:56:[kernel] warning: out of bounds read. assert \valid_read(p+1);
tests/scope/bts383.c:57:[kernel] warning: out of bounds read. assert \valid_read(p+1);
[value] computing for function if1 <- main.
        Called from tests/scope/bts383.c:58.
tests/scope/bts383.c:10:[kernel] warning: out of bounds read. assert \valid_read(p);
tests/scope/bts383.c:11:[kernel] warning: out of bounds read. assert \valid_read(p);
[value] Recording results for if1
[value] Done for function if1
[value] computing for function if2 <- main.
        Called from tests/scope/bts383.c:59.
tests/scope/bts383.c:15:[kernel] warning: out of bounds read. assert \valid_read(p);
tests/scope/bts383.c:16:[kernel] warning: out of bounds read. assert \valid_read(p);
[value] Recording results for if2
[value] Done for function if2
[value] computing for function loop1 <- main.
        Called from tests/scope/bts383.c:60.
tests/scope/bts383.c:20:[kernel] warning: out of bounds read. assert \valid_read(p);
tests/scope/bts383.c:21:[value] entering loop for the first time
tests/scope/bts383.c:22:[kernel] warning: out of bounds read. assert \valid_read(p);
[value] Recording results for loop1
[value] Done for function loop1
[value] computing for function loop2 <- main.
        Called from tests/scope/bts383.c:61.
tests/scope/bts383.c:27:[value] entering loop for the first time
tests/scope/bts383.c:28:[kernel] warning: out of bounds read. assert \valid_read(p);
tests/scope/bts383.c:30:[kernel] warning: out of bounds read. assert \valid_read(p);
[value] Recording results for loop2
[value] Done for function loop2
[value] computing for function out_string <- main.
        Called from tests/scope/bts383.c:62.
tests/scope/bts383.c:35:[value] entering loop for the first time
tests/scope/bts383.c:35:[kernel] warning: out of bounds read. assert \valid_read(value);
tests/scope/bts383.c:36:[kernel] warning: out of bounds read. assert \valid_read(value);
[value] computing for function out_char <- out_string <- main.
        Called from tests/scope/bts383.c:36.
tests/scope/bts383.c:36:[kernel] warning: Neither code nor specification for function out_char, generating default assigns from the prototype
[value] using specification for function out_char
[value] Done for function out_char
[value] computing for function out_char <- out_string <- main.
        Called from tests/scope/bts383.c:36.
[value] Done for function out_char
[value] computing for function out_char <- out_string <- main.
        Called from tests/scope/bts383.c:36.
[value] Done for function out_char
[value] computing for function out_char <- out_string <- main.
        Called from tests/scope/bts383.c:36.
[value] Done for function out_char
[value] Recording results for out_string
[value] Done for function out_string
[value] computing for function fstruct <- main.
        Called from tests/scope/bts383.c:63.
tests/scope/bts383.c:41:[kernel] warning: out of bounds write. assert \valid(&ps->a);
tests/scope/bts383.c:42:[kernel] warning: out of bounds write. assert \valid(&ps->b);
tests/scope/bts383.c:43:[kernel] warning: out of bounds write. assert \valid(&ps->a);
tests/scope/bts383.c:43:[kernel] warning: out of bounds read. assert \valid_read(&ps->b);
tests/scope/bts383.c:44:[kernel] warning: out of bounds write. assert \valid(&ps->b);
tests/scope/bts383.c:44:[kernel] warning: out of bounds read. assert \valid_read(&ps->a);
tests/scope/bts383.c:45:[kernel] warning: out of bounds read. assert \valid_read(&ps->a);
tests/scope/bts383.c:45:[kernel] warning: out of bounds read. assert \valid_read(&ps->b);
tests/scope/bts383.c:47:[kernel] warning: out of bounds write. assert \valid(&ps->a);
tests/scope/bts383.c:48:[kernel] warning: out of bounds write. assert \valid(&ps->b);
tests/scope/bts383.c:49:[kernel] warning: out of bounds write. assert \valid(&ps->a);
tests/scope/bts383.c:49:[kernel] warning: out of bounds read. assert \valid_read(&ps->b);
tests/scope/bts383.c:50:[kernel] warning: out of bounds write. assert \valid(&ps->b);
tests/scope/bts383.c:50:[kernel] warning: out of bounds read. assert \valid_read(&ps->a);
tests/scope/bts383.c:51:[kernel] warning: out of bounds read. assert \valid_read(&ps->a);
tests/scope/bts383.c:51:[kernel] warning: out of bounds read. assert \valid_read(&ps->b);
[value] Recording results for fstruct
[value] Done for function fstruct
tests/scope/bts383.c:63:[kernel] warning: signed overflow. assert x+tmp ≤ 2147483647;
                                   (tmp from fstruct(ps + 1))
[value] Recording results for main
[value] done for function main
[scope:rm_asserts] removing 12 assertion(s)
[value] ====== VALUES COMPUTED ======
[value] Values at end of function fstruct:
  ps ∈ {{ &S_ps[2] }}
  x ∈ {20}
  S_ps[0] ∈ [--..--]
      [1..2]{.a; .b} ∈ {5}
[value] Values at end of function if1:
  v ∈ [--..--]
[value] Values at end of function if2:
  v ∈ [--..--]
  __retres ∈ [--..--]
[value] Values at end of function loop1:
  v ∈ [--..--]
  i ∈ [0..2147483647]
  n ∈ [--..--]
[value] Values at end of function loop2:
  v ∈ [--..--]
  i ∈ [0..2147483647]
  __retres ∈ [--..--]
[value] Values at end of function out_string:
  value ∈ {{ &S_p + {4; 5; 6; 7; 8; 9; 10; 11} }}
[value] Values at end of function main:
  v ∈ [--..--]
  x ∈ [-2147483628..2147483647]
  S_ps[0] ∈ [--..--]
      [1..2]{.a; .b} ∈ {5}
/* Generated by Frama-C */
struct __anonstruct_Tstruct_1 {
   int a ;
   int b ;
};
typedef struct __anonstruct_Tstruct_1 Tstruct;
int v;
void if1(int *p)
{
  /*@ assert Value: mem_access: \valid_read(p); */
  if (*p > 0) 
    /*@ assert Value: mem_access: \valid_read(p); */
    v = *p;
  return;
}

int if2(int c, int *p)
{
  int __retres;
  if (c) 
    /*@ assert Value: mem_access: \valid_read(p); */
    v = *p;
  /*@ assert Value: mem_access: \valid_read(p); */
  __retres = *p;
  return __retres;
}

void loop1(int *p)
{
  int i;
  int n;
  /*@ assert Value: mem_access: \valid_read(p); */
  n = *p;
  i = 0;
  while (i < n) {
    /*@ assert Value: mem_access: \valid_read(p); */
    v = *p;
    i ++;
  }
  return;
}

int loop2(int n, int *p)
{
  int __retres;
  int i;
  i = 0;
  while (i < n) {
    /*@ assert Value: mem_access: \valid_read(p); */
    v = *p;
    i ++;
  }
  /*@ assert Value: mem_access: \valid_read(p); */
  __retres = *p;
  return __retres;
}

/*@ assigns \nothing; */
extern void out_char(char c);

void out_string(char const *value)
{
  while (1) {
    /*@ assert Value: mem_access: \valid_read(value); */
    if (! *value) break;
    /*@ assert Value: mem_access: \valid_read(value); */
    out_char(*value);
    value ++;
  }
  return;
}

int fstruct(Tstruct *ps)
{
  int x;
  /*@ assert Value: mem_access: \valid(&ps->a); */
  ps->a = 3;
  /*@ assert Value: mem_access: \valid(&ps->b); */
  ps->b = 5;
  /*@ assert Value: mem_access: \valid(&ps->a); */
  /*@ assert Value: mem_access: \valid_read(&ps->b); */
  ps->a = ps->b;
  /*@ assert Value: mem_access: \valid(&ps->b); */
  /*@ assert Value: mem_access: \valid_read(&ps->a); */
  ps->b = ps->a;
  /*@ assert Value: mem_access: \valid_read(&ps->a); */
  /*@ assert Value: mem_access: \valid_read(&ps->b); */
  x = ps->a + ps->b;
  ps ++;
  /*@ assert Value: mem_access: \valid(&ps->a); */
  ps->a = 3;
  /*@ assert Value: mem_access: \valid(&ps->b); */
  ps->b = 5;
  /*@ assert Value: mem_access: \valid(&ps->a); */
  /*@ assert Value: mem_access: \valid_read(&ps->b); */
  ps->a = ps->b;
  /*@ assert Value: mem_access: \valid(&ps->b); */
  /*@ assert Value: mem_access: \valid_read(&ps->a); */
  ps->b = ps->a;
  /*@ assert Value: mem_access: \valid_read(&ps->a); */
  /*@ assert Value: mem_access: \valid_read(&ps->b); */
  x += ps->a + ps->b;
  return x;
}

int main(int *p, Tstruct *ps)
{
  int x;
  int tmp;
  /*@ assert Value: mem_access: \valid_read(p+1); */
  x = *(p + 1);
  /*@ assert Value: mem_access: \valid_read(p+1); */
  v = *(p + 1);
  if1(p + 1);
  if2(x,p + 1);
  loop1(p + 1);
  loop2(x,p + 1);
  out_string((char const *)(p + 1));
  { /* sequence */
    tmp = fstruct(ps + 1);
    /*@ assert Value: signed_overflow: x+tmp ≤ 2147483647; */
    x += tmp;
  }
  return x;
}


