void make_data_stream1_1() {
  init_data_stream(
    538976304, 1918984994, 822742306, 572530720, 
    577922147, 540150285, 1663180832, 577990255, 
    540215821, 1814175776, 1064596329, 873073954, 
    572530720, 1651341683, 574581871, 540346893);
//0   "car"  1   "cdr"  2   "cons"  3   "list?"  4   "symbol?"  5 
  init_data_stream(
    1696735264, 220348273, 538981898, 1970348576, 
    577074287, 540477965, 1847730208, 1064070261, 
    940182818, 572530720, 578056046, 540609037, 
    1663180832, 577921377, 808520205, 1663180832);
//  "eq?"  6   "quote"  7   "null?"  8   "not"  9   "caar"  10  "c
  init_data_stream(
    577921380, 825297421, 1663180832, 577922145, 
    842074637, 1663180832, 577922148, 858851853, 
    1663180832, 1953721967, 822742306, 572530740, 
    1918989932, 822742306, 572530741, 1952805740);
//dar"  11  "cadr"  12  "cddr"  13  "const"  14  "lvar"  15  "lset
  init_data_stream(
    822742306, 572530742, 1918989927, 822742306, 
    572530743, 1952805735, 822742306, 572530744, 
    1936159329, 822742306, 572530745, 220361314, 
    540029450, 1952588320, 168632946, 538980658);
//"  16  "gvar"  17  "gset"  18  "args"  19  "br"  20  "btr"  21  
  init_data_stream(
    1818649122, 839519522, 572530738, 1702257011, 
    839519522, 572530739, 1668248176, 839519522, 
    572530740, 1819042147, 168632938, 538981682, 
    1952805410, 577663605, 909249037, 1881284640);
//"bfl"  22  "save"  23  "proc"  24  "callj"  25  "return"  26  "p
  return;
}

void make_data_stream1_2() {
  init_data_stream(
    220360815, 540488202, 1768694304, 1915581555, 
    220358245, 540553738, 1701650976, 220361069, 
    540619274, 1701650976, 1919246957, 856296738, 
    572530736, 1903391585, 856296738, 572530737);
//op"  27  "list-ref"  28  "memq"  29  "member"  30  "assq"  31  "
  init_data_stream(
    1735288172, 220358772, 540160778, 1970151968, 
    1919246957, 168632895, 538981171, 1920234274, 
    1063743081, 856296738, 572530740, 1952671094, 
    574583407, 892537357, 1981947936, 1869898597);
//length"  32  "number?"  33  "string?"  34  "vector?"  35  "vecto
  init_data_stream(
    1701588338, 1752459118, 856296738, 572530742, 
    1952671094, 1915581039, 220358245, 540488458, 
    1702240800, 1919906915, 1952805677, 168632865, 
    538982451, 1718576418, 1784835885, 1064592229);
//r-length"  36  "vector-ref"  37  "vector-set!"  38  "eof-object?
  init_data_stream(
    856296738, 572530745, 1886611812, 578380140, 
    808716813, 1847730208, 1768716133, 220357998, 
    540095498, 573514272, 842271245, 723656736, 
    873073954, 572530739, 168632877, 538981428);
//"  39  "display"  40  "newline"  41  "/"  42  "+"  43  "-"  44  
  init_data_stream(
    220342818, 540357642, 1970348576, 1701409903, 
    220361838, 540423178, 1701978656, 1852399981, 
    577922404, 926157325, 1025646624, 873073954, 
    572530744, 1969516397, 220360556, 540619786);
//"*"  45  "quotient"  46  "remainder"  47  "="  48  "modulo"  49 
  return;
}

void make_data_stream1_3() {
  init_data_stream(
    574366240, 808782349, 1008869408, 168632893, 
    538980661, 220347938, 540161290, 1027482144, 
    889851170, 572530739, 1635086693, 220348268, 
    540292362, 1702044192, 1633889652, 220340594);
// "<"  50  "<="  51  ">"  52  ">="  53  "equal?"  54  "set-car!" 
  init_data_stream(
    540357898, 1702044192, 1684221300, 220340594, 
    540423434, 1701978656, 1663919201, 577921384, 
    926222861, 1931616288, 1852404340, 1701981543, 
    168632934, 538982453, 1920234274, 761753193);
// 55  "set-cdr!"  56  "read-char"  57  "string-ref"  58  "string-
  init_data_stream(
    561276275, 889851170, 572530745, 1953067639, 
    1751330149, 220361313, 540030474, 1768694304, 
    1949135987, 577530209, 825625101, 1663180832, 
    1030906216, 168632895, 538980918, 1634231074);
//set!"  59  "write-char"  60  "list-tail"  61  "char=?"  62  "cha
  init_data_stream(
    1970154866, 1769104749, 220348259, 540227082, 
    1751327264, 1630368353, 1634234476, 1769235810, 
    220348259, 540292618, 1751327264, 1965912673, 
    1935762288, 168632933, 538981686, 1634231074);
//r-numeric?"  63  "char-alphabetic?"  64  "char-upcase"  65  "cha
  init_data_stream(
    1868836210, 1633906295, 220358003, 540423690, 
    1634542112, 1932354923, 1852404340, 168632935, 
    538982198, 1920234274, 1030188649, 168632895, 
    538982454, 1920234274, 761753193, 1735288172);
//r-downcase"  66  "make-string"  67  "string=?"  68  "string-leng
  return;
}

void make_data_stream1_4() {
  init_data_stream(
    220358772, 540620298, 1953702432, 1735289202, 
    2037595693, 1819239021, 923405602, 572530736, 
    1769108595, 1043162990, 1651340654, 220361317, 
    540096266, 1970151968, 1919246957, 1953709613);
//th"  69  "string->symbol"  70  "string->number"  71  "number->st
  init_data_stream(
    1735289202, 923405602, 572530738, 1651341683, 
    1043164271, 1769108595, 220358510, 540227338, 
    1634542112, 1982686571, 1869898597, 168632946, 
    538981431, 1769109282, 220358004, 540358410);
//ring"  72  "symbol->string"  73  "make-vector"  74  "write"  75 
  init_data_stream(
    1920213536, 577069921, 909576717, 1696735264, 
    574584433, 926353933, 1663180832, 1064460648, 
    923405602, 572530744, 1918986339, 1852390957, 
    1701274996, 168632946, 538982711, 1953392930);
// "trace"  76  "eqv?"  77  "char?"  78  "char->integer"  79  "int
  init_data_stream(
    1919248229, 1751334445, 220361313, 540030986, 
    1634214432, 220361836, 540096522, 1634738720, 
    574583401, 842533389, 1847730208, 577072481, 
    859310605, 1629626400, 1685284722, 940182818);
//eger->char"  80  "halt"  81  "pair?"  82  "name"  83  "argsd"  8
  init_data_stream(
    572530740, 1819042147, 220359278, 540358666, 
    1918968352, 220359783, 540424202, 1919951392, 
    1684366191, 1063613045, 940182818, 572530743, 
    1953069157, 940182818, 572530744, 1819242338);
//4  "callnj"  85  "argl"  86  "procedure?"  87  "exit"  88  "bool
  return;
}

void make_data_stream1_5() {
  init_data_stream(
    1064198501, 940182818, 572530745, 220357475, 
    540031242, 1702044192, 576938868, 825821709, 
    1830952992, 578186597, 842598925, 1629626400, 
    578188147, 859376141, 1763844128, 1734702190);
//ean?"  89  "cc"  90  "setcc"  91  "memv"  92  "assv"  93  "integ
  init_data_stream(
    574583397, 876153357, 1830952992, 761621345, 
    1952671094, 1999467119, 761820265, 1819044198, 
    956960034, 572530741, 1701536109, 1920234285, 
    761753193, 1752459639, 1818846765, 168632940);
//er?"  94  "make-vector-with-fill"  95  "make-string-with-fill"  
  init_data_stream(
    538981945, 1953063458, 1702062455, 1684955437, 
    956960034, 572530743, 2004117858, 761623401, 
    220361327, 540555530, 1768038944, 1936291700, 
    1869491557, 168632948, 538982713, 1953063458);
//96  "bitwise-and"  97  "bitwise-or"  98  "bitwise-not"  99  "bit
  init_data_stream(
    1702062455, 1919907885, 822742306, 572534832, 
    1953067617, 1952804200, 1932354409, 1952868712, 
    822742306, 572535088, 1769108595, 1060923246, 
    822742306, 572535344, 1769108595, 1061054318);
//wise-xor"  100 "arithmetic-shift"  101 "string<?"  102 "string>?
  init_data_stream(
    822742306, 572535600, 1769108595, 1027368814, 
    168632895, 540291121, 1920234274, 1046965865, 
    220348221, 892350730, 1953702432, 1735289202, 
    1013539629, 168632895, 540422193, 1920234274);
//"  103 "string<=?"  104 "string>=?"  105 "string-ci<?"  106 "str
  return;
}

void make_data_stream1_6() {
  init_data_stream(
    761753193, 1061054819, 822742306, 572536624, 
    1769108595, 1663919982, 1060977769, 822742306, 
    572536880, 1769108595, 1663919982, 1060978281, 
    822742306, 572537136, 1769108595, 1663919982);
//ing-ci>?"  107 "string-ci<=?"  108 "string-ci>=?"  109 "string-c
  init_data_stream(
    574569833, 540019213, 589439008, 577138533, 
    540019213, 589439008, 1886613109, 1718182757, 
    577004905, 540019213, 589439008, 1869770812, 
    1969513827, 574514546, 168626701, 538976288);
//i=?"  0   "#eof"  0   "#unspecified"  0   "#<procedure>"
  return;
}

void make_data_stream() {
  reset_data_stream_idx();

  // broken up into routines for arm literal pool size

  make_data_stream1_1();
  make_data_stream1_2();
  make_data_stream1_3();
  make_data_stream1_4();
  make_data_stream1_5();
  make_data_stream1_6();

  make_data_stream_extra();

  reset_data_stream_idx();
  return;
}

void init_args() {
  debug = 0;
  display_histogram = 0;
  case_sensitive = 0;
  skip_blanks();
  while (ch == '-') {
    ch = my_getchar();
    if (ch == 'd')
      debug = 1;
    else
    if (ch == 'h')
      display_histogram = 1;
    else
    if (ch == 'z')
      case_sensitive = 1;
    ch = my_getchar();
    skip_blanks();
  }
  return;
}

void init_stack() {

  // build the system stack

//stack = make_vector(stacksize);
  stack = 0;
  stackidx = 0;
  return;
}

void init_token() {
  token_list = 0;
  token_new = 0;
  token_tail = 0;
  return;
}

void init_atomlist() {

  // build the atomlist hash table

  atomlist = make_hash_table(4096);
  return;
}

void init_keywords() {

  // initialize the atomlist with the primitive functions

  caratom = atomize_string();
  cdratom = atomize_string();
  consatom = atomize_string();
  listpatom = atomize_string();
  symbolpatom = atomize_string();
  eqatom = atomize_string();
  quoteatom = atomize_string();
  nullatom = atomize_string();
  notatom = atomize_string();
  caaratom = atomize_string();
  cdaratom = atomize_string();
  cadratom = atomize_string();
  cddratom = atomize_string();
  constatom = atomize_string();
  lvaratom = atomize_string();
  lsetatom = atomize_string();
  gvaratom = atomize_string();
  gsetatom = atomize_string();
  argsatom = atomize_string();
  bratom = atomize_string();
  btratom = atomize_string();
  bflatom = atomize_string();
  saveatom = atomize_string();
  procatom = atomize_string();
  calljatom = atomize_string();
  returnatom = atomize_string();
  popatom = atomize_string();
  listrefatom = atomize_string();
  memqatom = atomize_string();
  memberatom = atomize_string();
  assqatom = atomize_string();
  lengthatom = atomize_string();
  numberpatom = atomize_string();
  stringpatom = atomize_string();
  vecpatom = atomize_string();
  veclengthatom = atomize_string();
  vecrefatom = atomize_string();
  vecsetatom = atomize_string();
  eofobjectatom = atomize_string();
  displayatom = atomize_string();
  newlineatom = atomize_string();
  divatom = atomize_string();
  addatom = atomize_string();
  subatom = atomize_string();
  multatom = atomize_string();
  quotientatom = atomize_string();
  remainderatom = atomize_string();
  aeqatom = atomize_string();
  moduloatom = atomize_string();
  lesspatom = atomize_string();
  leqatom = atomize_string();
  greaterpatom = atomize_string();
  geqatom = atomize_string();
  equalpatom = atomize_string();
  rplacaatom = atomize_string();
  rplacdatom = atomize_string();
  readcharatom = atomize_string();
  strrefatom = atomize_string();
  strsetatom = atomize_string();
  writecharatom = atomize_string();
  listtailatom = atomize_string();
  chareqatom = atomize_string();
  charnumatom = atomize_string();
  charalphaatom = atomize_string();
  charupatom = atomize_string();
  chardownatom = atomize_string();
  makestratom = atomize_string();
  streqatom = atomize_string();
  strlenatom = atomize_string();
  strtosymatom = atomize_string();
  strtonumberatom = atomize_string();
  numbertostratom = atomize_string();
  symtostratom = atomize_string();
  makevecatom = atomize_string();
  writeatom = atomize_string();
  traceatom = atomize_string();
  eqvatom = atomize_string();
  charpatom = atomize_string();
  chartointatom = atomize_string();
  inttocharatom = atomize_string();
  haltatom = atomize_string();
  pairatom = atomize_string();
  nameatom = atomize_string();
  argsdatom = atomize_string();
  callnjatom = atomize_string();
  arglatom = atomize_string();
  procedurepatom = atomize_string();
  exitatom = atomize_string();
  boolpatom = atomize_string();
  ccatom = atomize_string();
  setccatom = atomize_string();
  memvatom = atomize_string();
  assvatom = atomize_string();
  integerpatom = atomize_string();
  makevectorwithfillatom = atomize_string();
  makestringwithfillatom = atomize_string();
  bitwiseandatom = atomize_string();
  bitwiseoratom = atomize_string();
  bitwisenotatom = atomize_string();
  bitwisexoratom = atomize_string();
  arithmeticshiftatom = atomize_string();
  strltatom = atomize_string();
  strgtatom = atomize_string();
  strleatom = atomize_string();
  strgeatom = atomize_string();
  strciltatom = atomize_string();
  strcigtatom = atomize_string();
  strcileatom = atomize_string();
  strcigeatom = atomize_string();
  strcieqatom = atomize_string();

  // special and hidden variables

  eofatom = atomize_string();
  unspecifiedatom = atomize_string();
  procedureatom = atomize_string();

  init_keywords_extra();

  return;
}

void gccopykeywords() {

  // locate global keywords during a gc

  caratom = gc_copy(caratom);
  cdratom = gc_copy(cdratom);
  consatom = gc_copy(consatom);
  listpatom = gc_copy(listpatom);
  symbolpatom = gc_copy(symbolpatom);
  eqatom = gc_copy(eqatom);
  quoteatom = gc_copy(quoteatom);
  nullatom = gc_copy(nullatom);
  notatom = gc_copy(notatom);
  caaratom = gc_copy(caaratom);
  cdaratom = gc_copy(cdaratom);
  cadratom = gc_copy(cadratom);
  cddratom = gc_copy(cddratom);
  constatom = gc_copy(constatom);
  lvaratom = gc_copy(lvaratom);
  lsetatom = gc_copy(lsetatom);
  gvaratom = gc_copy(gvaratom);
  gsetatom = gc_copy(gsetatom);
  argsatom = gc_copy(argsatom);
  bratom = gc_copy(bratom);
  btratom = gc_copy(btratom);
  bflatom = gc_copy(bflatom);
  saveatom = gc_copy(saveatom);
  procatom = gc_copy(procatom);
  calljatom = gc_copy(calljatom);
  returnatom = gc_copy(returnatom);
  popatom = gc_copy(popatom);
  listrefatom = gc_copy(listrefatom);
  memqatom = gc_copy(memqatom);
  memberatom = gc_copy(memberatom);
  assqatom = gc_copy(assqatom);
  lengthatom = gc_copy(lengthatom);
  numberpatom = gc_copy(numberpatom);
  stringpatom = gc_copy(stringpatom);
  vecpatom = gc_copy(vecpatom);
  veclengthatom = gc_copy(veclengthatom);
  vecrefatom = gc_copy(vecrefatom);
  vecsetatom = gc_copy(vecsetatom);
  eofobjectatom = gc_copy(eofobjectatom);
  displayatom = gc_copy(displayatom);
  newlineatom = gc_copy(newlineatom);
  divatom = gc_copy(divatom);
  addatom = gc_copy(addatom);
  subatom = gc_copy(subatom);
  multatom = gc_copy(multatom);
  quotientatom = gc_copy(quotientatom);
  remainderatom = gc_copy(remainderatom);
  aeqatom = gc_copy(aeqatom);
  moduloatom = gc_copy(moduloatom);
  lesspatom = gc_copy(lesspatom);
  leqatom = gc_copy(leqatom);
  greaterpatom = gc_copy(greaterpatom);
  geqatom = gc_copy(geqatom);
  equalpatom = gc_copy(equalpatom);
  rplacaatom = gc_copy(rplacaatom);
  rplacdatom = gc_copy(rplacdatom);
  readcharatom = gc_copy(readcharatom);
  strrefatom = gc_copy(strrefatom);
  strsetatom = gc_copy(strsetatom);
  writecharatom = gc_copy(writecharatom);
  listtailatom = gc_copy(listtailatom);
  chareqatom = gc_copy(chareqatom);
  charnumatom = gc_copy(charnumatom);
  charalphaatom = gc_copy(charalphaatom);
  charupatom = gc_copy(charupatom);
  chardownatom = gc_copy(chardownatom);
  makestratom = gc_copy(makestratom);
  streqatom = gc_copy(streqatom);
  strlenatom = gc_copy(strlenatom);
  strtosymatom = gc_copy(strtosymatom);
  strtonumberatom = gc_copy(strtonumberatom);
  numbertostratom = gc_copy(numbertostratom);
  symtostratom = gc_copy(symtostratom);
  makevecatom = gc_copy(makevecatom);
  writeatom = gc_copy(writeatom);
  traceatom = gc_copy(traceatom);
  eqvatom = gc_copy(eqvatom);
  charpatom = gc_copy(charpatom);
  chartointatom = gc_copy(chartointatom);
  inttocharatom = gc_copy(inttocharatom);
  haltatom = gc_copy(haltatom);
  pairatom = gc_copy(pairatom);
  nameatom = gc_copy(nameatom);
  argsdatom = gc_copy(argsdatom);
  callnjatom = gc_copy(callnjatom);
  arglatom = gc_copy(arglatom);
  procedurepatom = gc_copy(procedurepatom);
  exitatom = gc_copy(exitatom);
  boolpatom = gc_copy(boolpatom);
  ccatom = gc_copy(ccatom);
  setccatom = gc_copy(setccatom);
  memvatom = gc_copy(memvatom);
  assvatom = gc_copy(assvatom);
  integerpatom = gc_copy(integerpatom);
  makevectorwithfillatom = gc_copy(makevectorwithfillatom);
  makestringwithfillatom = gc_copy(makestringwithfillatom);
  bitwiseandatom = gc_copy(bitwiseandatom);
  bitwiseoratom = gc_copy(bitwiseoratom);
  bitwisenotatom = gc_copy(bitwisenotatom);
  bitwisexoratom = gc_copy(bitwisexoratom);
  arithmeticshiftatom = gc_copy(arithmeticshiftatom);
  strltatom = gc_copy(strltatom);
  strgtatom = gc_copy(strgtatom);
  strleatom = gc_copy(strleatom);
  strgeatom = gc_copy(strgeatom);
  strciltatom = gc_copy(strciltatom);
  strcigtatom = gc_copy(strcigtatom);
  strcileatom = gc_copy(strcileatom);
  strcigeatom = gc_copy(strcigeatom);
  strcieqatom = gc_copy(strcieqatom);

  // special and hidden variables

  eofatom = gc_copy(eofatom);
  unspecifiedatom = gc_copy(unspecifiedatom);
  procedureatom = gc_copy(procedureatom);

  gc_copy_keywords_extra();

  return;
}

void init_global_vars() {
  label_instructions =
    kons(bratom,
      kons(btratom,
        kons(bflatom,
          kons(saveatom, 0))));

  call_cc_code =
    kons(
      kons(argsatom,
      kons(make_integer(1),
      0)),
    kons(
      kons(lvaratom,
      kons(make_integer(1),
      kons(make_integer(0),
      0))),
    kons(
      (kons(setccatom,
      0)),
    kons(
      kons(lvaratom,
      kons(make_integer(0),
      kons(make_integer(0),
      0))),
    kons(
      kons(returnatom,
      0),
    0)))));
  return;
}

void init_histogram() {
  int i;
  for (i = 0; i < 150; i++)
    histogram[i] = 0;
  return;
}

void init() {
  is_data_stream = 1;
  make_data_stream();

  curr_cell = 2;
  cell_max = n_cells - 1;
  init_stack();
  init_token();
  init_atomlist();
  init_keywords();
  init_global_vars();
  init_histogram();

  globals = make_hash_table(4096);

  is_data_stream = 0;
  init_args();

  code = assemble(readin());

  instructions = code;

  env = 0;

  gc_car = 0;
  gc_cdr = 0;
  opcode = 0;
  operands = 0;
  binding = 0;
  closure = 0;
  returnval = 0;
  arglist = 0;
  stack_arg1 = 0;
  stack_arg2 = 0;
  stack_arg3 = 0;

  return;
}
