
main() {

  puts("calling function");
  test(4);
  puts("function has returned");
  return 0;
  puts("ERROR - this line comes AFTER main() has returned");
}

test(int val) {
  if (val > 1) {
   if (val > 2) {
    if (val > 3) {
      puts("about to return from function");
      return 77;
      puts("ERROR!");
    }
   }
  }
}