~crc_/ngata

a46e000bef8ce4033768f52dca3f48afed645625 — crc 3 years ago eaa25b9 master
check in sources, some files w/commentS
6 files changed, 1799 insertions(+), 1 deletions(-)

A Makefile
M README
A nga.c
A t,expansion
A t,input
A t,status
A Makefile => Makefile +20 -0
@@ 0,0 1,20 @@
CFLAGS ?= -std=c89 -O2 -Werror -Wall -Wextra
EFLAGS ?=
ENABLED ?=

default: vm

update:
	cp ../image/* .

vm: nga.c
	$(CC) $(CFLAGS) $(EFLAGS) $(ENABLED) nga.c -o retro

kernel: retro.forth retro.muri assemble.retro
	./retro -u ngaImage -f retro.forth -f assemble.retro

extend: retro.forth devices.retro extend.retro
	./retro -u retro.nga -f retro.forth -f devices.retro -f listen.retro -f extend.retro

finish:
	mv retro.nga ngaImage

M README => README +2 -1
@@ 24,7 24,7 @@ underlying hardware:
devices:

- this will have a character lcd as the primary output
  ideally 40x4, but i can work with a 40x2 or 20x4
  ideally 40x4, but i can work with a smaller display
- this will have a small bitmapped lcd or oled display
  we are looking at a 128x64 or similar size
- input is likely to be a chorded keyboard, though might be


@@ 45,3 45,4 @@ interface code will use most of that.

the paper area is a small holder for 3x5 index cards.
----------------------------------------------------------------


A nga.c => nga.c +1729 -0
@@ 0,0 1,1729 @@
/*---------------------------------------------------------------------
  Copyright (c) 2008 - 2021, Charles Childers

  Portions are based on Ngaro, which was additionally copyrighted by
  the following:

  Copyright (c) 2009 - 2010, Luke Parrish
  Copyright (c) 2010,        Marc Simpson
  Copyright (c) 2010,        Jay Skeer
  Copyright (c) 2011,        Kenneth Keating
  ---------------------------------------------------------------------*/

#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>


/* Configuration ----------------------------------------------------- */
#define CELL int32_t
#define CELL_MIN INT_MIN + 1
#define CELL_MAX INT_MAX - 1
#define IMAGE_SIZE   96000        /* Amount of RAM, in cells           */
#define ADDRESSES    256          /* Depth of address stack            */
#define STACK_DEPTH  256          /* Depth of data stack               */
#define TIB          1025         /* Location of TIB                   */

#define D_OFFSET_LINK     0       /* Dictionary Format Info. Update if */
#define D_OFFSET_XT       1       /* you change the dictionary fields. */
#define D_OFFSET_CLASS    2
#define D_OFFSET_NAME     3

#define MAX_DEVICES      32

#include <stdint.h>
#ifndef CELL
#define CELL int32_t
#endif
CELL ngaImageCells = 14184;
CELL ngaImage[] = { 1793,14055,14145,14184,202104,0,10,1,10,2,10,3,10,4,10,5,10,6,10,
                       7,10,8,10,9,10,10,11,10,12,10,13,10,14,10,15,10,16,10,17,
                       10,18,10,19,10,20,10,21,10,22,10,23,10,24,10,25,10,68223234,1,2575,
                       85000450,1,656912,9354,9398,268505089,63,62,285281281,0,63,2063,10,101384453,0,9,10,2049,56,25,
                       459011,76,524546,76,302256641,1,10,16974595,0,50529798,10,25,524547,95,50529798,10,17108738,1,251790353,101777669,
                       1,17565186,86,524545,90,64,167838467,-1,134287105,3,59,659457,3,459023,107,2049,56,25,2049,107,
                       1793,114,2049,114,117506307,0,107,0,524545,25,112,168820993,0,126,1642241,126,134283523,7,112,1793,
                       107,7,524545,2049,107,1793,107,16846593,126,141,140,1793,64,16846593,126,112,140,1793,64,7,
                       10,659713,1,659713,2,659713,3,1793,168,17108737,3,2,524559,107,2049,107,2049,107,2049,121,
                       168820998,2,14145,1025,167841793,181,5,17826049,0,181,2,15,25,524546,164,134287105,182,95,2305,183,
                       459023,191,134287361,182,186,659201,181,2049,56,25,84152833,48,286458116,10,459014,206,184618754,45,25,16974851,
                       -1,168886532,1,134284289,1,215,134284289,0,206,660227,32,0,0,115,105,103,105,108,58,105,
                       0,285278479,232,6,2576,524546,81,1641217,1,167838467,229,2049,244,2049,240,524545,232,201,17826050,231,
                       0,2572,2563,2049,222,1793,133,459023,133,17760513,146,3,166,8,251727617,3,2,2049,160,16,
                       168820993,-1,126,2049,201,2049,160,459023,133,285282049,3,2,134287105,126,279,524545,1793,107,16846593,3,
                       0,107,8,659201,3,524545,25,112,17043201,3,7,2049,112,2049,107,268505092,126,1642241,126,656131,
                       659201,3,524545,7,112,2049,107,459009,19,112,459009,54,112,459009,15,112,459009,17,112,1793,
                       5,10,524546,160,134284303,162,1807,1025,0,0,1642241,231,285282049,346,1,459012,341,117509889,181,341,
                       134287105,346,201,16845825,0,356,338,1793,64,1793,370,17826050,346,250,8,117506305,347,359,64,2116,
                       11340,11700,11400,13685,13104,12432,12402,9603,9801,11514,11413,11110,12528,11948,10302,13340,9700,13455,12753,10500,
                       10670,12654,13320,11960,13908,10088,10605,11865,11025,0,2049,201,987393,1,1793,107,524546,446,2049,444,
                       2049,444,17891588,2,446,8,17045505,-24,-16,17043736,-8,1118488,1793,107,17043202,1,169021201,2049,56,25,
                       33883396,101450758,6404,459011,436,34668804,2,2049,433,524545,378,436,302056196,378,659969,1,0,9,152,100,
                       117,112,0,455,11,152,100,114,111,112,0,462,13,152,115,119,97,112,0,470,
                       21,152,99,97,108,108,0,478,26,152,101,113,63,0,486,28,152,45,101,113,
                       63,0,493,30,152,108,116,63,0,501,32,152,103,116,63,0,508,34,152,102,
                       101,116,99,104,0,515,36,152,115,116,111,114,101,0,524,38,152,43,0,533,
                       40,152,45,0,538,42,152,42,0,543,44,152,47,109,111,100,0,548,46,152,
                       97,110,100,0,556,48,152,111,114,0,563,50,152,120,111,114,0,569,52,152,
                       115,104,105,102,116,0,576,332,158,112,117,115,104,0,585,335,158,112,111,112,
                       0,593,329,158,48,59,0,600,56,146,102,101,116,99,104,45,110,101,120,116,
                       0,606,59,146,115,116,111,114,101,45,110,101,120,116,0,620,222,146,115,58,
                       116,111,45,110,117,109,98,101,114,0,634,95,146,115,58,101,113,63,0,649,
                       81,146,115,58,108,101,110,103,116,104,0,658,64,146,99,104,111,111,115,101,
                       0,670,74,152,105,102,0,680,72,146,45,105,102,0,686,261,158,115,105,103,
                       105,108,58,40,0,693,126,133,67,111,109,112,105,108,101,114,0,704,3,133,
                       72,101,97,112,0,716,107,146,44,0,724,121,146,115,44,0,729,127,158,59,
                       0,735,288,158,91,0,740,304,158,93,0,745,2,133,68,105,99,116,105,111,
                       110,97,114,121,0,750,159,146,100,58,108,105,110,107,0,764,160,146,100,58,
                       120,116,0,774,162,146,100,58,99,108,97,115,115,0,782,164,146,100,58,110,
                       97,109,101,0,793,146,146,99,108,97,115,115,58,119,111,114,100,0,803,158,
                       146,99,108,97,115,115,58,109,97,99,114,111,0,817,133,146,99,108,97,115,
                       115,58,100,97,116,97,0,832,166,146,100,58,97,100,100,45,104,101,97,100,
                       101,114,0,846,262,158,115,105,103,105,108,58,35,0,862,268,158,115,105,103,
                       105,108,58,58,0,873,282,158,115,105,103,105,108,58,38,0,884,266,158,115,
                       105,103,105,108,58,36,0,895,319,158,114,101,112,101,97,116,0,906,321,158,
                       97,103,97,105,110,0,916,368,146,105,110,116,101,114,112,114,101,116,0,925,
                       201,146,100,58,108,111,111,107,117,112,0,938,152,146,99,108,97,115,115,58,
                       112,114,105,109,105,116,105,118,101,0,950,4,133,86,101,114,115,105,111,110,
                       0,969,415,146,105,0,980,107,146,100,0,985,409,146,114,0,990,338,146,101,
                       114,114,58,110,111,116,102,111,117,110,100,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,105,109,97,103,101,58,115,97,118,101,0,111,114,45,
                       119,114,105,116,105,110,103,0,79,84,95,70,79,85,78,68,0,125,126,0,
                       72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,995,1543,146,
                       69,79,77,0,1,-3,15,10,1536,1556,146,100,101,112,116,104,0,1,-1,15,
                       10,1547,1570,146,100,58,108,97,115,116,0,1,2,15,10,1560,1587,146,100,58,
                       108,97,115,116,46,120,116,0,2049,1570,2049,160,15,10,1574,1609,146,100,58,108,
                       97,115,116,46,99,108,97,115,115,0,2049,1570,2049,162,15,10,1593,1630,146,100,
                       58,108,97,115,116,46,110,97,109,101,0,2049,1570,2049,164,10,1615,1646,146,114,
                       101,99,108,97,115,115,0,2049,1570,2049,162,16,10,1635,1665,146,105,109,109,101,
                       100,105,97,116,101,0,1,158,2049,1646,10,1652,1678,146,100,97,116,97,0,1,
                       133,2049,1646,10,1670,1696,146,112,114,105,109,105,116,105,118,101,0,1,152,2049,
                       1646,10,1683,1706,158,40,0,10,1701,1712,158,41,0,10,1707,1728,146,99,111,109,
                       112,105,108,101,58,108,105,116,0,1,1,2049,107,2049,107,10,1713,1751,146,99,
                       111,109,112,105,108,101,58,106,117,109,112,0,1,1793,2049,107,2049,107,10,1735,
                       1774,146,99,111,109,112,105,108,101,58,99,97,108,108,0,1,2049,2049,107,2049,
                       107,10,1758,1796,146,99,111,109,112,105,108,101,58,114,101,116,0,1,10,2049,
                       107,10,1781,1815,146,99,111,109,112,105,108,105,110,103,63,0,1,126,15,10,
                       1801,1830,158,115,105,103,105,108,58,96,0,2049,222,2049,107,10,1819,1846,158,115,
                       105,103,105,108,58,92,0,2049,415,10,1835,1860,158,115,105,103,105,108,58,94,
                       0,2049,409,10,1849,1871,146,104,101,114,101,0,1,3,15,10,1863,1886,158,115,
                       105,103,105,108,58,64,0,2049,201,2049,160,15,2049,1815,1793,1902,1,3841,2049,107,
                       2049,107,10,1,1895,1793,1908,15,10,1,1906,2049,64,10,1875,1924,158,115,105,103,
                       105,108,58,33,0,2049,201,2049,160,15,2049,1815,1793,1940,1,4097,2049,107,2049,107,
                       10,1,1933,1793,1946,16,10,1,1944,2049,64,10,1913,1963,146,100,58,99,114,101,
                       97,116,101,0,1,133,1,0,2049,166,2049,1871,2049,1570,2049,160,16,10,1951,1986,
                       146,118,97,114,45,110,0,2049,1963,2049,107,10,1977,1998,146,118,97,114,0,134284289,
                       0,1986,10,1991,2011,146,99,111,110,115,116,0,2049,1963,2049,1570,2049,160,16,10,
                       2002,2027,152,116,117,99,107,0,100926722,10,2019,2037,152,111,118,101,114,0,67502597,10,
                       2029,2046,152,110,105,112,0,772,10,2039,2061,152,100,114,111,112,45,112,97,105,
                       114,0,771,10,2048,2071,152,63,100,117,112,0,6402,10,2063,2085,146,100,117,112,
                       45,112,97,105,114,0,67502597,67502597,10,2073,2095,146,100,105,112,0,525572,6,10,2088,
                       2105,146,115,105,112,0,67502597,1,21,2049,2095,10,2098,2117,146,98,105,0,1,2105,
                       2049,2095,8,10,2111,2130,146,98,105,42,0,1,2095,2049,2095,8,10,2123,2143,146,
                       98,105,64,0,2,2049,2130,10,2136,2154,146,116,114,105,0,1793,2163,1,2105,2049,
                       2095,2049,2105,10,1,2156,2049,2095,8,10,2147,2177,146,116,114,105,42,0,1793,2194,
                       1793,2187,4,1,2095,2049,2095,10,1,2181,2049,2095,2049,2095,10,1,2179,2049,2095,8,
                       10,2169,2208,146,116,114,105,64,0,2,2,2049,2177,10,2200,2222,146,119,104,105,
                       108,101,0,1793,2231,525570,1639430,3,1,2224,7,10,1,2224,8,3,10,2213,2245,146,
                       117,110,116,105,108,0,1793,2256,525570,385942534,-1,25,3,1,2247,7,10,1,2247,8,
                       3,10,2236,2270,146,116,105,109,101,115,0,1793,2282,4,25,33886721,1,2053,1542,1,
                       2273,7,10,1,2272,8,3,10,2261,2298,158,115,105,103,105,108,58,124,0,2049,
                       201,1793,2306,2049,160,15,10,1,2302,1793,2314,2049,162,15,10,1,2310,2049,2117,2049,
                       1815,1793,2329,1,133,2049,2095,2049,1774,10,1,2322,1,21,2049,64,10,2287,2344,146,
                       84,82,85,69,0,1,-1,10,2336,2356,146,70,65,76,83,69,0,1,0,10,
                       2347,2367,146,99,97,115,101,0,1793,2372,67502597,11,10,1,2369,2049,2095,4,1793,2384,
                       772,8,2049,2344,10,1,2379,1793,2392,3,2049,2356,10,1,2388,2049,64,25,6,3,
                       3,10,2359,2411,146,115,58,99,97,115,101,0,1793,2417,67502597,2049,95,10,1,2413,
                       2049,2095,4,1793,2429,772,8,2049,2344,10,1,2424,1793,2437,3,2049,2356,10,1,2433,
                       2049,64,25,6,3,3,10,2401,2453,146,110,111,116,0,1,-1,23,10,2446,2466,
                       146,108,116,101,113,63,0,2049,2085,101516555,22,10,2457,2480,146,103,116,101,113,63,
                       0,4,2049,2466,10,2471,2493,146,110,58,77,65,88,0,1,-5,15,10,2484,2506,
                       146,110,58,77,73,78,0,1,-4,15,10,2497,2521,146,110,58,122,101,114,111,
                       63,0,1,0,11,10,2510,2537,146,110,58,45,122,101,114,111,63,0,1,0,
                       12,10,2525,2556,146,110,58,110,101,103,97,116,105,118,101,63,0,1,0,13,
                       10,2541,2575,146,110,58,112,111,115,105,116,105,118,101,63,0,1,-1,14,10,
                       2560,2603,146,110,58,115,116,114,105,99,116,108,121,45,112,111,115,105,116,105,
                       118,101,63,0,1,0,14,10,2579,2618,146,110,58,101,118,101,110,63,0,1,
                       2,20,3,2049,2521,10,2607,2635,146,110,58,111,100,100,63,0,2049,2618,2049,2453,
                       10,2625,2647,146,105,102,59,0,67502597,1,74,2049,2095,25,6,771,10,2640,2664,146,
                       45,105,102,59,0,67502597,1,72,2049,2095,2049,2453,25,6,771,10,2656,2682,152,114,
                       111,116,0,67503109,10,2675,2689,152,47,0,197652,10,2684,2698,152,109,111,100,0,788,
                       10,2691,2709,146,110,58,112,111,119,0,1,1,4,1793,2717,67502597,19,10,1,2714,
                       2049,2270,772,10,2700,2735,146,110,58,110,101,103,97,116,101,0,1,-1,19,10,
                       2723,2751,146,110,58,115,113,117,97,114,101,0,4866,10,2739,2763,146,110,58,115,
                       113,114,116,0,1,1,1793,2781,2049,2085,197652,67502597,18,1,2,197652,25,17,1,2767,
                       7,10,1,2767,8,772,10,2753,2795,146,110,58,109,105,110,0,2049,2085,13,1793,
                       2802,3,10,1,2800,1793,2808,772,10,1,2806,2049,64,10,2786,2822,146,110,58,109,
                       97,120,0,2049,2085,14,1793,2829,3,10,1,2827,1793,2835,772,10,1,2833,2049,64,
                       10,2813,2849,146,110,58,97,98,115,0,2,2049,2556,1,2735,9,10,2840,2867,146,
                       110,58,108,105,109,105,116,0,4,5,2049,2795,6,2049,2822,10,2856,2884,146,110,
                       58,105,110,99,0,1,1,17,10,2875,2897,146,110,58,100,101,99,0,1,1,
                       18,10,2888,2915,146,110,58,98,101,116,119,101,101,110,63,0,67503109,1793,2923,67503109,
                       67503109,2049,2867,10,1,2918,2049,2105,11,10,2901,2941,146,118,58,105,110,99,45,98,
                       121,0,1793,2945,4367,10,1,2943,2049,2105,16,10,2929,2963,146,118,58,100,101,99,
                       45,98,121,0,1793,2967,1180687,10,1,2965,2049,2105,16,10,2951,2982,146,118,58,105,
                       110,99,0,1,1,4,2049,2941,10,2973,2997,146,118,58,100,101,99,0,1,1,
                       4,2049,2963,10,2988,3014,146,118,58,108,105,109,105,116,0,251790597,1542,2049,2867,4100,
                       10,3003,3028,146,118,58,111,110,0,2049,2344,4100,10,3020,3041,146,118,58,111,102,
                       102,0,2049,2356,4100,10,3032,3054,146,97,108,108,111,116,0,1,3,2049,2941,10,
                       3045,3073,146,118,58,112,114,101,115,101,114,118,101,0,983556,1793,3081,1,21,2049,
                       2095,10,1,3076,2049,2095,4100,10,3059,3099,146,118,58,117,112,100,97,116,101,0,
                       4,1793,3106,15,4,8,10,1,3102,2049,2105,16,10,3087,3120,146,99,111,112,121,
                       0,1793,3129,285278725,1,33951492,268767489,1,6,10,1,3122,2049,2270,771,10,3112,3148,146,83,
                       99,111,112,101,76,105,115,116,0,14045,14102,10,3135,3157,146,123,123,0,2049,1570,
                       2,1,3148,2049,59,16,10,3151,3182,146,45,45,45,114,101,118,101,97,108,45,
                       45,45,0,2049,1570,1,3148,2049,2884,16,10,3166,3196,146,125,125,0,1,3148,2049,
                       56,4,15,11,1793,3210,3841,3148,4097,2,10,1,3205,1793,3236,3841,3148,1793,3231,1,
                       2,983567,1,3148,2049,2884,1641487,3,1,3220,7,10,1,3218,8,16,10,1,3214,2049,
                       64,10,3190,3250,133,115,116,97,114,116,0,0,10,3241,3259,133,101,110,100,0,
                       0,10,3252,3274,146,116,101,114,109,105,110,97,116,101,0,1,0,3841,3259,16,
                       10,3190,3296,146,98,117,102,102,101,114,58,115,116,97,114,116,0,3841,3250,10,
                       3280,3313,146,98,117,102,102,101,114,58,101,110,100,0,3841,3259,10,3299,3330,146,
                       98,117,102,102,101,114,58,97,100,100,0,3841,3259,16,1,3259,2049,2982,2049,3274,
                       10,3316,3354,146,98,117,102,102,101,114,58,103,101,116,0,1,3259,2049,2997,3841,
                       3259,15,2049,3274,10,3340,3380,146,98,117,102,102,101,114,58,101,109,112,116,121,
                       0,3841,3250,4097,3259,2049,3274,10,3364,3402,146,98,117,102,102,101,114,58,115,105,
                       122,101,0,3841,3259,3841,3250,18,10,3387,3422,146,98,117,102,102,101,114,58,115,
                       101,116,0,4097,3250,2049,3380,10,3408,3446,146,98,117,102,102,101,114,58,112,114,
                       101,115,101,114,118,101,0,3841,3250,3841,3259,1793,3459,1,21,2049,2095,4097,3250,10,
                       1,3452,2049,2095,4097,3259,10,3427,3481,133,84,101,109,112,83,116,114,105,110,103,
                       115,0,32,3466,3499,133,84,101,109,112,83,116,114,105,110,103,77,97,120,0,
                       512,3482,3511,146,83,84,82,73,78,71,83,0,2049,1543,3841,3481,3841,3499,19,18,
                       10,3500,3531,133,67,117,114,114,101,110,116,0,27,10,3520,3546,146,115,58,112,
                       111,105,110,116,101,114,0,3841,3531,3841,3499,19,2049,3511,17,10,3533,3565,146,115,
                       58,110,101,120,116,0,1,3531,2049,2982,3841,3531,3841,3481,11,1793,3581,1,0,4097,
                       3531,10,1,3576,9,10,3500,3595,146,115,58,116,101,109,112,0,2,2049,81,2049,
                       2884,2049,3546,4,2049,3120,2049,3546,2049,3565,10,3585,3621,146,115,58,101,109,112,116,
                       121,0,2049,3546,2049,3565,1,0,67502597,16,10,3610,3640,146,115,58,115,107,105,112,
                       0,6,1793,3648,68223234,1,786703,0,10,1,3643,2049,2222,2049,2897,5,10,3630,3666,146,
                       115,58,107,101,101,112,0,2049,1815,1793,3675,1,3640,2049,1774,10,1,3670,9,2049,
                       1871,1,121,2049,2095,2049,133,10,3656,3698,158,115,105,103,105,108,58,39,0,2049,
                       1815,1,3666,1,3595,2049,64,10,3687,3717,146,115,58,99,104,111,112,0,2049,3595,
                       2,2049,81,67502597,17,2049,2897,1,0,4,16,10,3707,3744,146,115,58,114,101,118,
                       101,114,115,101,0,1793,3786,2,2049,3595,2049,3422,1,81,1793,3762,2,2049,81,17,
                       2049,2897,10,1,3755,2049,2117,4,1793,3776,2,15,2049,3330,2049,2897,10,1,3769,2049,
                       2270,3,2049,3296,2049,3595,10,1,3746,2049,3446,10,3731,3804,146,115,58,112,114,101,
                       112,101,110,100,0,2049,3595,1793,3828,2,2049,81,17,1793,3820,2,2049,81,2049,2884,
                       10,1,3814,2049,2095,4,2049,3120,10,1,3808,2049,2105,10,3791,3845,146,115,58,97,
                       112,112,101,110,100,0,4,2049,3804,10,3833,3863,146,115,58,102,111,114,45,101,
                       97,99,104,0,1793,3878,67502597,6415,3,67502597,67502597,251987205,2054,101777670,1,1,3865,7,10,1,
                       3865,8,771,10,3849,3897,146,115,58,105,110,100,101,120,45,111,102,0,4,1793,
                       3911,68223234,1,6415,33883396,101450758,6404,3,1,3900,7,10,1,3900,1793,3920,18,2049,2897,772,
                       10,1,3915,1793,3929,2049,81,67502597,11,10,1,3924,2049,2154,1793,3939,3,1,-1,10,
                       1,3935,9,10,3883,3963,146,115,58,99,111,110,116,97,105,110,115,45,99,104,
                       97,114,63,0,2049,3897,1,-1,12,10,3943,3979,146,115,58,104,97,115,104,0,
                       1,5381,4,1793,3987,286458116,33,10,1,3984,2049,3863,10,3969,3999,133,83,114,99,0,
                       0,3992,4007,133,84,97,114,0,0,4000,4015,133,80,97,100,0,0,4008,4021,133,
                       73,0,0,4016,4027,133,70,0,0,4022,4034,133,65,116,0,0,4028,4048,146,116,
                       101,114,109,105,110,97,116,101,0,1,0,3841,4015,3841,4007,2049,81,17,16,10,
                       4035,4070,146,101,120,116,114,97,99,116,0,3841,3999,3841,4021,17,3841,4015,3841,4007,
                       2049,81,2049,3120,10,4059,4095,146,99,111,109,112,97,114,101,0,3841,4015,3841,4007,
                       2049,95,3841,4027,22,4097,4027,3841,4027,1793,4115,3841,4021,4097,4034,10,1,4110,2049,72,
                       10,4084,4128,146,110,101,120,116,0,1,4021,2049,2982,10,3969,4155,146,115,58,99,
                       111,110,116,97,105,110,115,45,115,116,114,105,110,103,63,0,4097,4007,4097,3999,
                       2049,3621,4097,4015,1,0,4097,4021,1,0,4097,4027,3841,3999,2049,81,1793,4186,2049,4070,
                       2049,4048,2049,4095,2049,4128,10,1,4177,2049,2270,3841,4027,10,4133,4200,133,83,116,114,
                       0,0,4193,4212,146,101,120,116,114,97,99,116,0,2049,2085,3841,4200,4,2049,3120,
                       3841,-1,67502597,17,1,0,4,16,10,4201,4237,146,99,104,101,99,107,0,1,4212,
                       2049,2095,1793,4248,1,2884,2049,2095,10,1,4243,2049,2095,3841,4200,2049,3979,67502597,11,10,
                       4228,4271,146,108,111,99,97,116,105,111,110,0,67503109,67503109,1793,4304,1793,4299,4,1793,
                       4285,67502597,2049,2521,21,10,1,4280,2049,2095,4,1793,4295,772,2,10,1,4292,9,10,
                       1,4277,2049,2095,10,1,4275,2049,2095,10,4259,4318,146,115,101,116,117,112,0,2049,
                       3621,4097,4200,1,0,67503109,67503109,1,81,1,3979,2049,2117,2049,3621,2049,3422,1793,4342,67502597,
                       2049,81,10,1,4338,2049,2095,4,10,4133,4369,146,115,58,105,110,100,101,120,45,
                       111,102,45,115,116,114,105,110,103,0,67502597,1793,4395,1793,4388,2049,4318,1793,4383,2049,
                       4237,2049,4271,10,1,4378,2049,2270,10,1,4374,2049,3446,771,3,10,1,4372,2049,2095,
                       18,1,2,18,1,-1,2049,2822,10,4348,4420,146,115,58,102,105,108,116,101,114,
                       0,1793,4448,2049,3621,2049,3422,4,1793,4440,2049,2085,4,8,1,3330,1,11,2049,64,
                       10,1,4429,2049,3863,3,2049,3296,10,1,4422,2049,3446,10,4408,4462,146,115,58,109,
                       97,112,0,1793,4484,2049,3621,2049,3422,4,1793,4476,67502597,8,2049,3330,10,1,4471,2049,
                       3863,3,2049,3296,10,1,4464,2049,3446,10,4453,4501,146,115,58,115,117,98,115,116,
                       114,0,1793,4507,17,2049,3621,10,1,4503,2049,2095,1793,4519,67502597,1,3120,2049,2095,10,
                       1,4513,2049,2105,67502597,1793,4532,17,1,0,4,16,10,1,4526,2049,2095,10,4489,4548,
                       146,115,58,114,105,103,104,116,0,67502597,2049,81,67502597,18,4,2049,4501,10,4537,4567,
                       146,115,58,108,101,102,116,0,1,0,4,2049,4501,10,4557,4591,146,115,58,98,
                       101,103,105,110,115,45,119,105,116,104,63,0,2,2049,81,1,13,2049,2095,2049,
                       4567,2049,95,10,4573,4619,146,115,58,101,110,100,115,45,119,105,116,104,63,0,
                       2,2049,81,1,13,2049,2095,2049,4548,2049,95,10,4603,4641,146,115,58,99,111,112,
                       121,0,67502597,2049,81,2049,2884,2049,3120,10,4631,4661,146,115,58,68,73,71,73,84,
                       83,0,2049,3640,48,49,50,51,52,53,54,55,56,57,0,1,4663,10,4649,4698,
                       146,115,58,65,83,67,73,73,45,76,79,87,69,82,67,65,83,69,0,2049,
                       3640,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,
                       116,117,118,119,120,121,122,0,1,4700,10,4677,4751,146,115,58,65,83,67,73,
                       73,45,85,80,80,69,82,67,65,83,69,0,2049,3640,65,66,67,68,69,70,
                       71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
                       0,1,4753,10,4730,4802,146,115,58,65,83,67,73,73,45,76,69,84,84,69,
                       82,83,0,2049,3640,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,
                       112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,
                       74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,0,1,4804,
                       10,4783,4877,146,115,58,80,85,78,67,84,85,65,84,73,79,78,0,2049,3640,
                       95,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,58,59,60,61,
                       62,63,64,91,92,93,94,96,123,124,125,126,0,1,4879,1,95,67502597,16,10,
                       4860,4935,133,115,58,87,72,73,84,69,83,80,65,67,69,0,32,9,10,13,
                       0,4919,4945,158,39,0,1,3621,2049,146,10,4940,4955,158,36,0,1,0,2049,133,
                       10,4950,0,133,65,83,67,73,73,58,78,85,76,0,4960,27,133,65,83,67,
                       73,73,58,69,83,67,0,4973,8,133,65,83,67,73,73,58,66,83,0,4986,
                       9,133,65,83,67,73,73,58,72,84,0,4998,10,133,65,83,67,73,73,58,
                       76,70,0,5010,11,133,65,83,67,73,73,58,86,84,0,5022,12,133,65,83,
                       67,73,73,58,70,70,0,5034,13,133,65,83,67,73,73,58,67,82,0,5046,
                       32,133,65,83,67,73,73,58,83,80,65,67,69,0,5058,127,133,65,83,67,
                       73,73,58,68,69,76,0,5073,1,133,65,83,67,73,73,58,83,79,72,0,
                       5086,2,133,65,83,67,73,73,58,83,84,88,0,5099,3,133,65,83,67,73,
                       73,58,69,84,88,0,5112,4,133,65,83,67,73,73,58,69,79,84,0,5125,
                       5,133,65,83,67,73,73,58,69,78,81,0,5138,6,133,65,83,67,73,73,
                       58,65,67,75,0,5151,7,133,65,83,67,73,73,58,66,69,76,0,5164,14,
                       133,65,83,67,73,73,58,83,79,0,5177,15,133,65,83,67,73,73,58,83,
                       73,0,5189,16,133,65,83,67,73,73,58,68,76,69,0,5201,17,133,65,83,
                       67,73,73,58,68,67,49,0,5214,18,133,65,83,67,73,73,58,68,67,50,
                       0,5227,19,133,65,83,67,73,73,58,68,67,51,0,5240,20,133,65,83,67,
                       73,73,58,68,67,52,0,5253,21,133,65,83,67,73,73,58,78,65,75,0,
                       5266,22,133,65,83,67,73,73,58,83,89,78,0,5279,23,133,65,83,67,73,
                       73,58,69,84,66,0,5292,24,133,65,83,67,73,73,58,67,65,78,0,5305,
                       25,133,65,83,67,73,73,58,69,77,0,5318,26,133,65,83,67,73,73,58,
                       83,85,66,0,5330,28,133,65,83,67,73,73,58,70,83,0,5343,29,133,65,
                       83,67,73,73,58,71,83,0,5355,30,133,65,83,67,73,73,58,82,83,0,
                       5367,31,133,65,83,67,73,73,58,85,83,0,5379,5407,146,99,58,108,111,119,
                       101,114,99,97,115,101,63,0,1,97,1,122,2049,2915,10,5391,5430,146,99,58,
                       117,112,112,101,114,99,97,115,101,63,0,1,65,1,90,2049,2915,10,5414,5450,
                       146,99,58,108,101,116,116,101,114,63,0,1,5407,1,5430,2049,2117,22,10,5437,
                       5470,146,99,58,100,105,103,105,116,63,0,1,48,1,57,2049,2915,10,5458,5491,
                       146,99,58,118,105,115,105,98,108,101,63,0,1,32,1,126,2049,2915,10,5477,
                       5510,146,99,58,118,111,119,101,108,63,0,2049,3640,97,101,105,111,117,65,69,
                       73,79,85,0,1,5512,4,2049,3963,10,5498,5545,146,99,58,99,111,110,115,111,
                       110,97,110,116,63,0,2,2049,5450,1793,5555,2049,5510,2049,2453,10,1,5550,1793,5563,
                       3,2049,2356,10,1,5559,2049,64,10,5529,5585,146,99,58,119,104,105,116,101,115,
                       112,97,99,101,63,0,1,4935,4,2049,3963,10,5568,5608,146,99,58,45,108,111,
                       119,101,114,99,97,115,101,63,0,2049,5407,2049,2453,10,5591,5630,146,99,58,45,
                       117,112,112,101,114,99,97,115,101,63,0,2049,5430,2049,2453,10,5613,5648,146,99,
                       58,45,100,105,103,105,116,63,0,2049,5470,2049,2453,10,5635,5671,146,99,58,45,
                       119,104,105,116,101,115,112,97,99,101,63,0,2049,5585,2049,2453,10,5653,5691,146,
                       99,58,45,118,105,115,105,98,108,101,63,0,2049,5491,2049,2453,10,5676,5709,146,
                       99,58,45,118,111,119,101,108,63,0,2049,5510,2049,2453,10,5696,5731,146,99,58,
                       45,99,111,110,115,111,110,97,110,116,63,0,2049,5545,2049,2453,10,5714,5750,146,
                       99,58,116,111,45,117,112,112,101,114,0,2,2049,5407,25,3,1,32,18,10,
                       5736,5773,146,99,58,116,111,45,108,111,119,101,114,0,2,2049,5430,25,3,1,
                       32,17,10,5759,5797,146,99,58,116,111,45,115,116,114,105,110,103,0,2049,3640,
                       46,0,1,5799,2049,3595,1,36,2049,2105,10,5782,5827,146,99,58,116,111,103,103,
                       108,101,45,99,97,115,101,0,2,2049,5407,1,5750,1,5773,2049,64,10,5810,5852,
                       146,99,58,116,111,45,110,117,109,98,101,114,0,2,2049,5470,1793,5861,1,48,
                       18,10,1,5857,1793,5869,3,1,0,10,1,5865,2049,64,10,5837,5888,146,115,58,
                       116,111,45,117,112,112,101,114,0,1,5750,2049,4462,10,5874,5907,146,115,58,116,
                       111,45,108,111,119,101,114,0,1,5773,2049,4462,10,5893,5927,146,115,58,116,114,
                       105,109,45,108,101,102,116,0,2049,3595,1793,5941,2049,56,1,5585,1,2537,2049,2117,
                       21,10,1,5931,2049,2222,2049,2897,10,5912,5964,146,115,58,116,114,105,109,45,114,
                       105,103,104,116,0,2049,3595,2049,3744,2049,5927,2049,3744,10,5948,5983,146,115,58,116,
                       114,105,109,0,2049,5964,2049,5927,10,5973,5999,146,99,111,114,114,101,99,116,0,
                       2,1,48,13,1793,6014,1,48,67502597,18,1,2,19,17,10,1,6005,9,10,5973,
                       6033,146,110,58,116,111,45,115,116,114,105,110,103,0,1793,6081,2049,1871,2049,3422,
                       2,2049,2849,1793,6059,1,10,20,4,1,48,17,2049,5999,2049,3330,2,2049,2537,10,
                       1,6044,2049,2222,3,2049,2556,1793,6073,1,45,2049,3330,10,1,6068,9,2049,3296,2049,
                       3744,10,1,6035,2049,3446,10,6018,6108,133,82,101,119,114,105,116,101,85,110,100,
                       101,114,115,99,111,114,101,115,0,-1,6086,6116,146,115,117,98,0,1,95,1793,
                       6123,1,32,10,1,6120,2049,2367,10,6109,6139,146,114,101,119,114,105,116,101,0,
                       3841,6108,1793,6148,1,6116,2049,4462,10,1,6143,9,10,6128,6162,146,104,97,110,100,
                       108,101,0,1,3698,8,10,6086,6177,158,115,105,103,105,108,58,39,0,2049,6139,
                       2049,6162,10,6166,6193,146,115,58,115,112,108,105,116,0,2049,2085,2049,3897,772,2049,
                       2085,2049,4567,1,38,2049,2095,10,6182,6228,146,115,58,115,112,108,105,116,45,111,
                       110,45,115,116,114,105,110,103,0,2049,2085,2049,4369,2049,2884,772,2049,2085,2049,4567,
                       1,38,2049,2095,10,6207,6257,146,115,58,114,101,112,108,97,99,101,0,67502597,2049,
                       81,2049,1871,16,1793,6273,2049,6228,4,2049,1871,15,17,10,1,6265,2049,2095,2049,3804,
                       2049,3845,10,6244,6294,133,83,112,108,105,116,45,79,110,0,0,6282,6305,146,109,
                       97,116,99,104,63,0,3841,6294,11,10,6295,6322,146,116,101,114,109,105,110,97,
                       116,101,0,1,0,67502597,2049,2897,16,10,6309,6337,146,115,116,101,112,0,1,2884,
                       2049,2095,2049,6305,1793,6351,2,2049,107,2049,6322,10,1,6345,9,10,6244,6369,146,115,
                       58,116,111,107,101,110,105,122,101,0,4097,6294,2049,3666,2049,1871,1,0,2049,107,
                       1793,6391,2,2049,107,2,1,6337,2049,3863,3,10,1,6381,2049,2095,2049,1871,67502597,18,
                       2049,2897,67502597,16,10,6355,6414,133,78,101,101,100,108,101,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,6404,6549,133,76,101,110,0,0,6542,6560,133,84,111,107,101,110,115,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,0,6550,6694,133,84,80,0,0,6688,6703,146,115,
                       97,118,101,0,2049,3666,3841,6694,1,6560,17,2049,2884,16,1,6694,2049,2982,10,6695,
                       6726,146,110,101,120,116,0,1793,6732,3841,6549,17,10,1,6728,2049,2105,10,6718,6746,
                       146,100,111,110,101,63,0,2049,81,2049,2521,10,6355,6775,146,115,58,116,111,107,
                       101,110,105,122,101,45,111,110,45,115,116,114,105,110,103,0,1,0,4097,6694,
                       1793,6789,2,1,6414,2049,4641,2049,3845,10,1,6781,1793,6798,2049,81,4097,6549,10,1,
                       6793,2049,2117,1793,6815,1,6414,2049,6228,2049,6703,2049,6726,2049,6746,10,1,6804,2049,2245,
                       1,6560,3841,6694,2049,2897,4097,6560,10,6751,6840,146,102,111,114,45,101,97,99,104,
                       0,4,2049,56,1,13,2049,2095,1793,6856,5,2049,56,84018692,525572,1542,10,1,6849,2049,
                       2270,771,10,6828,6876,146,115,117,98,115,116,105,116,117,116,101,0,2049,3511,1,
                       129,18,10,6862,6893,146,101,120,116,114,97,99,116,0,2049,6876,2049,4641,10,6882,
                       6910,146,116,111,107,101,110,105,122,101,0,2049,6775,2049,3621,10,6898,6926,146,99,
                       111,109,98,105,110,101,0,2049,6876,2049,3845,2049,3845,10,6915,6942,146,109,101,114,
                       103,101,0,4,1,6926,2049,6840,772,10,6933,6961,146,102,105,110,100,45,101,110,
                       100,0,2,2049,81,2049,6876,2049,81,18,67502597,17,10,6949,6981,146,99,108,101,97,
                       110,0,2049,6961,1,0,4,16,10,6751,7005,146,115,58,114,101,112,108,97,99,
                       101,45,97,108,108,0,1,3,1793,7020,2049,6893,2049,6910,2049,6942,2049,6981,2049,3595,
                       10,1,7009,2049,3073,10,6988,7033,146,99,104,97,114,0,1,32,1793,7042,1,95,
                       2049,3330,10,1,7037,2049,2367,1,114,1793,7055,1,13,2049,3330,10,1,7050,2049,2367,
                       1,110,1793,7068,1,10,2049,3330,10,1,7063,2049,2367,1,116,1793,7081,1,9,2049,
                       3330,10,1,7076,2049,2367,1,48,1793,7094,1,0,2049,3330,10,1,7089,2049,2367,1,
                       94,1793,7107,1,27,2049,3330,10,1,7102,2049,2367,2049,3330,10,7025,7122,146,116,121,
                       112,101,0,1,99,1793,7130,4,2049,3330,10,1,7126,2049,2367,1,115,1793,7144,4,
                       1,3330,2049,3863,10,1,7138,2049,2367,1,110,1793,7160,4,2049,6033,1,3330,2049,3863,
                       10,1,7152,2049,2367,3,10,7114,7176,146,104,97,110,100,108,101,0,1,92,1793,
                       7185,2049,56,2049,7033,10,1,7180,2049,2367,1,37,1793,7198,2049,56,2049,7122,10,1,
                       7193,2049,2367,2049,3330,10,6988,7217,146,115,58,102,111,114,109,97,116,0,1793,7246,
                       2049,3621,1793,7241,2049,3422,1793,7236,2049,56,25,2049,7176,1,7227,7,10,1,7227,8,
                       3,10,1,7223,2049,2105,10,1,7219,2049,3446,10,7205,7262,146,115,58,99,111,110,
                       115,116,0,1,3666,2049,2095,2049,2011,10,7251,7279,133,86,97,108,117,101,115,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,7269,7315,146,102,114,111,109,0,2049,81,2,1793,
                       7333,1793,7326,1,7279,4113,10,1,7322,2049,2105,2049,2897,10,1,7320,2049,2270,3,10,
                       7307,7345,146,116,111,0,2,2049,81,1793,7361,2049,56,1,97,18,2049,2884,1,7279,
                       266001,10,1,7350,2049,2270,3,10,7251,7378,146,114,101,111,114,100,101,114,0,1,
                       7315,2049,2095,2049,7345,10,7367,7394,146,99,117,114,114,121,0,2049,1871,1793,7404,4,
                       2049,1728,2049,1751,10,1,7398,2049,2095,10,7385,7417,146,100,111,101,115,0,2049,1587,
                       4,2049,7394,2049,1570,2049,160,16,1,146,2049,1646,10,7409,7446,146,100,58,102,111,
                       114,45,101,97,99,104,0,1,2,1793,7472,6415,2049,2085,1793,7464,1793,7459,2052,10,
                       1,7457,2049,2095,10,1,7455,2049,2095,1,7450,7,10,1,7450,8,3,10,7432,7492,
                       146,100,58,108,111,111,107,117,112,45,120,116,0,1,0,4,1793,7517,2049,2085,
                       2049,160,2831,1793,7510,4,1,2046,2049,2095,10,1,7504,1,11,2049,64,10,1,7497,
                       2049,7446,3,10,7477,7535,146,97,58,108,101,110,103,116,104,0,15,10,7523,7558,
                       146,97,58,99,111,117,110,116,101,100,45,114,101,115,117,108,116,115,0,8,
                       2049,1871,1793,7571,2,2049,107,1,107,2049,2270,10,1,7563,2049,2095,10,7537,7593,146,
                       97,58,102,114,111,109,45,115,116,114,105,110,103,0,2049,1871,1793,7607,2,2049,
                       81,2049,107,1,107,2049,3863,10,1,7597,2049,2095,10,7576,7626,146,97,58,102,111,
                       114,45,101,97,99,104,0,4,2049,56,1,13,2049,2095,1793,7642,5,2049,56,84018692,
                       525572,1542,10,1,7635,2049,2270,771,10,7612,7657,146,97,58,100,117,112,0,2049,1871,
                       1793,7670,2,15,2049,107,1,107,2049,7626,10,1,7661,2049,2095,10,7648,7685,146,97,
                       58,99,111,112,121,0,1,3,1793,7701,4097,3,2,2049,7535,2049,107,1,107,2049,
                       7626,10,1,7689,2049,3073,10,7675,7721,146,97,58,116,111,45,115,116,114,105,110,
                       103,0,1,3,1793,7734,2049,7657,1,0,2049,107,2049,2884,10,1,7725,2049,3073,2049,
                       3595,10,7706,7753,146,97,58,97,112,112,101,110,100,0,2049,2085,1,34,2049,2143,
                       17,2049,1871,1793,7778,2049,107,1793,7773,1,107,2049,7626,10,1,7768,2049,2143,10,1,
                       7764,2049,2095,10,7741,7796,146,97,58,112,114,101,112,101,110,100,0,4,2049,7753,
                       10,7783,7810,146,97,58,99,104,111,112,0,2049,7657,1,-1,2049,3054,2,2049,2997,
                       10,7800,7832,146,97,58,102,105,108,116,101,114,0,1793,7847,67502597,1,21,2049,2095,
                       4,1,107,1,11,2049,64,10,1,7834,2049,7394,2049,1871,1793,7862,67502597,15,2049,107,
                       2049,7626,10,1,7855,2049,2095,2049,1871,67502597,18,2049,2897,67502597,16,10,7820,7890,146,97,
                       58,99,111,110,116,97,105,110,115,63,0,1,0,4,1793,7902,4,5,67502597,11,
                       6,22,10,1,7895,2049,7626,772,10,7875,7930,146,97,58,99,111,110,116,97,105,
                       110,115,45,115,116,114,105,110,103,63,0,1,0,4,1793,7943,4,5,67502597,2049,
                       95,6,22,10,1,7935,2049,7626,772,10,7908,7958,146,97,58,109,97,112,0,1793,
                       7964,8,2049,107,10,1,7960,2049,7394,2049,1871,1793,7979,67502597,15,2049,107,2049,7626,10,
                       1,7972,2049,2095,10,7949,7997,146,97,58,114,101,118,101,114,115,101,0,2049,1871,
                       1793,8031,2049,56,1793,8009,17,2049,2897,10,1,8005,2049,2105,2,2049,107,1793,8025,2,
                       15,2049,107,2049,2897,10,1,8018,2049,2270,3,10,1,8001,2049,2095,10,7984,8044,146,
                       97,58,116,104,0,17,2049,2884,10,8036,8059,146,97,58,102,101,116,99,104,0,
                       2049,8044,15,10,8048,8074,146,97,58,115,116,111,114,101,0,2049,8044,16,10,8063,
                       8090,146,97,58,114,101,100,117,99,101,0,1,13,2049,2095,2049,7626,10,8078,8109,
                       146,105,100,101,110,116,105,102,121,0,1,-1,4,1,0,1793,8140,2049,2344,11,
                       1793,8134,67502597,1,-1,11,1793,8130,772,2,10,1,8127,9,10,1,8121,9,2049,2884,
                       10,1,8116,2049,8090,3,10,8078,8160,146,97,58,105,110,100,101,120,45,111,102,
                       0,1,3,1793,8173,1,26,2049,7394,2049,7958,2049,8109,10,1,8164,2049,3073,10,8146,
                       8199,146,97,58,105,110,100,101,120,45,111,102,45,115,116,114,105,110,103,0,
                       1,3,1793,8212,1,95,2049,7394,2049,7958,2049,8109,10,1,8203,2049,3073,10,8178,8227,
                       146,97,58,109,97,107,101,0,2049,7558,2,2,1,3,1793,8238,2049,7997,10,1,
                       8235,2049,3073,4,2049,7685,10,8217,8251,158,123,0,1,288,2049,158,1,1556,2049,146,
                       1,288,2049,158,10,8246,8269,158,125,0,1,304,2049,158,1,2095,2049,146,1,1556,
                       2049,146,1,13,2049,152,1,40,2049,152,1,2897,2049,146,1,304,2049,158,1,8227,
                       2049,146,10,8264,8313,146,98,111,117,110,100,115,63,0,67502597,2049,7535,67502597,13,10,
                       8302,8327,146,99,111,112,121,0,2049,56,2049,107,10,8319,8342,146,116,111,45,101,
                       110,100,0,2,2049,7535,17,2049,2884,10,8264,8359,146,97,58,108,101,102,116,0,
                       2049,8313,1793,8367,771,1,-1,10,1,8363,2049,2647,2049,1871,67502597,2049,107,1793,8388,1,
                       2884,2049,2095,1,8327,2049,2270,3,10,1,8378,2049,2095,10,8349,8404,146,97,58,114,
                       105,103,104,116,0,2049,8313,1793,8412,771,1,-1,10,1,8408,2049,2647,2049,1871,67502597,
                       2049,107,1793,8435,4,2049,8342,67502597,18,4,1,8327,2049,2270,3,10,1,8423,2049,2095,
                       10,8393,8452,146,97,58,109,105,100,100,108,101,0,1,2037,2049,2095,4,67502597,2049,
                       8313,1793,8467,771,3,1,-1,10,1,8462,2049,2647,771,2049,2085,4,18,2049,2884,2049,
                       1871,67502597,2049,107,1793,8502,772,1793,8492,17,2049,2884,10,1,8488,2049,2095,1,8327,2049,
                       2270,3,10,1,8485,2049,2095,10,8440,8515,133,70,108,97,103,0,0,8507,8527,146,
                       99,111,109,112,97,114,101,0,67440386,184946434,10,8516,8540,146,108,101,110,103,116,104,
                       0,659202,10,8530,8550,146,110,101,120,116,0,17043713,1,1,2577,10,8542,8568,146,110,
                       111,116,45,101,113,117,97,108,0,50529030,2561,0,10,8555,8580,146,108,111,111,112,
                       0,524549,8550,2049,8527,18157313,8515,8515,16,420610310,1,1,8580,7,10,8440,8603,146,97,58,
                       101,113,63,0,1048833,-1,8515,2049,8527,151066369,-1,8568,2049,8540,2049,8580,251724547,8515,10,8594,
                       8628,146,97,58,45,101,113,63,0,2049,8603,2049,2453,10,8618,8651,146,97,58,98,
                       101,103,105,110,115,45,119,105,116,104,63,0,1,3,1793,8667,2,2049,7535,1,
                       13,2049,2095,2049,8359,2049,8603,10,1,8655,2049,3073,10,8633,8688,146,97,58,101,110,
                       100,115,45,119,105,116,104,63,0,1,3,1793,8704,2,2049,7535,1,13,2049,2095,
                       2049,8404,2049,8603,10,1,8692,2049,3073,10,8672,8725,146,99,117,114,114,101,110,116,
                       45,108,105,110,101,0,2049,3511,1,1025,18,10,8709,8747,146,99,111,117,110,116,
                       45,116,111,107,101,110,115,0,1793,8753,1,32,11,10,1,8749,2049,4420,2049,81,
                       10,8731,8778,146,112,114,111,99,101,115,115,45,116,111,107,101,110,115,0,1793,
                       8806,1,32,2049,6193,4,1793,8799,2,2049,81,2049,2537,1,368,1,11,2049,64,10,
                       1,8787,2049,2095,2049,2884,10,1,8780,2049,2270,2049,368,10,8672,8827,146,115,58,101,
                       118,97,108,117,97,116,101,0,2049,8725,2049,4641,2049,8725,2,2049,8747,2049,8778,10,
                       8813,8845,133,76,80,0,0,8839,8855,133,73,110,100,101,120,0,0,9,0,0,
                       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                       0,0,0,0,0,0,0,0,8846,8895,146,110,101,120,116,0,3841,8845,1,8855,
                       17,2049,2982,10,8887,8911,146,112,114,101,112,0,1,8845,2049,2982,1,0,3841,8845,
                       1,8855,17,16,10,8903,8932,146,100,111,110,101,0,1,8845,2049,2997,10,8813,8942,
                       146,73,0,3841,8845,1,8855,17,15,10,8937,8954,146,74,0,3841,8845,1,8855,17,
                       2049,2897,15,10,8949,8968,146,75,0,3841,8845,1,8855,17,1,2,18,15,10,8963,
                       8995,146,105,110,100,101,120,101,100,45,116,105,109,101,115,0,2049,8911,4,1793,
                       9011,25,33886721,1,2053,1542,2049,8895,1,9000,7,10,1,9000,8,3,2049,8932,10,8978,
                       9026,158,104,111,111,107,0,2049,3640,108,105,106,117,46,46,46,46,0,1,9028,
                       2049,415,2049,1871,2049,2884,2049,107,10,9018,9060,146,115,101,116,45,104,111,111,107,
                       0,2049,2884,16,10,9048,9074,146,117,110,104,111,111,107,0,2049,2884,2,2049,2884,
                       4,16,10,9064,9098,146,105,111,58,101,110,117,109,101,114,97,116,101,0,27,
                       10,9082,9112,146,105,111,58,113,117,101,114,121,0,28,10,9100,9127,146,105,111,
                       58,105,110,118,111,107,101,0,29,10,9114,9144,146,105,111,58,115,99,97,110,
                       45,102,111,114,0,1,-1,4,2049,9098,1793,9175,2049,8942,2049,9112,772,67502597,11,1793,
                       9171,1793,9166,3,2049,8942,10,1,9162,2049,2095,10,1,9160,9,10,1,9151,2049,8995,
                       3,10,9129,9190,146,99,58,112,117,116,0,1793,9192,1,0,2049,9127,10,9181,9203,
                       146,110,108,0,1,10,2049,9190,10,9197,9214,146,115,112,0,1,32,2049,9190,10,
                       9208,9226,146,116,97,98,0,1,9,2049,9190,10,9219,9240,146,115,58,112,117,116,
                       0,1,9190,2049,3863,10,9231,9254,146,110,58,112,117,116,0,2049,6033,2049,9240,10,
                       9245,9268,146,114,101,115,101,116,0,2049,1556,25,771,1,9268,7,10,9259,9290,146,
                       100,117,109,112,45,115,116,97,99,107,0,2049,1556,25,134284547,9290,134283782,9254,2049,9214,
                       10,9276,9308,146,70,82,69,69,0,2049,3511,1,1025,18,2049,1871,18,10,9300,9326,
                       133,70,105,108,101,115,0,2,9317,9339,146,105,100,101,110,116,105,102,121,0,
                       3841,9326,2049,2521,25,3,1,4,2049,9144,2,2049,2556,1793,9394,3,2049,3640,73,79,
                       32,68,69,86,73,67,69,32,84,89,80,69,32,48,48,48,52,32,78,79,
                       84,32,70,79,85,78,68,0,1,9357,2049,9240,2049,9203,10,1,9354,1793,9401,4097,
                       9326,10,1,9398,2049,64,10,9300,9424,146,102,105,108,101,58,111,112,101,114,97,
                       116,105,111,110,0,2049,9339,3841,9326,2049,9127,10,9406,0,133,102,105,108,101,58,
                       82,0,9431,1,133,102,105,108,101,58,87,0,9441,2,133,102,105,108,101,58,
                       65,0,9451,3,133,102,105,108,101,58,82,43,0,9461,9485,146,102,105,108,101,
                       58,111,112,101,110,0,1,0,2049,9424,10,9472,9504,146,102,105,108,101,58,99,
                       108,111,115,101,0,1,1,2049,9424,10,9490,9522,146,102,105,108,101,58,114,101,
                       97,100,0,1,2,2049,9424,10,9509,9541,146,102,105,108,101,58,119,114,105,116,
                       101,0,1,3,2049,9424,10,9527,9559,146,102,105,108,101,58,116,101,108,108,0,
                       1,4,2049,9424,10,9546,9577,146,102,105,108,101,58,115,101,101,107,0,1,5,
                       2049,9424,10,9564,9595,146,102,105,108,101,58,115,105,122,101,0,1,6,2049,9424,
                       10,9582,9615,146,102,105,108,101,58,100,101,108,101,116,101,0,1,7,2049,9424,
                       10,9600,9634,146,102,105,108,101,58,102,108,117,115,104,0,1,8,2049,9424,10,
                       9620,9655,146,102,105,108,101,58,101,120,105,115,116,115,63,0,1,0,2049,9485,
                       2,2049,2537,1793,9669,2049,9504,2049,2344,10,1,9664,1793,9677,3,2049,2356,10,1,9673,
                       2049,64,10,9639,9707,146,102,105,108,101,58,111,112,101,110,45,102,111,114,45,
                       114,101,97,100,105,110,103,0,1,0,2049,9485,2,2049,9595,4,10,9682,9740,146,
                       102,105,108,101,58,111,112,101,110,45,102,111,114,45,97,112,112,101,110,100,
                       0,1,2,2049,9485,2,2049,9595,4,10,9716,9774,146,102,105,108,101,58,111,112,
                       101,110,45,102,111,114,45,119,114,105,116,105,110,103,0,1,1,2049,9485,10,
                       9749,9786,133,70,73,68,0,0,9779,9795,133,83,105,122,101,0,0,9787,9806,133,
                       65,99,116,105,111,110,0,0,9796,9817,133,66,117,102,102,101,114,0,0,9807,
                       9827,146,45,101,111,102,63,0,3841,9786,2049,9559,3841,9795,13,10,9818,9847,146,112,
                       114,101,115,101,114,118,101,0,1,9786,1793,9858,1,9795,1,21,2049,3073,10,1,
                       9851,2049,3073,10,9749,9881,146,102,105,108,101,58,114,101,97,100,45,108,105,110,
                       101,0,4097,9786,1793,9938,2049,1871,2,4097,9817,2049,3422,1793,9930,3841,9786,2049,9522,2,
                       2049,3330,1793,9907,1,13,11,10,1,9903,1793,9915,1,10,11,10,1,9911,1793,9923,
                       1,0,11,10,1,9919,2049,2154,22,22,10,1,9894,2049,2245,2049,3354,3,10,1,
                       9885,2049,3446,3841,9817,10,9863,9967,146,102,105,108,101,58,102,111,114,45,101,97,
                       99,104,45,108,105,110,101,0,1793,9998,4097,9806,2049,9707,4097,9786,4097,9795,1793,9989,
                       3841,9786,2049,9881,3841,9806,8,2049,9827,10,1,9979,2049,2222,3841,9786,2049,9504,10,1,
                       9969,2049,9847,10,9945,10010,133,70,73,68,0,0,9945,10025,146,102,105,108,101,58,
                       115,108,117,114,112,0,1793,10052,4,2049,3422,2049,9707,4097,10010,1793,10043,3841,10010,2049,
                       9522,2049,3330,10,1,10036,2049,2270,3841,10010,2049,9504,10,1,10027,2049,3446,10,10011,10070,
                       146,102,105,108,101,58,115,112,101,119,0,2049,9774,4,1793,10079,67502597,2049,9541,10,
                       1,10075,2049,3863,2049,9504,10,10057,10105,146,102,108,111,97,116,58,111,112,101,114,
                       97,116,105,111,110,0,1,2,2049,9144,2049,9127,10,10086,10126,146,110,58,116,111,
                       45,102,108,111,97,116,0,1,0,2049,10105,10,10112,10145,146,115,58,116,111,45,
                       102,108,111,97,116,0,1,1,2049,10105,10,10131,10165,146,102,58,116,111,45,110,
                       117,109,98,101,114,0,1,2,2049,10105,10,10150,10185,146,102,58,116,111,45,115,
                       116,114,105,110,103,0,2049,3621,2,1,3,2049,10105,10,10170,10200,146,102,58,43,
                       0,1,4,2049,10105,10,10193,10212,146,102,58,45,0,1,5,2049,10105,10,10205,10224,
                       146,102,58,42,0,1,6,2049,10105,10,10217,10236,146,102,58,47,0,1,7,2049,
                       10105,10,10229,10252,146,102,58,102,108,111,111,114,0,1,8,2049,10105,10,10241,10270,
                       146,102,58,99,101,105,108,105,110,103,0,1,9,2049,10105,10,10257,10285,146,102,
                       58,115,113,114,116,0,1,10,2049,10105,10,10275,10299,146,102,58,101,113,63,0,
                       1,11,2049,10105,10,10290,10314,146,102,58,45,101,113,63,0,1,12,2049,10105,10,
                       10304,10328,146,102,58,108,116,63,0,1,13,2049,10105,10,10319,10342,146,102,58,103,
                       116,63,0,1,14,2049,10105,10,10333,10358,146,102,58,100,101,112,116,104,0,1,
                       15,2049,10105,10,10347,10372,146,102,58,100,117,112,0,1,16,2049,10105,10,10363,10387,
                       146,102,58,100,114,111,112,0,1,17,2049,10105,10,10377,10402,146,102,58,115,119,
                       97,112,0,1,18,2049,10105,10,10392,10416,146,102,58,108,111,103,0,1,19,2049,
                       10105,10,10407,10432,146,102,58,112,111,119,101,114,0,1,20,2049,10105,10,10421,10446,
                       146,102,58,115,105,110,0,1,21,2049,10105,10,10437,10460,146,102,58,99,111,115,
                       0,1,22,2049,10105,10,10451,10474,146,102,58,116,97,110,0,1,23,2049,10105,10,
                       10465,10489,146,102,58,97,115,105,110,0,1,24,2049,10105,10,10479,10504,146,102,58,
                       97,99,111,115,0,1,25,2049,10105,10,10494,10519,146,102,58,97,116,97,110,0,
                       1,26,2049,10105,10,10509,10534,146,102,58,112,117,115,104,0,1,27,2049,10105,10,
                       10524,10548,146,102,58,112,111,112,0,1,28,2049,10105,10,10539,10565,146,102,58,97,
                       100,101,112,116,104,0,1,29,2049,10105,10,10553,10580,146,102,58,111,118,101,114,
                       0,2049,10534,2049,10372,2049,10548,2049,10402,10,10570,10599,146,102,58,116,117,99,107,0,
                       2049,10372,2049,10534,2049,10402,2049,10548,10,10589,10617,146,102,58,110,105,112,0,2049,10402,
                       2049,10387,10,10608,10637,146,102,58,100,114,111,112,45,112,97,105,114,0,2049,10387,
                       2049,10387,10,10622,10656,146,102,58,100,117,112,45,112,97,105,114,0,2049,10580,2049,
                       10580,10,10642,10670,146,102,58,114,111,116,0,2049,10534,2049,10402,2049,10548,2049,10402,10,
                       10661,10690,158,115,105,103,105,108,58,46,0,2049,1815,1,3666,1,3595,2049,64,1,
                       10145,2049,146,10,10679,10715,146,102,58,115,113,117,97,114,101,0,2049,10372,2049,10224,
                       10,10703,10735,146,102,58,112,111,115,105,116,105,118,101,63,0,1,0,2049,10126,
                       2049,10342,10,10720,10757,146,102,58,110,101,103,97,116,105,118,101,63,0,1,0,
                       2049,10126,2049,10328,10,10742,10776,146,102,58,110,101,103,97,116,101,0,1,-1,2049,
                       10126,2049,10224,10,10764,10792,146,102,58,97,98,115,0,2049,10372,2049,10757,1,10776,9,
                       10,10783,10809,146,102,58,112,117,116,0,2049,10185,2049,9240,10,10800,10822,146,102,58,
                       80,73,0,2049,3640,51,46,49,52,49,53,57,50,0,1,10824,2049,10145,10,10814,
                       10845,146,102,58,69,0,2049,3640,50,46,55,49,56,50,56,49,0,1,10847,2049,
                       10145,10,10838,10870,146,102,58,78,65,78,0,2049,3640,48,0,1,10872,2049,10145,2049,
                       3640,48,0,1,10880,2049,10145,2049,10236,10,10861,10898,146,102,58,73,78,70,0,2049,
                       3640,49,46,48,0,1,10900,2049,10145,2049,3640,48,0,1,10910,2049,10145,2049,10236,10,
                       10889,10929,146,102,58,45,73,78,70,0,2049,3640,45,49,46,48,0,1,10931,2049,
                       10145,2049,3640,48,0,1,10942,2049,10145,2049,10236,10,10919,10961,146,102,58,110,97,110,
                       63,0,2049,10372,2049,10314,10,10951,10976,146,102,58,105,110,102,63,0,2049,10898,2049,
                       10299,10,10966,10992,146,102,58,45,105,110,102,63,0,2049,10929,2049,10299,10,10981,11008,
                       146,102,58,114,111,117,110,100,0,2049,10372,2049,10757,1793,11029,2049,3640,48,46,53,
                       0,1,11016,2049,10145,2049,10212,2049,10270,10,1,11014,1793,11048,2049,3640,48,46,53,0,
                       1,11035,2049,10145,2049,10200,2049,10252,10,1,11033,2049,64,10,10997,11062,146,102,58,109,
                       105,110,0,2049,10656,2049,10328,1,10387,1,10617,2049,64,10,11053,11082,146,102,58,109,
                       97,120,0,2049,10656,2049,10342,1,10387,1,10617,2049,64,10,11073,11104,146,102,58,108,
                       105,109,105,116,0,2049,10402,2049,10534,2049,11062,2049,10548,2049,11082,10,11093,11129,146,102,
                       58,98,101,116,119,101,101,110,63,0,2049,10670,2049,10372,2049,10534,2049,10670,2049,10670,
                       2049,11104,2049,10548,2049,10299,10,11115,11155,146,102,58,105,110,99,0,2049,3640,49,0,
                       1,11157,2049,10145,2049,10200,10,11146,11175,146,102,58,100,101,99,0,2049,3640,49,0,
                       1,11177,2049,10145,2049,10212,10,11166,11196,146,102,58,99,97,115,101,0,2049,10580,2049,
                       10299,1793,11208,2049,10387,8,1,-1,10,1,11202,1793,11216,3,1,0,10,1,11212,2049,
                       64,25,6,771,10,11186,11234,146,102,58,115,105,103,110,0,2049,10372,2049,3640,48,
                       0,1,11238,2049,10145,2049,10299,1793,11253,1,0,2049,10387,10,1,11248,2049,2647,2049,3640,
                       48,0,1,11259,2049,10145,2049,10342,1793,11272,1,1,10,1,11269,1793,11279,1,-1,10,
                       1,11276,2049,64,10,11224,2147483645,133,101,58,77,65,88,0,11284,-2147483645,133,101,58,77,
                       73,78,0,11293,-2147483647,133,101,58,78,65,78,0,11302,2147483646,133,101,58,73,78,70,
                       0,11311,-2147483646,133,101,58,45,73,78,70,0,11320,11338,146,101,58,110,63,0,1,
                       -2147483645,2049,2884,1,2147483645,2049,2897,2049,2915,10,11330,11359,146,101,58,109,97,120,63,0,
                       1,2147483645,11,10,11349,11373,146,101,58,109,105,110,63,0,1,-2147483645,11,10,11363,11388,
                       146,101,58,122,101,114,111,63,0,2049,2521,10,11377,11401,146,101,58,110,97,110,
                       63,0,1,-2147483647,11,10,11391,11415,146,101,58,105,110,102,63,0,1,2147483646,11,10,
                       11405,11430,146,101,58,45,105,110,102,63,0,1,-2147483646,11,10,11419,11444,146,101,58,
                       99,108,105,112,0,1,-2147483645,1,2147483645,2049,2867,10,11434,11459,146,102,58,69,49,0,
                       1793,11461,2049,3640,49,46,101,53,0,1,11463,2049,10145,10,11451,11490,146,102,58,115,
                       105,103,110,101,100,45,115,113,114,116,0,2049,10372,2049,11234,2049,10792,2049,10285,2049,
                       10126,2049,10224,10,11473,11522,146,102,58,115,105,103,110,101,100,45,115,113,117,97,
                       114,101,0,2049,10372,2049,11234,2049,10372,2049,10224,2049,10126,2049,10224,10,11503,11547,146,102,
                       58,45,115,104,105,102,116,0,2049,11459,2049,10224,10,11535,11564,146,102,58,43,115,
                       104,105,102,116,0,2049,11459,2049,10236,10,11552,11582,146,102,58,43,101,110,99,111,
                       100,101,0,2049,11490,2049,11547,10,11569,11600,146,102,58,45,101,110,99,111,100,101,
                       0,2049,10372,2049,11234,2049,11564,2049,10372,2049,10224,2049,10126,2049,10224,10,11503,11625,146,102,
                       58,116,111,45,101,0,2049,10372,2049,10961,1793,11636,2049,10387,1,-2147483647,10,1,11631,2049,
                       2647,2049,10372,2049,10976,1793,11651,2049,10387,1,2147483646,10,1,11646,2049,2647,2049,10372,2049,10992,
                       1793,11666,2049,10387,1,-2147483646,10,1,11661,2049,2647,2049,11582,2049,11008,2049,10165,2049,11444,1,
                       -2147483645,1,10387,2049,2367,1,2147483645,1,10387,2049,2367,10,11615,11701,146,101,58,116,111,45,
                       102,0,1,-2147483647,1,10870,2049,2367,1,2147483646,1,10898,2049,2367,1,-2147483646,1,10929,2049,2367,
                       2049,10126,2049,11600,10,11691,11735,146,102,58,115,116,111,114,101,0,1,11625,2049,2095,
                       16,10,11724,11752,146,102,58,102,101,116,99,104,0,15,2049,11701,10,11741,11772,146,
                       102,58,100,117,109,112,45,115,116,97,99,107,0,2049,10358,2,1,10534,2049,2270,
                       1793,11790,2049,10548,2049,10372,2049,10809,2049,9214,10,1,11781,2049,2270,10,11756,11812,146,102,
                       58,100,117,109,112,45,97,115,116,97,99,107,0,2049,10565,2,1,10548,2049,2270,
                       1793,11830,2049,10372,2049,10809,2049,9214,2049,10534,10,1,11821,2049,2270,10,11795,11844,146,101,
                       58,112,117,116,0,1,2147483645,1793,11861,2049,3640,101,58,77,65,88,0,1,11850,2049,
                       9240,10,1,11848,2049,2367,1,-2147483645,1793,11882,2049,3640,101,58,77,73,78,0,1,11871,
                       2049,9240,10,1,11869,2049,2367,1,0,1793,11901,2049,3640,101,58,48,0,1,11892,2049,
                       9240,10,1,11890,2049,2367,1,-2147483647,1793,11922,2049,3640,101,58,78,65,78,0,1,11911,
                       2049,9240,10,1,11909,2049,2367,1,2147483646,1793,11943,2049,3640,101,58,73,78,70,0,1,
                       11932,2049,9240,10,1,11930,2049,2367,1,-2147483646,1793,11965,2049,3640,101,58,45,73,78,70,
                       0,1,11953,2049,9240,10,1,11951,2049,2367,2049,11701,2049,10809,10,11835,11982,133,85,110,
                       105,120,0,0,11974,11995,146,105,100,101,110,116,105,102,121,0,3841,11982,2049,2521,
                       25,3,1,8,2049,9144,2,2049,2556,1793,12050,3,2049,3640,73,79,32,68,69,86,
                       73,67,69,32,84,89,80,69,32,48,48,48,56,32,78,79,84,32,70,79,
                       85,78,68,0,1,12013,2049,9240,2049,9203,10,1,12010,1793,12057,4097,11982,10,1,12054,
                       2049,64,10,11835,12081,146,105,111,58,117,110,105,120,45,115,121,115,99,97,108,
                       108,0,2049,11995,3841,11982,2049,9127,10,12062,12103,146,117,110,105,120,58,115,121,115,
                       116,101,109,0,1,0,2049,12081,10,12088,12121,146,117,110,105,120,58,102,111,114,
                       107,0,1,1,2049,12081,10,12108,12140,146,117,110,105,120,58,101,120,101,99,48,
                       0,1,2,2049,12081,10,12126,12159,146,117,110,105,120,58,101,120,101,99,49,0,
                       1,3,2049,12081,10,12145,12178,146,117,110,105,120,58,101,120,101,99,50,0,1,
                       4,2049,12081,10,12164,12197,146,117,110,105,120,58,101,120,101,99,51,0,1,5,
                       2049,12081,10,12183,12215,146,117,110,105,120,58,101,120,105,116,0,1,6,2049,12081,
                       10,12202,12235,146,117,110,105,120,58,103,101,116,112,105,100,0,1,7,2049,12081,
                       10,12220,12253,146,117,110,105,120,58,119,97,105,116,0,1,8,2049,12081,10,12240,
                       12271,146,117,110,105,120,58,107,105,108,108,0,1,9,2049,12081,10,12258,12290,146,
                       117,110,105,120,58,112,111,112,101,110,0,1,10,2049,12081,10,12276,12310,146,117,
                       110,105,120,58,112,99,108,111,115,101,0,1,11,2049,12081,10,12295,12329,146,117,
                       110,105,120,58,99,104,100,105,114,0,1,13,2049,12081,10,12315,12349,146,117,110,
                       105,120,58,103,101,116,101,110,118,0,1,14,2049,12081,10,12334,12369,146,117,110,
                       105,120,58,112,117,116,101,110,118,0,1,15,2049,12081,10,12354,12388,146,117,110,
                       105,120,58,115,108,101,101,112,0,1,16,2049,12081,10,12374,12406,146,117,110,105,
                       120,58,112,105,112,101,0,1,0,2049,12290,1,9881,1,12310,2049,2117,10,12393,12433,
                       146,117,110,105,120,58,103,101,116,45,99,119,100,0,2049,3640,112,119,100,0,
                       1,12435,2049,12406,2049,5983,2049,3640,47,0,1,12447,2049,3845,10,12417,12481,146,117,110,
                       105,120,58,99,111,117,110,116,45,102,105,108,101,115,45,105,110,45,99,119,
                       100,0,2049,3640,108,115,32,45,49,32,124,32,119,99,32,45,108,0,1,12483,
                       2049,12406,2049,5983,2049,222,10,12454,12528,146,117,110,105,120,58,102,111,114,45,101,
                       97,99,104,45,102,105,108,101,0,2049,3640,108,115,32,45,49,32,45,112,0,
                       1,12530,1,0,2049,12290,2049,12481,1793,12563,1793,12558,2049,9881,2049,3595,67502597,8,10,1,
                       12551,2049,2105,10,1,12549,2049,2270,2049,12310,3,10,12506,12580,146,115,116,97,114,116,
                       0,4,2049,3422,1,0,2049,12290,10,12571,12596,146,114,101,97,100,0,2,2049,9522,
                       2,2049,3330,2049,2521,10,12588,12615,146,102,105,110,105,115,104,0,2049,12310,2049,3402,
                       10,12506,12639,146,117,110,105,120,58,115,108,117,114,112,45,112,105,112,101,0,
                       1793,12650,2049,12580,1,12596,2049,2245,2049,12615,10,1,12641,2049,3446,10,12620,12667,146,110,
                       58,114,97,110,100,111,109,0,1,10,2049,9144,2049,9127,10,12655,12687,133,83,99,
                       114,105,112,116,105,110,103,0,0,12674,12700,146,105,100,101,110,116,105,102,121,
                       0,3841,12687,2049,2521,25,3,1,9,2049,9144,2,2049,2556,1793,12755,3,2049,3640,73,
                       79,32,68,69,86,73,67,69,32,84,89,80,69,32,48,48,48,57,32,78,
                       79,84,32,70,79,85,78,68,0,1,12718,2049,9240,2049,9203,10,1,12715,1793,12762,
                       4097,12687,10,1,12759,2049,64,10,12655,12787,146,115,99,114,105,112,116,58,97,114,
                       103,117,109,101,110,116,115,0,2049,12700,1,0,3841,12687,2049,9127,10,12767,12819,146,
                       115,99,114,105,112,116,58,103,101,116,45,97,114,103,117,109,101,110,116,0,
                       2049,3621,4,2049,12700,1,1,3841,12687,2049,9127,10,12796,12842,146,105,110,99,108,117,
                       100,101,0,2049,12700,1,2,3841,12687,2049,9127,10,12831,12866,146,115,99,114,105,112,
                       116,58,110,97,109,101,0,2049,3621,2049,12700,1,3,3841,12687,2049,9127,10,12851,12900,
                       146,115,99,114,105,112,116,58,99,117,114,114,101,110,116,45,102,105,108,101,
                       0,2049,3621,2049,12700,1,4,3841,12687,2049,9127,10,12877,12934,146,115,99,114,105,112,
                       116,58,99,117,114,114,101,110,116,45,108,105,110,101,0,2049,12700,1,5,3841,
                       12687,2049,9127,10,12911,12967,146,115,99,114,105,112,116,58,105,103,110,111,114,101,
                       45,116,111,45,101,111,108,0,2049,12700,1,6,3841,12687,2049,9127,10,12943,13000,146,
                       115,99,114,105,112,116,58,97,98,111,114,116,45,105,110,99,108,117,100,101,
                       0,2049,12700,1,7,3841,12687,2049,9127,10,12976,13018,146,97,98,111,114,116,0,1,
                       126,2049,3041,2049,12700,1,8,3841,12687,2049,9127,10,13009,13040,133,67,108,111,99,107,
                       0,0,13031,13053,146,105,100,101,110,116,105,102,121,0,3841,13040,2049,2521,25,3,
                       1,5,2049,9144,2,2049,2556,1793,13108,3,2049,3640,73,79,32,68,69,86,73,67,
                       69,32,84,89,80,69,32,48,48,48,53,32,78,79,84,32,70,79,85,78,
                       68,0,1,13071,2049,9240,2049,9203,10,1,13068,1793,13115,4097,13040,10,1,13112,2049,64,
                       10,13009,13139,146,99,108,111,99,107,58,111,112,101,114,97,116,105,111,110,0,
                       2049,13053,3841,13040,2049,9127,10,13120,13165,146,99,108,111,99,107,58,116,105,109,101,
                       115,116,97,109,112,0,1,0,2049,13139,10,13146,13183,146,99,108,111,99,107,58,
                       100,97,121,0,1,1,2049,13139,10,13170,13203,146,99,108,111,99,107,58,109,111,
                       110,116,104,0,1,2,2049,13139,10,13188,13222,146,99,108,111,99,107,58,121,101,
                       97,114,0,1,3,2049,13139,10,13208,13241,146,99,108,111,99,107,58,104,111,117,
                       114,0,1,4,2049,13139,10,13227,13262,146,99,108,111,99,107,58,109,105,110,117,
                       116,101,0,1,5,2049,13139,10,13246,13283,146,99,108,111,99,107,58,115,101,99,
                       111,110,100,0,1,6,2049,13139,10,13267,13305,146,99,108,111,99,107,58,117,116,
                       99,58,100,97,121,0,1,7,2049,13139,10,13288,13329,146,99,108,111,99,107,58,
                       117,116,99,58,109,111,110,116,104,0,1,8,2049,13139,10,13310,13352,146,99,108,
                       111,99,107,58,117,116,99,58,121,101,97,114,0,1,9,2049,13139,10,13334,13375,
                       146,99,108,111,99,107,58,117,116,99,58,104,111,117,114,0,1,10,2049,13139,
                       10,13357,13400,146,99,108,111,99,107,58,117,116,99,58,109,105,110,117,116,101,
                       0,1,11,2049,13139,10,13380,13425,146,99,108,111,99,107,58,117,116,99,58,115,
                       101,99,111,110,100,0,1,12,2049,13139,10,13405,1024,133,84,73,66,0,13430,13446,
                       146,99,58,103,101,116,0,1,1,2049,9144,2049,9127,10,13437,13462,146,101,100,105,
                       116,63,0,2,1793,13469,1,8,11,10,1,13465,1793,13477,1,127,11,10,1,13473,
                       2049,2117,22,10,13453,13493,146,103,97,116,104,101,114,0,2049,13462,1,11,1,3330,
                       2049,64,10,13483,13511,146,99,121,99,108,101,0,2049,13446,2049,2085,4,8,2049,2453,
                       25,3,2049,13493,1,13511,7,10,13437,13542,146,112,97,114,115,101,45,117,110,116,
                       105,108,0,1793,13554,2049,3621,2049,3422,2049,13511,771,2049,3296,10,1,13544,2049,3446,10,
                       13527,13568,146,115,58,103,101,116,0,1793,13590,1793,13576,1,10,11,10,1,13572,1793,
                       13584,1,13,11,10,1,13580,2049,2117,22,10,1,13570,2049,13542,10,13559,13609,146,115,
                       58,103,101,116,45,119,111,114,100,0,1,5585,2049,13542,10,13595,13623,146,99,108,
                       101,97,114,0,2049,3640,92,94,91,50,74,92,94,91,48,59,48,72,0,1,
                       13625,2049,7217,2049,9240,10,13614,13652,146,98,121,101,0,1,0,2049,12215,10,13645,13664,
                       133,69,79,84,0,0,13657,13677,133,73,103,110,111,114,105,110,103,0,0,13665,
                       13691,146,105,103,110,111,114,105,110,103,63,0,3841,13677,10,13678,13705,146,118,101,
                       114,115,105,111,110,0,3841,4,1,100,20,10,13694,13720,146,100,111,110,101,63,
                       0,2,4097,13664,1793,13729,1,13,11,10,1,13725,1793,13737,1,10,11,10,1,13733,
                       1793,13745,1,32,11,10,1,13741,2049,2154,22,22,10,13711,13760,146,101,111,108,63,
                       0,3841,13664,1793,13768,1,13,11,10,1,13764,1793,13776,1,10,11,10,1,13772,2049,
                       2117,22,10,13752,13792,146,118,97,108,105,100,63,0,2,2049,81,2049,2603,10,13782,
                       13811,146,99,104,101,99,107,45,101,111,102,0,2,1793,13818,1,-1,11,10,1,
                       13814,1793,13826,1,4,11,10,1,13822,2049,2117,22,1,13652,9,10,13798,13841,146,98,
                       115,0,2049,3354,2049,3354,771,10,13835,13859,146,99,104,101,99,107,45,98,115,0,
                       2,1793,13866,1,8,11,10,1,13862,1793,13874,1,127,11,10,1,13870,2049,2117,22,
                       1,13841,9,10,13847,13892,146,99,104,101,99,107,0,2049,13811,2049,13859,10,13883,13910,
                       146,99,104,97,114,97,99,116,101,114,0,2049,13446,2,2049,3330,10,13897,13926,146,
                       98,117,102,102,101,114,0,1793,13936,1,1024,2049,3422,8,2049,3296,10,1,13928,2049,
                       3446,10,13916,13955,146,114,101,97,100,45,116,111,107,101,110,0,1793,13971,1793,13966,
                       2049,13910,2049,13892,2049,13720,10,1,13959,2049,2245,10,1,13957,2049,13926,2049,3717,10,13941,
                       13987,146,105,110,112,117,116,0,2049,13955,2049,13792,10,13978,14003,146,112,114,111,99,
                       101,115,115,0,2049,13691,1793,14021,771,2049,13760,1793,14017,1,13677,2049,3041,10,1,14012,
                       9,10,1,14007,2049,2647,1,368,1,11,2049,64,10,13645,14038,158,47,47,0,2049,
                       12967,1,13677,2049,3028,10,14032,14055,146,108,105,115,116,101,110,0,2049,13987,2049,14003,
                       1,14055,7,10,14045,14070,133,70,73,68,0,1,14063,14085,146,119,114,105,116,101,
                       45,98,121,116,101,0,3841,14070,2049,9541,10,14071,14098,146,109,97,115,107,0,1,
                       255,21,10,14090,14116,146,119,114,105,116,101,45,99,101,108,108,0,2,2049,14098,
                       2049,14085,1,8,24,2,2049,14098,2049,14085,1,8,24,2,2049,14098,2049,14085,1,8,
                       24,2049,14098,2049,14085,10,14045,14159,146,105,109,97,103,101,58,115,97,118,101,0,
                       2049,9774,4097,14070,1,0,2049,1871,1793,14174,2049,56,2049,14116,10,1,14169,2049,2270,3,
                       3841,14070,2049,9504,10 };

/* Function Prototypes ----------------------------------------------- */
CELL stack_pop();
void stack_push(CELL value);
CELL string_inject(char *str, CELL buffer);
char *string_extract(CELL at);
CELL d_xt_for(char *Name, CELL Dictionary);
void update_rx();
void include_file(char *fname, int run_tests);

void register_device(void *handler, void *query);

void io_output();           void query_output();
void io_keyboard();         void query_keyboard();
void io_scripting();        void query_scripting();


void load_embedded_image();
CELL load_image();
void prepare_vm();
void process_opcode_bundle(CELL opcode);
int validate_opcode_bundle(CELL opcode);

#ifdef NEEDS_STRL
size_t strlcat(char *dst, const char *src, size_t dsize);
size_t strlcpy(char *dst, const char *src, size_t dsize);
#endif

void prepare_vm();

void inst_no();  void inst_li();  void inst_du();
void inst_dr();  void inst_sw();  void inst_pu();
void inst_po();  void inst_ju();  void inst_ca();
void inst_cc();  void inst_re();  void inst_eq();
void inst_ne();  void inst_lt();  void inst_gt();
void inst_fe();  void inst_st();  void inst_ad();
void inst_su();  void inst_mu();  void inst_di();
void inst_an();  void inst_or();  void inst_xo();
void inst_sh();  void inst_zr();  void inst_ha();
void inst_ie();  void inst_iq();  void inst_ii();


/* Image, Stack, and VM variables ------------------------------------ */
CELL memory[IMAGE_SIZE + 1];      /* The memory for the image          */

#define TOS  cpu.data[cpu.sp]     /* Top item on stack                 */
#define NOS  cpu.data[cpu.sp-1]   /* Second item on stack              */
#define TORS cpu.address[cpu.rp]  /* Top item on address stack         */

struct NgaCore {
  CELL sp, rp, ip;                /* Stack & instruction pointers      */
  CELL data[STACK_DEPTH];         /* The data stack                    */
  CELL address[ADDRESSES];        /* The address stack                 */
} cpu;

int devices;                      /* The number of I/O devices         */


/* Markers for code & test blocks ------------------------------------ */
char code_start[33], code_end[33], test_start[33], test_end[33];

/* Populate The I/O Device Tables ------------------------------------ */
typedef void (*Handler)(void);
Handler IO_deviceHandlers[MAX_DEVICES];
Handler IO_queryHandlers[MAX_DEVICES];

/* Global Variables -------------------------------------------------- */
CELL Compiler, Dictionary, NotFound, interpret;

char string_data[513];
char **sys_argv;
int sys_argc;
char scripting_sources[4][513];
int current_source;
int perform_abort;


/*---------------------------------------------------------------------
  Now on to I/O and extensions!
  ---------------------------------------------------------------------*/

void io_output() {
  putc(stack_pop(), stdout);
  fflush(stdout);
}

void query_output() {
  stack_push(0);
  stack_push(0);
}


/*=====================================================================*/

void io_keyboard() {
  stack_push(getc(stdin));
  if (TOS == 127) TOS = 8;
}

void query_keyboard() {
  stack_push(0);
  stack_push(1);
}


/*=====================================================================*/


/*---------------------------------------------------------------------
  Scripting Support
  ---------------------------------------------------------------------*/

CELL currentLine;
CELL ignoreToEOL;
CELL ignoreToEOF;

void scripting_arg() {
  CELL a, b;
  a = stack_pop();
  b = stack_pop();
  stack_push(string_inject(sys_argv[a + 2], b));
}

void scripting_arg_count() {
  stack_push(sys_argc - 2);
}

void scripting_include() {
  include_file(string_extract(stack_pop()), 0);
}

void scripting_name() {
  stack_push(string_inject(sys_argv[1], stack_pop()));
}

/* addeded in scripting i/o device, revision 1 */
void scripting_source() {
  stack_push(string_inject(scripting_sources[current_source], stack_pop()));
}

void scripting_line() {
  stack_push(currentLine + 1);
}

void scripting_ignore_to_eol() {
  ignoreToEOL = -1;
}

void scripting_ignore_to_eof() {
  ignoreToEOF = -1;
}

void scripting_abort() {
  scripting_ignore_to_eol();
  scripting_ignore_to_eof();
  perform_abort = -1;
}

void carry_out_abort() {
  cpu.ip = IMAGE_SIZE + 1;
  cpu.rp = 0;
  cpu.sp = 0;
#ifdef ENABLE_FLOATS
  fsp = 0;
  afsp = 0;
#endif

  if (current_source > 0) {
    scripting_abort();
    return;
  }

  perform_abort = 0;
  current_source = 0;
}

Handler ScriptingActions[] = {
  scripting_arg_count,     scripting_arg,
  scripting_include,       scripting_name,
  scripting_source,        scripting_line,
  scripting_ignore_to_eol, scripting_ignore_to_eof,
  scripting_abort
};

void query_scripting() {
  stack_push(2);
  stack_push(9);
}

void io_scripting() {
  ScriptingActions[stack_pop()]();
}


/*=====================================================================*/

/*---------------------------------------------------------------------
  With these out of the way, I implement `execute`, which takes an
  address and runs the code at it. This has a couple of interesting
  bits.

  This will also exit if the address stack depth is zero (meaning that
  the word being run, and it's dependencies) are finished.
  ---------------------------------------------------------------------*/

void invalid_opcode(CELL opcode) {
  CELL a, i;
  printf("\nERROR (nga/execute): Invalid instruction!\n");
  printf("At %lld, opcode %lld\n", (long long)cpu.ip, (long long)opcode);
  printf("Instructions: ");
  a = opcode;
  for (i = 0; i < 4; i++) {
    printf("%lldd ", (long long)a & 0xFF);
    a = a >> 8;
  }
  printf("\n");
  exit(1);
}

void execute(CELL cell) {
  CELL token;
  CELL opcode;
  if (cpu.rp == 0)
    cpu.rp = 1;
  cpu.ip = cell;
  token = TIB;
  while (cpu.ip < IMAGE_SIZE) {
    if (perform_abort == 0) {
      if (cpu.ip == NotFound) {
        printf("\nERROR: Word Not Found: ");
        printf("`%s`\n\n", string_extract(token));
      }
      if (cpu.ip == interpret) {
        token = TOS;
      }
      opcode = memory[cpu.ip];
      if (validate_opcode_bundle(opcode) != 0) {
        process_opcode_bundle(opcode);
      } else {
        invalid_opcode(opcode);
      }
      if (cpu.sp < 0 || cpu.sp > STACK_DEPTH) {
        printf("\nERROR (nga/execute): Stack Limits Exceeded!\n");
        printf("At %lld, opcode %lld. sp = %lld\n", (long long)cpu.ip, (long long)opcode, (long long)cpu.sp);
        exit(1);
      }
      if (cpu.rp < 0 || cpu.rp > ADDRESSES) {
        printf("\nERROR (nga/execute): Address Stack Limits Exceeded!\n");
        printf("At %lld, opcode %lld. rp = %lld\n", (long long)cpu.ip, (long long)opcode, (long long)cpu.rp);
        exit(1);
      }
      cpu.ip++;
      if (cpu.rp == 0)
        cpu.ip = IMAGE_SIZE;
    } else {
      carry_out_abort();
    }
  }
}


/*---------------------------------------------------------------------
  RETRO's `interpret` word expects a token on the stack. This next
  function copies a token to the `TIB` (text input buffer) and then
  calls `interpret` to process it.
  ---------------------------------------------------------------------*/

void evaluate(char *s) {
  if (strlen(s) == 0)  return;
  string_inject(s, TIB);
  stack_push(TIB);
  execute(interpret);
}


/*---------------------------------------------------------------------
  `read_token` reads a token from the specified file.  It will stop on
   a whitespace or newline. It also tries to handle backspaces, though
   the success of this depends on how your terminal is configured.
  ---------------------------------------------------------------------*/

int not_eol(int c) {
  return (c != 10) && (c != 13) && (c != 32) && (c != EOF) && (c != 0);
}

void read_token(FILE *file, char *token_buffer) {
  int ch = getc(file);
  int count = 0;
  while (not_eol(ch)) {
    if ((ch == 8 || ch == 127) && count > 0) {
      count--;
    } else {
      token_buffer[count++] = ch;
    }
    ch = getc(file);
  }
  token_buffer[count] = '\0';
}


/*---------------------------------------------------------------------
  Display the Stack Contents
  ---------------------------------------------------------------------*/

void dump_stack() {
  CELL i;
  if (cpu.sp == 0)  return;
  printf("\nStack: ");
  for (i = 1; i <= cpu.sp; i++) {
    if (i == cpu.sp)
      printf("[ TOS: %lld ]", (long long)cpu.data[i]);
    else
      printf("%lld ", (long long)cpu.data[i]);
  }
  printf("\n");
}


/*---------------------------------------------------------------------
  RRE is primarily intended to be used in a batch or scripting model.
  The `include_file()` function will be used to read the code in the
  file, evaluating it as encountered.

  I enforce a literate model, with code in fenced blocks. E.g.,

    # This is a test

    Display "Hello, World!"

    ~~~
    'Hello,_World! puts nl
    ~~~

  RRE will ignore anything outside the `~~~` blocks. To identify if the
  current token is the start or end of a block, I provide a `fenced()`
  function.
  ---------------------------------------------------------------------*/

/* Check to see if a line is a fence boundary.
   This will check code blocks in all cases, and test blocks
   if tests_enabled is set to a non-zero value. */

int fence_boundary(char *buffer, int tests_enabled) {
  int flag = 1;
  if (strcmp(buffer, code_start) == 0) { flag = -1; }
  if (strcmp(buffer, code_end) == 0)   { flag = -1; }
  if (tests_enabled == 0) { return flag; }
  if (strcmp(buffer, test_start) == 0) { flag = -1; }
  if (strcmp(buffer, test_end) == 0)   { flag = -1; }
  return flag;
}


/*---------------------------------------------------------------------
  And now for the actual `include_file()` function.
  ---------------------------------------------------------------------*/

void read_line(FILE *file, char *token_buffer) {
  int ch = getc(file);
  int count = 0;
  while ((ch != 10) && (ch != 13) && (ch != EOF) && (ch != 0)) {
    token_buffer[count++] = ch;
    ch = getc(file);
  }
  token_buffer[count] = '\0';
}

int count_tokens(char *line) {
  int count = 1;
  while (*line++) {
    if (isspace(line[0]))
      count++;
  }
  return count;
}

void include_file(char *fname, int run_tests) {
  int inBlock = 0;                 /* Tracks status of in/out of block */
  char source[64 * 1024];          /* Token buffer [about 64K]         */
  char line[64 * 1024];            /* Line buffer [about 64K]          */
  char fence[33];                  /* Used with `fence_boundary()`     */

  CELL ReturnStack[ADDRESSES];
  CELL arp, aip;

  long offset = 0;
  CELL at = 0;
  int tokens = 0;
  FILE *fp;                        /* Open the file. If not found,     */
  fp = fopen(fname, "r");          /* exit.                            */
  if (fp == NULL)
    return;

  arp = cpu.rp;
  aip = cpu.ip;
  for(cpu.rp = 0; cpu.rp <= arp; cpu.rp++)
    ReturnStack[cpu.rp] = cpu.address[cpu.rp];
  cpu.rp = 0;

  current_source++;
   strlcpy(scripting_sources[current_source], fname, 8192);

  ignoreToEOF = 0;

  while (!feof(fp) && (ignoreToEOF == 0)) { /* Loop through the file   */

    ignoreToEOL = 0;

    offset = ftell(fp);
    read_line(fp, line);
    fseek(fp, offset, SEEK_SET);

    tokens = count_tokens(line);

    while (tokens > 0 && ignoreToEOL == 0) {
      tokens--;
      read_token(fp, source);
      strlcpy(fence, source, 32); /* Copy the first three characters  */
      if (fence_boundary(fence, run_tests) == -1) {
        if (inBlock == 0)
          inBlock = 1;
        else
          inBlock = 0;
      } else {
        if (inBlock == 1) {
          currentLine = at;
          evaluate(source);
          currentLine = at;
        }
      }
    }
    if (ignoreToEOL == -1)
      read_line(fp, line);
    at++;
  }

  current_source--;
  ignoreToEOF = 0;
  fclose(fp);
  if (perform_abort == -1) {
    carry_out_abort();
  }
  for(cpu.rp = 0; cpu.rp <= arp; cpu.rp++)
    cpu.address[cpu.rp] = ReturnStack[cpu.rp];
  cpu.rp = arp;
  cpu.ip = aip;
}


/*---------------------------------------------------------------------
  `initialize()` sets up Nga and loads the image (from the array in
  `image.c`) to memory.
  ---------------------------------------------------------------------*/

void initialize() {
  prepare_vm();
  load_embedded_image();
}


/*---------------------------------------------------------------------
  `arg_is()` exists to aid in readability. It compares the first actual
  command line argument to a string and returns a boolean flag.
  ---------------------------------------------------------------------*/

int arg_is(char *argv, char *t) {
  return strcmp(argv, t) == 0;
}


/* Main Entry Point ---------------------------------------------------*/
int main(int argc, char **argv) {
  initialize();                           /* Initialize Nga & image    */

  register_device(io_output, query_output);
  register_device(io_keyboard, query_keyboard);

  strcpy(code_start, "~~~");
  strcpy(code_end,   "~~~");
  strcpy(test_start, "```");
  strcpy(test_end,   "```");

  /* Setup variables related to the scripting device */
  currentLine = 0;                        /* Current Line # for script */
  current_source = 0;                     /* Current file being run    */
  perform_abort = 0;                      /* Carry out abort procedure */
  sys_argc = argc;                        /* Point the global argc and */
  sys_argv = argv;                        /* argv to the actual ones   */
  strlcpy(scripting_sources[0], "/dev/stdin", 8192);
  ignoreToEOL = 0;
  ignoreToEOF = 0;

  update_rx();
  execute(0);
}


/*=====================================================================*/


/*---------------------------------------------------------------------
  Interfacing With The Image
  ---------------------------------------------------------------------*/

/*---------------------------------------------------------------------
  Stack push/pop is easy. I could avoid these, but it aids in keeping
  the code readable, so it's worth the slight overhead.
  ---------------------------------------------------------------------*/

CELL stack_pop() {
  cpu.sp--;
  return cpu.data[cpu.sp + 1];
}

void stack_push(CELL value) {
  cpu.sp++;
  cpu.data[cpu.sp] = value;
}


/*---------------------------------------------------------------------
  Strings are next. RETRO uses C-style NULL terminated strings. So I
  can easily inject or extract a string. Injection iterates over the
  string, copying it into the image. This also takes care to ensure
  that the NULL terminator is added.
  ---------------------------------------------------------------------*/

CELL string_inject(char *str, CELL buffer) {
  CELL m, i;
  if (!str) {
    memory[buffer] = 0;
    return 0;
  }
  m = strlen(str);
  i = 0;
  while (m > 0) {
    memory[buffer + i] = (CELL)str[i];
    memory[buffer + i + 1] = 0;
    m--; i++;
  }
  return buffer;
}


/*---------------------------------------------------------------------
  Extracting a string is similar, but I have to iterate over the VM
  memory instead of a C string and copy the charaters into a buffer.
  This uses a static buffer (`string_data`) as I prefer to avoid using
  `malloc()`.
  ---------------------------------------------------------------------*/

char *string_extract(CELL at) {
  CELL starting = at;
  CELL i = 0;
  while(memory[starting] && i < 8192)
    string_data[i++] = (char)memory[starting++];
  string_data[i] = 0;
  return (char *)string_data;
}


/*---------------------------------------------------------------------
  Continuing along, I now define functions to access the dictionary.

  RETRO's dictionary is a linked list. Each entry is setup like:

  0000  Link to previous entry (NULL if this is the root entry)
  0001  Pointer to definition start
  0002  Pointer to class handler
  0003  Start of a NULL terminated string with the word name

  First, functions to access each field. The offsets were defineed at
  the start of the file.
  ---------------------------------------------------------------------*/

CELL d_link(CELL dt) {
  return dt + D_OFFSET_LINK;
}

CELL d_xt(CELL dt) {
  return dt + D_OFFSET_XT;
}

CELL d_class(CELL dt) {
  return dt + D_OFFSET_CLASS;
}

CELL d_name(CELL dt) {
  return dt + D_OFFSET_NAME;
}


/*---------------------------------------------------------------------
  Next, a more complext word. This will walk through the entries to
  find one with a name that matches the specified name. This is *slow*,
  but works ok unless you have a really large dictionary. (I've not
  run into issues with this in practice).
  ---------------------------------------------------------------------*/

CELL d_lookup(CELL Dictionary, char *name) {
  CELL dt = 0;
  CELL i = Dictionary;
  char *dname;
  while (memory[i] != 0 && i != 0) {
    dname = string_extract(d_name(i));
    if (strcmp(dname, name) == 0) {
      dt = i;
      i = 0;
    } else {
      i = memory[i];
    }
  }
  return dt;
}


/*---------------------------------------------------------------------
  My last dictionary related word returns the `xt` pointer for a word.
  This is used to help keep various important bits up to date.
  ---------------------------------------------------------------------*/

CELL d_xt_for(char *Name, CELL Dictionary) {
  return memory[d_xt(d_lookup(Dictionary, Name))];
}


/*---------------------------------------------------------------------
  This interface tracks a few words and variables in the image. These
  are:

  Dictionary - the latest dictionary header
  NotFound   - called when a word is not found
  interpret  - the heart of the interpreter/compiler

  I have to call this periodically, as the Dictionary will change as
  new words are defined, and the user might write a new error handler
  or interpreter.
  ---------------------------------------------------------------------*/

void update_rx() {
  Dictionary = memory[2];
  interpret = d_xt_for("interpret", Dictionary);
  NotFound = d_xt_for("err:notfound", Dictionary);
  Compiler = d_xt_for("Compiler", Compiler);
}

/*=====================================================================*/

void register_device(void *handler, void *query) {
  IO_deviceHandlers[devices] = handler;
  IO_queryHandlers[devices] = query;
  devices++;
}

void load_embedded_image() {
  int i;
  for (i = 0; i < ngaImageCells; i++)
    memory[i] = ngaImage[i];
}

CELL load_image(char *imageFile) {
  FILE *fp;
  CELL imageSize = 0;
  long fileLen;
  if ((fp = fopen(imageFile, "rb")) != NULL) {
    /* Determine length (in cells) */
    fseek(fp, 0, SEEK_END);
    fileLen = ftell(fp) / sizeof(CELL);
    if (fileLen > IMAGE_SIZE) {
      fclose(fp);
      printf("\nERROR (nga/ngaLoadImage): Image is larger than alloted space!\n");
      exit(1);
    }
    rewind(fp);
    /* Read the file into memory */
    imageSize = fread(&memory, sizeof(CELL), fileLen, fp);
    fclose(fp);
  }
  return imageSize;
}

void prepare_vm() {
  cpu.ip = cpu.sp = cpu.rp = 0;
  for (cpu.ip = 0; cpu.ip < IMAGE_SIZE; cpu.ip++)
    memory[cpu.ip] = 0; /* NO - nop instruction */
  for (cpu.ip = 0; cpu.ip < STACK_DEPTH; cpu.ip++)
    cpu.data[cpu.ip] = 0;
  for (cpu.ip = 0; cpu.ip < ADDRESSES; cpu.ip++)
    cpu.address[cpu.ip] = 0;
}

void inst_no() {
}

void inst_li() {
  cpu.sp++;
  cpu.ip++;
  TOS = memory[cpu.ip];
}

void inst_du() {
  cpu.sp++;
  cpu.data[cpu.sp] = NOS;
}

void inst_dr() {
  cpu.data[cpu.sp] = 0;
  cpu.sp--;
}

void inst_sw() {
  CELL a;
  a = TOS;
  TOS = NOS;
  NOS = a;
}

void inst_pu() {
  cpu.rp++;
  TORS = TOS;
  inst_dr();
}

void inst_po() {
  cpu.sp++;
  TOS = TORS;
  cpu.rp--;
}

void inst_ju() {
  cpu.ip = TOS - 1;
  inst_dr();
}

void inst_ca() {
  cpu.rp++;
  TORS = cpu.ip;
  cpu.ip = TOS - 1;
  inst_dr();
}

void inst_cc() {
  CELL a, b;
  a = TOS; inst_dr();  /* Target */
  b = TOS; inst_dr();  /* Flag   */
  if (b != 0) {
    cpu.rp++;
    TORS = cpu.ip;
    cpu.ip = a - 1;
  }
}

void inst_re() {
  cpu.ip = TORS;
  cpu.rp--;
}

void inst_eq() {
  NOS = (NOS == TOS) ? -1 : 0;
  inst_dr();
}

void inst_ne() {
  NOS = (NOS != TOS) ? -1 : 0;
  inst_dr();
}

void inst_lt() {
  NOS = (NOS < TOS) ? -1 : 0;
  inst_dr();
}

void inst_gt() {
  NOS = (NOS > TOS) ? -1 : 0;
  inst_dr();
}

void inst_fe() {
  switch (TOS) {
    case -1: TOS = cpu.sp - 1; break;
    case -2: TOS = cpu.rp; break;
    case -3: TOS = IMAGE_SIZE; break;
    case -4: TOS = CELL_MIN; break;
    case -5: TOS = CELL_MAX; break;
    default: TOS = memory[TOS]; break;
  }
}

void inst_st() {
  memory[TOS] = NOS;
  inst_dr();
  inst_dr();
}

void inst_ad() {
  NOS += TOS;
  inst_dr();
}

void inst_su() {
  NOS -= TOS;
  inst_dr();
}

void inst_mu() {
  NOS *= TOS;
  inst_dr();
}

void inst_di() {
  CELL a, b;
  a = TOS;
  b = NOS;
  TOS = b / a;
  NOS = b % a;
}

void inst_an() {
  NOS = TOS & NOS;
  inst_dr();
}

void inst_or() {
  NOS = TOS | NOS;
  inst_dr();
}

void inst_xo() {
  NOS = TOS ^ NOS;
  inst_dr();
}

void inst_sh() {
  CELL y = TOS;
  CELL x = NOS;
  if (TOS < 0)
    NOS = NOS << (TOS * -1);
  else {
    if (x < 0 && y > 0)
      NOS = x >> y | ~(~0U >> y);
    else
      NOS = x >> y;
  }
  inst_dr();
}

void inst_zr() {
  if (TOS == 0) {
    inst_dr();
    cpu.ip = TORS;
    cpu.rp--;
  }
}

void inst_ha() {
  cpu.ip = IMAGE_SIZE;
}

void inst_ie() {
  cpu.sp++;
  TOS = devices;
}

void inst_iq() {
  CELL Device = TOS;
  inst_dr();
  IO_queryHandlers[Device]();
}

void inst_ii() {
  CELL Device = TOS;
  inst_dr();
  IO_deviceHandlers[Device]();
}

Handler instructions[] = {
  inst_no, inst_li, inst_du, inst_dr, inst_sw, inst_pu, inst_po,
  inst_ju, inst_ca, inst_cc, inst_re, inst_eq, inst_ne, inst_lt,
  inst_gt, inst_fe, inst_st, inst_ad, inst_su, inst_mu, inst_di,
  inst_an, inst_or, inst_xo, inst_sh, inst_zr, inst_ha, inst_ie,
  inst_iq, inst_ii
};

void process_opcode(CELL opcode) {
  if (opcode != 0)
    instructions[opcode]();
}

int validate_opcode_bundle(CELL opcode) {
  CELL raw = opcode;
  CELL current;
  int valid = -1;
  int i;
  for (i = 0; i < 4; i++) {
    current = raw & 0xFF;
    if (!(current >= 0 && current <= 29))
      valid = 0;
    raw = raw >> 8;
  }
  return valid;
}

void process_opcode_bundle(CELL opcode) {
  CELL raw = opcode;
  int i;
  for (i = 0; i < 4; i++) {
    process_opcode(raw & 0xFF);
    raw = raw >> 8;
  }
}

#ifdef NEEDS_STRL
/*---------------------------------------------------------------------
  Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>

  Permission to use, copy, modify, and distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  --------------------------------------------------------------------*/

size_t strlcat(char *dst, const char *src, size_t dsize) {
  const char *odst = dst;
  const char *osrc = src;
  size_t n = dsize;
  size_t dlen;

  /* Find the end of dst and adjust bytes left but don't go past end. */
  while (n-- != 0 && *dst != '\0')
    dst++;
  dlen = dst - odst;
  n = dsize - dlen;

  if (n-- == 0)
    return(dlen + strlen(src));
  while (*src != '\0') {
    if (n != 0) {
      *dst++ = *src;
      n--;
    }
    src++;
  }
  *dst = '\0';
  return(dlen + (src - osrc));  /* count does not include NUL */
}

size_t strlcpy(char *dst, const char *src, size_t dsize) {
  const char *osrc = src;
  size_t nleft = dsize;

  /* Copy as many bytes as will fit. */
  if (nleft != 0) {
    while (--nleft != 0) {
      if ((*dst++ = *src++) == '\0')
        break;
    }
  }

  /* Not enough room in dst, add NUL and traverse rest of src. */
  if (nleft == 0) {
    if (dsize != 0)
      *dst = '\0';    /* NUL-terminate dst */
    while (*src++)
      ;
  }
  return(src - osrc - 1); /* count does not include NUL */
}
#endif

A t,expansion => t,expansion +9 -0
@@ 0,0 1,9 @@
----------------------------------------------------------------
i will expose unused io connections. the exact form this will
take is not yet decided.

my current thought is to have some rj45 ports that connect to
the pins. eventually (assuming we do some pcb development), i
would prefer to have an edge connector.
----------------------------------------------------------------


A t,input => t,input +19 -0
@@ 0,0 1,19 @@
----------------------------------------------------------------
input methods

- standard keyboard

i use a modified dvorak layout, with 32-36 keys as my primary
setup.

- asetniop

we are considering an asetniop based layout (10 keys) as an
option

- chorded layout (9-12 keys)

we are also considering a custom chorded layout. this would
allow one handed entry.
----------------------------------------------------------------


A t,status => t,status +20 -0
@@ 0,0 1,20 @@
----------------------------------------------------------------
we are selecting hardware.

our initial prototype will us a teensy 4.1
we hav this, several breadboards, 10 cherry mx switches, and a
power switch. batteries, character lcd, and oled will be
arriving in a couple of weeks.

the intent is to setup a basic keyboard matrix, and implement
text input using this. we can connect via a usb serial terminal
to debug.

i have begun work on adapting nga-c to support the teensy 4.1.
this is mostly stripping out the unix-specific parts at this
point.

in addition to this, i am beginning work on some filesystem
prototypes.
----------------------------------------------------------------