svcomp_aviad_true-alloca.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:15.0
disk size 504 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
#include <stdlib.h>

extern int __VERIFIER_nondet_int(void);

int f(int a) {
    int* a_ref = alloca(sizeof(int));
    int* tmp = alloca(sizeof(int));
    int* count = alloca(sizeof(int));
    *a_ref = a;
    *tmp = 0;
    *count = 0;
    while (*a_ref > 1) {
        *tmp = *a_ref % 2;
        if (*tmp == 0) *a_ref = *a_ref / 2;
        else *a_ref = *a_ref - 1;
        (*count)++;
    }
    return *count;
}

int main() {
    int x = __VERIFIER_nondet_int();
    int count = f(x);
    return count;
}
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark