Code generation discrepancy

Consider a simple program that constitutes a main function which return an expression.

 int main(){
  char c;
  char *pc;
  int i;
  i=41;
  pc = &c;
  c=1;
 return *pc+i+42;

}

The generated assembly code yield the expected result in Mars in the register $v0. However, when running it with mars.run() it yields another result, I am not sure where could lie the problem.

When you copied the code into MARS, did you include the prelude?