void push(int x) {
  Mpush(x);
  return;
}

void analyze_stack() {
  int temp;
  int stack_item;
  int stack_level;
  int tail;
  int value;
  int count;

  writeln();
  printf("execution trace");
  writeln();

  temp = display_(instruction);
  writeln();

  stack_level = stack;
  count = 10;
  while (Mnotnull(stack_level)) {
    stack_item = Mcar(stack);
    if (Mprocp(stack_item)) {
      tail = last(Mcar(stack_item));
      if (Meq(nameatom, Mcar(Mcar(tail)))) {
        value = Mcar(Mcdr(Mcar(tail)));
        if (value != 0) {
          temp = display_(value);
          writeln();
        }
      }
      else {
        temp = Mcar(Mcar(stack_item));
        write_int(temp);
        writeln();
      }
    }
    stack_level = Mcdr(stack_level);
    count = count - 1;
    if (count == 0)
      stack_level = 0; // stop short
  }
  return;
}
