Sir I have read your comment on why you have put the following statements in both if() and else block.
d = c * a; //spilled c taken from memory and replaces x in register.
e = c + a;
I have a doubt on your explanation. Code optimization such as Code motion is done to reduce size of code so that it takes less time to execute. But your code has more LOC than original code. What is the use of such movement of code if it is increasing lines of code.
It is mentioned that all the variables are dead after the given code segment. So why will we print the values of dead variables at the end of the code.
Please clarify my doubts.