(a) int main(){
int i, j, k;
k = 5;
i = (k + 5) * (k + 5);
j = k + 5;
printf(“%d %d %d”, i, j, k);
}
(b) int main(){
int i, j, k;
for(i = 0; i < 4; i++){
j = 9;
k = i + 4;
}
}
(c) int main(){
int i, j, k;
for(i = 0; i < 4; i++){
j = 9;
k = i + 4;
printf(“%d %d %d”, i, j, k);
}
}
i = 0;
LOOP: i = i + 1;
… …
if(i < 10) goto LOOP;
into:
i = 0;
LOOP: i = 1;
… …
if(1 < 10) goto LOOP;
What is wrong, if any, with this optimization? What is the basic problem?1: SUB 4 2 T1
2: DIV T1 2 T2
3: MUL a T2 T3
4: MUL T3 T1 T4
5: ADD T4 b T5
6: MUL T3 T1 T6
7: ADD T6 b T7
8: MUL T5 T7 c
18.189.180.43