qsym

A symbolic executor for the QBE intermediate language

git clone https://git.8pit.net/qsym.git

 1int first_divisor(unsigned int a) {
 2	unsigned int i;
 3
 4	for (i = 2; i < a; i++) {
 5		if (a % i == 0) {
 6			return i;
 7		}
 8	}
 9
10	return a;
11}
12
13int main(unsigned int a) {
14	if (a <= 10) {
15		if (a > 1 && first_divisor(a) == a) {
16			return 1;
17		} else {
18			return 0;
19		}
20	}
21}