/********************************************************************
 *   This C program was generated by spl2c, the Shakespeare to C    *
 *          converter by Jon slund and Karl Hasselstrm.           *
 ********************************************************************/

/* libspl definitions and function prototypes */
#include <spl.h>

int main(void)
{
  /******************************************************************
   * MUCH ADO ABOUT HACKING                                         *
   ******************************************************************/
  
  CHARACTER *benedick;                    /* a budding young hacker */
  CHARACTER *beatrice;                    /* a veteran exploiter */
  CHARACTER *don_pedro;                   /* a good friend of the others */
  CHARACTER *don_john;                    /* he is just kinda there */
  CHARACTER *achilles;                    /* I thought he was from Greece */
  CHARACTER *cleopatra;                   /* now this is just getting ridiculous */
  
  int comp1, comp2;
  
  global_initialize();
  
  benedick = initialize_character("Benedick");
  beatrice = initialize_character("Beatrice");
  don_pedro = initialize_character("Don Pedro");
  don_john = initialize_character("Don John");
  achilles = initialize_character("Achilles");
  cleopatra = initialize_character("Cleopatra");
  
  act_i:                                  /* Also the last act */
  
  act_i_scene_i:                          /* Benedick learns his place */
  
  enter_scene(15, beatrice);//beatrice->on_stage=1;num_on_stage=1;
  enter_scene(15, don_john);//don_john->on_stage=1;num_on_stage=2;
  
  activate_character(20, beatrice);//first_person=beatrice;second_person=don_john;
  assign(18, second_person, 0);//don_john->value=0;
  
  exit_scene(20, don_john);//don_john->on_stage=0;num_on_stage=1;
  
  enter_scene(21, don_pedro);//don_pedro->on_stage=1;num_on_stage=2;
  
  activate_character(26, beatrice);//first_person=beatrice;second_person=don_pedro;
  assign(24, second_person, 0);//don_pedro->value=0;
  
  exit_scene(26, don_pedro);//don_pedro->on_stage=0;num_on_stage=1;
  
  enter_scene(27, achilles);//achilles->on_stage=1;num_on_stage=2;
  
  activate_character(32, beatrice);//first_person=beatrice;second_person=achilles;
  assign(30, second_person, 2*2*2*2*2*1);//achilles->value=32;
  
  exit_scene(32, achilles);//achilles->on_stage=0;num_on_stage=1;
  
  enter_scene(33, cleopatra);//cleopatra->on_stage=1;num_on_stage=2;
  
  activate_character(38, beatrice);//first_person=beatrice;second_person=cleopatra;
  assign(36, second_person, int_sub(36, 2*2*2*2*2*2*2*1, achilles->value));//cleopatra->value=96;
  
  exit_scene(38, cleopatra);//cleopatra->on_stage=0;num_on_stage=1;
  
  enter_scene(39, benedick);//benedick->on_stage=1;num_on_stage=2;
  
  activate_character(44, beatrice);//first_person=beatrice;second_person=benedick;
  assign(42, second_person, 0);//benedick->value=0;
  
  act_i_scene_ii:                         /* Benedick strengthens his memory */
  
  activate_character(49, beatrice);//first_person=beatrice;second_person=benedick;
  char_input(47, second_person);//benedick->value=getchar();
  push(47, second_person, value_of(47, second_person));//benedick->stack.push(benedick->value);
  
  activate_character(53, benedick);//first_person=benedick;second_person=beatrice;
  assign(50, second_person, int_add(50, value_of(50, second_person), 1));//beatrice->value=1;
  comp1 = value_of(51, first_person);//comp1=benedick->value;
  comp2 = 2*2*2*2*2*1;//comp2=32;
  truth_flag = (comp1 == comp2);
  
  activate_character(56, beatrice);//first_person=beatrice;second_person=benedick;
  if (!truth_flag) {
    goto act_i_scene_ii;//read characters and save to benedick stack until space
  }
  
  activate_character(59, benedick);//first_person=benedick;second_person=beatrice;
  assign(57, second_person, int_add(57, value_of(57, second_person), (-1)));//beatrice->value--;
  
  activate_character(62, beatrice);//first_person=beatrice;second_person=benedick;
  pop(60, second_person);//benedick->value=32;benedick->stack.pop();
  
  act_i_scene_iii:                        /* Benedick teaches his friends about hacking */
  
  activate_character(67, beatrice);//first_person=beatrice;second_person=benedick;
  pop(65, second_person);//benedick->value=benedick->stack.pop();
  assign(65, second_person, int_sub(65, value_of(65, second_person), achilles->value));//benedick->value=benedick->value-achilles->value;
  
  activate_character(70, benedick);//first_person=benedick;second_person=beatrice;
  assign(68, second_person, int_add(68, value_of(68, second_person), (-1)));//beatrice->value--;
  
  exit_scene(70, beatrice);//beatrice->on_stage=0;num_on_stage=1;
  
  enter_scene(71, don_john);//don_john->on_stage=1;num_on_stage=2;
  
  activate_character(76, benedick);//first_person=benedick;second_person=don_john;
  assign(74, second_person, value_of(74, first_person));//don_john->value=benedick->value;
  
  exit_scene(76, don_john);//don_john->on_stage=0;num_on_stage=1;
  
  enter_scene(77, don_pedro);//don_pedro->on_stage=1;num_on_stage=2;
  
  activate_character(83, don_pedro);//first_person=don_pedro;second_person=benedick;
  assign(80, second_person, int_add(80, value_of(80, second_person), value_of(80, first_person)));//benedick->value+=don_pedro->value;
  assign(81, second_person, int_mod(81, value_of(81, second_person), cleopatra->value));//benedick->value%=cleopatra->value;
  
  exit_scene(83, benedick);//benedick->on_stage=0;num_on_stage=1;
  
  enter_scene(84, don_john;//don_john->on_stage=1;num_on_stage=2;
  
  activate_character(89, don_john);//first_person=don_john;second_person=don_pedro;
  assign(87, second_person, value_of(87, first_person));//don_pedro->value=don_john->value;
  
  exit_scene_all(89);//num_on_stage=0;all on_stage=0;
  
  enter_scene(90, beatrice);//beatrice->on_stage=1;num_on_stage=1;
  enter_scene(90, benedick);//benedick->on_stage=1;num_on_stage=2;
  
  activate_character(95, beatrice);//first_person=beatrice;second_person=benedick;
  assign(93, second_person, int_add(93, value_of(93, second_person), achilles->value));//benedick+=achilles->value;
  char_output(93, second_person);//putchar(benedick->value);
  
  activate_character(98, benedick);//first_person=benedick;second_person=beatrice;
  comp1 = value_of(96, second_person);//comp1=benedick->value;
  comp2 = 0;
  truth_flag = (comp1 > comp2);
  
  activate_character(101, beatrice);//first_person=beatrice;second_person=benedick;
  if (truth_flag) {
    goto act_i_scene_iii;
  }
  
  exit_scene_all(101);
  
  return 0;
}
