#include <stdio.h>
#include <lotos.hh>

extern int delay;

extern kdatum zero ();
extern kdatum succ ();

kdatum
int2kdatum (i)
     int i;
{
  kdatum result;

  result= zero ();
  while (i-- > 0)
    result= succ (result);
  return result;
}

main (argc, argv)
     int argc;
     char* argv[];
{
  kdatum spec_args[1];

  if (argc != 3) {
    fprintf (stderr, "usage: %s <delay> <start>\n", argv[0]);
    exit (1);
  }
  ldcinit ();
  delay= atoi (argv[1]);
  spec_args[0]= int2kdatum (atoi (argv[2]));
  lbcinit (1, spec_args);
  exit (sch ());
}
