summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-05-26 21:51:04 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-05-26 22:48:09 -0700
commit78f8fce7f286fd0c71774e2567404ed51f24fef3 (patch)
treef3de4987f7a9fc1bc03331e97b65a851b041051a /src/include
*: initial commit of stripped schism stuff
Forking schism tracker's IT playback stuff into a little playback library for embedding in demos.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cmixer.h56
-rw-r--r--src/include/disko.h136
-rw-r--r--src/include/dmoz.h211
-rw-r--r--src/include/event.h46
-rw-r--r--src/include/fmopl.h122
-rw-r--r--src/include/fmt-types.h153
-rw-r--r--src/include/fmt.h175
-rw-r--r--src/include/headers.h250
-rw-r--r--src/include/it_defs.h128
-rw-r--r--src/include/log.h59
-rw-r--r--src/include/midi.h162
-rw-r--r--src/include/osdefs.h160
-rw-r--r--src/include/precomp_lut.h327
-rw-r--r--src/include/slurp.h81
-rw-r--r--src/include/snd_fm.h201
-rw-r--r--src/include/sndfile.h708
-rw-r--r--src/include/tables.h56
-rw-r--r--src/include/util.h200
18 files changed, 3231 insertions, 0 deletions
diff --git a/src/include/cmixer.h b/src/include/cmixer.h
new file mode 100644
index 0000000..64a0ec0
--- /dev/null
+++ b/src/include/cmixer.h
@@ -0,0 +1,56 @@
+#ifndef MODPLUG_MIXER_H
+#define MODPLUG_MIXER_H
+
+#include "sndfile.h"
+
+// Stuff moved from sndfile.h
+#define MIXING_ATTENUATION 5
+#define MIXING_CLIPMIN (-0x04000000)
+#define MIXING_CLIPMAX (0x03FFFFFF)
+#define VOLUMERAMPPRECISION 12
+#define FILTERPRECISION 13
+
+
+void init_mix_buffer(int *, unsigned int);
+void stereo_fill(int *, unsigned int, int*, int *);
+void end_channel_ofs(song_voice_t *, int *, unsigned int);
+void interleave_front_rear(int *, int *, unsigned int);
+void mono_from_stereo(int *, unsigned int);
+
+void stereo_mix_to_float(const int *, float *, float *, unsigned int);
+void float_to_stereo_mix(const float *, const float *, int *, unsigned int);
+void mono_mix_to_float(const int *, float *, unsigned int);
+void float_to_mono_mix(const float *, int *, unsigned int);
+
+unsigned int csf_create_stereo_mix(song_t *csf, int count);
+
+void setup_channel_filter(song_voice_t *pChn, int reset, int flt_modifier, int freq);
+
+
+//typedef unsigned int (*convert_clip_t)(void *, int *, unsigned int, int*, int*) __attribute__((cdecl))
+
+unsigned int clip_32_to_8(void *, int *, unsigned int, int *, int *);
+unsigned int clip_32_to_16(void *, int *, unsigned int, int *, int *);
+unsigned int clip_32_to_24(void *, int *, unsigned int, int *, int *);
+unsigned int clip_32_to_32(void *, int *, unsigned int, int *, int *);
+
+
+void eq_mono(song_t *, int *, unsigned int);
+void eq_stereo(song_t *, int *, unsigned int);
+void initialize_eq(int, float);
+void set_eq_gains(const unsigned int *, unsigned int, const unsigned int *, int, int);
+
+
+// sndmix.c
+extern int g_dry_rofs_vol;
+extern int g_dry_lofs_vol;
+
+
+// mixer.c
+void ResampleMono8BitFirFilter(signed char *oldbuf, signed char *newbuf, unsigned long oldlen, unsigned long newlen);
+void ResampleMono16BitFirFilter(signed short *oldbuf, signed short *newbuf, unsigned long oldlen, unsigned long newlen);
+void ResampleStereo8BitFirFilter(signed char *oldbuf, signed char *newbuf, unsigned long oldlen, unsigned long newlen);
+void ResampleStereo16BitFirFilter(signed short *oldbuf, signed short *newbuf, unsigned long oldlen, unsigned long newlen);
+
+#endif
+
diff --git a/src/include/disko.h b/src/include/disko.h
new file mode 100644
index 0000000..e7dc14c
--- /dev/null
+++ b/src/include/disko.h
@@ -0,0 +1,136 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __disko_h
+#define __disko_h
+
+#include <sys/types.h>
+
+
+typedef struct disko disko_t;
+struct disko {
+ // Functions whose implementation depends on the backend in use
+ // Use disko_write et al. instead of these.
+ void (*_write)(disko_t *ds, const void *buf, size_t len);
+ void (*_putc)(disko_t *ds, int c);
+ void (*_seek)(disko_t *ds, long offset, int whence);
+ long (*_tell)(disko_t *ds);
+
+ // Temporary filename that's being written to
+ char tempname[PATH_MAX];
+
+ // Name to change it to on close (if successful)
+ char filename[PATH_MAX];
+
+ // these could be unionized
+ // file pointer (only exists for disk files)
+ FILE *file;
+ // data for memory buffers (no filename/handle)
+ uint8_t *data;
+
+ // First errno value recorded after something went wrong.
+ int error;
+
+ /* untouched by diskwriter; driver may use for anything */
+ void *userdata;
+
+ // for memory buffers
+ size_t pos, length, allocated;
+};
+
+enum {
+ DW_OK = 1,
+ DW_ERROR = 0,
+ DW_NOT_RUNNING = -1,
+};
+enum {
+ DW_SYNC_DONE = 0,
+ DW_SYNC_ERROR = -1,
+ DW_SYNC_MORE = 1,
+};
+
+/* fopen/fclose-ish writeout/finish wrapper that allocates a structure */
+disko_t *disko_open(const char *filename);
+/* Close the file. If there was no error writing the file, it is renamed
+to the name specified in disko_open; otherwise, the original file is left
+intact and the temporary file is deleted. Returns DW_OK on success,
+DW_ERROR (and sets errno) if there was a file error.
+'backup' parameter:
+ <1 don't backup
+ =1 backup to file~
+ >1 keep numbered backups to file.n~
+(the semantics of this might change later to allow finer control) */
+int disko_close(disko_t *f, int backup);
+
+/* alloc/free a memory buffer
+if free_buffer is 0, the internal buffer is left alone when deallocating,
+so that it can continue to be used later */
+disko_t *disko_memopen(void);
+int disko_memclose(disko_t *f, int free_buffer);
+
+
+/* copy a pattern into a sample */
+int disko_writeout_sample(int smpnum, int pattern, int bind);
+
+/* copy a pattern into multiple samples (split by channel,
+and writing into free slots starting at smpnum) */
+int disko_multiwrite_samples(int firstsmp, int pattern);
+
+/* Wrapper for the above that writes to the current sample,
+and with a confirmation dialog if the sample already has data */
+void song_pattern_to_sample(int pattern, int split, int bind);
+
+/* export the song to a file */
+struct save_format;
+int disko_export_song(const char *filename, const struct save_format *format);
+
+/* call periodically if (status.flags & DISKWRITER_ACTIVE) to write more stuff.
+return: DW_SYNC_*, self explanatory */
+int disko_sync(void);
+
+
+
+/* For use by the diskwriter drivers: */
+
+/* Write data to the file, as in fwrite() */
+void disko_write(disko_t *ds, const void *buf, size_t len);
+
+/* Write one character (unsigned char, cast to int) */
+void disko_putc(disko_t *ds, int c);
+
+/* Change file position. This CAN be used to seek past the end,
+but be cognizant that random data might exist in the "gap". */
+void disko_seek(disko_t *ds, long pos, int whence);
+
+/* Get the position, as set by seek */
+long disko_tell(disko_t *ds);
+
+/* Call this to signal a nonrecoverable error condition. */
+void disko_seterror(disko_t *ds, int err);
+
+/* ------------------------------------------------------------------------- */
+
+/* this call is used by audio/loadsave to send midi data */
+int _disko_writemidi(const void *data, unsigned int len, unsigned int delay);
+
+#endif
+
diff --git a/src/include/dmoz.h b/src/include/dmoz.h
new file mode 100644
index 0000000..f39d448
--- /dev/null
+++ b/src/include/dmoz.h
@@ -0,0 +1,211 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DMOZ_H
+#define DMOZ_H
+
+#include <stdint.h>
+#include "sndfile.h" /* for song_sample_t */
+
+/* need these for struct stat */
+#include <sys/types.h>
+#include <sys/stat.h>
+
+enum {
+ TYPE_BROWSABLE_MASK = 0x1, /* if (type & TYPE_BROWSABLE_MASK) it's readable as a library */
+ TYPE_FILE_MASK = 0x2, /* if (type & TYPE_FILE_MASK) it's a regular file */
+ TYPE_DIRECTORY = 0x4 | TYPE_BROWSABLE_MASK, /* if (type == TYPE_DIRECTORY) ... guess what! */
+ TYPE_NON_REGULAR = 0x8, /* if (type == TYPE_NON_REGULAR) it's something weird, e.g. a socket */
+
+ /* (flags & 0xF0) are reserved for future use */
+
+ /* this has to match TYPE_BROWSABLE_MASK for directories */
+ TYPE_EXT_DATA_MASK = 0xFFF01, /* if (type & TYPE_EXT_DATA_MASK) the extended data has been checked */
+
+ TYPE_MODULE_MASK = 0xF00, /* if (type & TYPE_MODULE_MASK) it's loadable as a module */
+ TYPE_MODULE_MOD = 0x100 | TYPE_BROWSABLE_MASK | TYPE_FILE_MASK,
+ TYPE_MODULE_S3M = 0x200 | TYPE_BROWSABLE_MASK | TYPE_FILE_MASK,
+ TYPE_MODULE_XM = 0x300 | TYPE_BROWSABLE_MASK | TYPE_FILE_MASK,
+ TYPE_MODULE_IT = 0x400 | TYPE_BROWSABLE_MASK | TYPE_FILE_MASK,
+
+ TYPE_INST_MASK = 0xF000, /* if (type & TYPE_INST_MASK) it's loadable as an instrument */
+ TYPE_INST_ITI = 0x1000 | TYPE_FILE_MASK, /* .iti (native) instrument */
+ TYPE_INST_XI = 0x2000 | TYPE_FILE_MASK, /* fast tracker .xi */
+ TYPE_INST_OTHER = 0x3000 | TYPE_FILE_MASK, /* gus patch, soundfont, ...? */
+
+ TYPE_SAMPLE_MASK = 0xF0000, /* if (type & TYPE_SAMPLE_MASK) it's loadable as a sample */
+ TYPE_UNKNOWN = 0x10000 | TYPE_FILE_MASK, /* any unrecognized file, loaded as raw pcm data */
+ TYPE_SAMPLE_PLAIN = 0x20000 | TYPE_FILE_MASK, /* au, aiff, wav (simple formats) */
+ TYPE_SAMPLE_EXTD = 0x30000 | TYPE_FILE_MASK, /* its, s3i (tracker formats with extended stuff) */
+ TYPE_SAMPLE_COMPR = 0x40000 | TYPE_FILE_MASK, /* ogg, mp3 (compressed audio) */
+
+ TYPE_INTERNAL_FLAGS = 0xF00000,
+ TYPE_HIDDEN = 0x100000,
+};
+
+/* A brief description of the sort_order field:
+
+When sorting the lists, items with a lower sort_order are given higher placement, and ones with a
+higher sort order are placed toward the bottom. Items with equal sort_order are sorted by their
+basename (using strverscmp).
+
+Defined sort orders:
+ -1024 ... 0 System directories, mount points, volumes, etc.
+ -10 Parent directory
+ 0 Subdirectories of the current directory
+ >= 1 Files. Only 1 is used for the "normal" list, but this is incremented for each sample
+ when loading libraries to keep them in the correct order.
+ Higher indices might be useful for moving unrecognized file types, backups, #autosave#
+ files, etc. to the bottom of the list (rather than omitting these files entirely). */
+
+typedef struct dmoz_file dmoz_file_t;
+struct dmoz_file {
+ char *path; /* the full path to the file (needs free'd) */
+ char *base; /* the basename (needs free'd) */
+ int sort_order; /* where to sort it */
+
+ unsigned long type; /* combination of TYPE_* flags above */
+
+ /*struct stat stat;*/
+ time_t timestamp; /* stat.st_mtime */
+ size_t filesize; /* stat.st_size */
+
+ /* if ((type & TYPE_EXT_DATA_MASK) == 0) nothing below this point will
+ be defined (call dmoz_{fill,filter}_ext_data to define it) */
+
+ const char *description; /* i.e. "Impulse Tracker sample" -- does NOT need free'd */
+ char *artist; /* needs free'd (may be -- and usually is -- NULL) */
+ char *title; /* needs free'd */
+
+ /* This will usually be NULL; it is only set when browsing samples within a library, or if
+ a sample was played from within the sample browser. */
+ song_sample_t *sample;
+ int sampsize; /* number of samples (for instruments) */
+ int instnum;
+
+ /* loader MAY fill this stuff in */
+ char *smp_filename;
+ unsigned int smp_speed;
+ unsigned int smp_loop_start;
+ unsigned int smp_loop_end;
+ unsigned int smp_sustain_start;
+ unsigned int smp_sustain_end;
+ unsigned int smp_length;
+ unsigned int smp_flags;
+
+ unsigned int smp_defvol;
+ unsigned int smp_gblvol;
+ unsigned int smp_vibrato_speed;
+ unsigned int smp_vibrato_depth;
+ unsigned int smp_vibrato_rate;
+};
+
+typedef struct dmoz_dir {
+ char *path; /* full path (needs free'd) */
+ char *base; /* basename of the directory (needs free'd) */
+ int sort_order; /* where to sort it */
+} dmoz_dir_t;
+
+typedef struct dmoz_filelist {
+ int num_files, alloc_size;
+ dmoz_file_t **files;
+
+ int selected; /* communication with cache */
+} dmoz_filelist_t;
+
+typedef struct dmoz_dirlist {
+ int num_dirs, alloc_size;
+ dmoz_dir_t **dirs;
+
+ int selected; /* communication with cache */
+} dmoz_dirlist_t;
+
+/* For any of these, pass NULL for dirs to handle directories and files in the same list.
+for load_library, provide one of the dmoz_read_whatever_library functions, or NULL. */
+int dmoz_read(const char *path, dmoz_filelist_t *files, dmoz_dirlist_t *dirs,
+ int (*load_library)(const char *,dmoz_filelist_t *,dmoz_dirlist_t *));
+void dmoz_free(dmoz_filelist_t *files, dmoz_dirlist_t *dirs);
+
+void dmoz_sort(dmoz_filelist_t *flist, dmoz_dirlist_t *dlist);
+
+/* this function is in audio_loadsave.cc instead of dmoz.c, because of modplugness */
+int dmoz_read_sample_library(const char *path, dmoz_filelist_t *flist, dmoz_dirlist_t *dlist);
+int dmoz_read_instrument_library(const char *path, dmoz_filelist_t *flist, dmoz_dirlist_t *dlist);
+
+/* if ((file->type & TYPE_EXT_DATA_MASK) == 0), call this function to get the title and description */
+int dmoz_filter_ext_data(dmoz_file_t *file);
+
+/* same as dmoz_filter_ext_data, but always returns 1 (for async title reading) */
+int dmoz_fill_ext_data(dmoz_file_t *file);
+
+/* filters stuff based on... whatever you like :) */
+void dmoz_filter_filelist(dmoz_filelist_t *flist, int (*grep)(dmoz_file_t *f), int *pointer, void (*onmove)(void));
+
+/* butt */
+int song_preload_sample(dmoz_file_t *f);
+
+
+/* Path handling functions */
+
+/* Normalize a path (remove /../ and stuff, condense multiple slashes, etc.)
+this will return NULL if the path could not be normalized (not well-formed?).
+the returned string must be free()'d. */
+char *dmoz_path_normal(const char *path);
+
+/* Return nonzero if the path is an absolute path (e.g. /bin, c:\progra~1, sd:/apps, etc.) */
+int dmoz_path_is_absolute(const char *path);
+
+/* Concatenate two paths, adding separators between them as necessary. The returned string must be free()'d.
+The second version can be used if the string lengths are already known to avoid redundant strlen() calls.
+Additionally, if 'b' is an absolute path (as determined by dmoz_path_is_absolute), ignore 'a' and return a
+copy of 'b'. */
+char *dmoz_path_concat(const char *a, const char *b);
+char *dmoz_path_concat_len(const char *a, const char *b, int alen, int blen);
+
+
+/* Adding files and directories
+For all of these, path and base should be free()-able. */
+
+/* If st == NULL, it is assumed to be a directory, and the timestamp/filesize fields are set to zero.
+This way, it's possible to add platform directories ("/", "C:\", whatever) without having to call stat first.
+The return value is the newly created file struct. */
+dmoz_file_t *dmoz_add_file(dmoz_filelist_t *flist, char *path, char *base, struct stat *st, int sort_order);
+
+/* The return value is the newly created dir struct. */
+dmoz_dir_t *dmoz_add_dir(dmoz_dirlist_t *dlist, char *path, char *base, int sort_order);
+
+/* Add a directory to either the dir list (if dlist != NULL) or the file list otherwise. This is basically a
+convenient shortcut for adding a directory. */
+void dmoz_add_file_or_dir(dmoz_filelist_t *flist, dmoz_dirlist_t *dlist,
+ char *path, char *base, struct stat *st, int sort_order);
+
+/* this is called by main to actually do some dmoz work. returns 0 if there is no dmoz work to do...
+*/
+int dmoz_worker(void);
+
+/* these update the file selection cache for the various pages */
+void dmoz_cache_update_names(const char *path, const char *filen, const char *dirn);
+void dmoz_cache_update(const char *path, dmoz_filelist_t *fl, dmoz_dirlist_t *dl);
+void dmoz_cache_lookup(const char *path, dmoz_filelist_t *fl, dmoz_dirlist_t *dl);
+
+#endif /* ! DMOZ_H */
diff --git a/src/include/event.h b/src/include/event.h
new file mode 100644
index 0000000..2bdcdc8
--- /dev/null
+++ b/src/include/event.h
@@ -0,0 +1,46 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef _schismevent_h
+#define _schismevent_h
+
+#include "sdlmain.h"
+
+#define SCHISM_EVENT_UPDATE_IPMIDI SDL_USEREVENT+0
+#define SCHISM_EVENT_MIDI SDL_USEREVENT+1
+#define SCHISM_EVENT_PLAYBACK SDL_USEREVENT+2
+#define SCHISM_EVENT_NATIVE SDL_USEREVENT+3
+#define SCHISM_EVENT_PASTE SDL_USEREVENT+4
+
+#define SCHISM_EVENT_MIDI_NOTE 1
+#define SCHISM_EVENT_MIDI_CONTROLLER 2
+#define SCHISM_EVENT_MIDI_PROGRAM 3
+#define SCHISM_EVENT_MIDI_AFTERTOUCH 4
+#define SCHISM_EVENT_MIDI_PITCHBEND 5
+#define SCHISM_EVENT_MIDI_TICK 6
+#define SCHISM_EVENT_MIDI_SYSEX 7
+#define SCHISM_EVENT_MIDI_SYSTEM 8
+
+#define SCHISM_EVENT_NATIVE_OPEN 1
+#define SCHISM_EVENT_NATIVE_SCRIPT 16
+
+#endif
diff --git a/src/include/fmopl.h b/src/include/fmopl.h
new file mode 100644
index 0000000..85ed3dd
--- /dev/null
+++ b/src/include/fmopl.h
@@ -0,0 +1,122 @@
+#ifndef __FMOPL_H_
+#define __FMOPL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define logerror(...) /**/
+
+/* --- select emulation chips --- */
+#define BUILD_YM3812 (HAS_YM3812)
+#define BUILD_YM3526 (HAS_YM3526)
+#define BUILD_Y8950 (HAS_Y8950)
+
+/* select output bits size of output : 8 or 16 */
+#define OPL_SAMPLE_BITS 16
+
+/* compiler dependence */
+#ifndef __OSDCOMM_H__
+#define __OSDCOMM_H__
+typedef unsigned char UINT8; /* unsigned 8bit */
+typedef unsigned short UINT16; /* unsigned 16bit */
+typedef unsigned int UINT32; /* unsigned 32bit */
+typedef signed char INT8; /* signed 8bit */
+typedef signed short INT16; /* signed 16bit */
+typedef signed int INT32; /* signed 32bit */
+#endif /* __OSDCOMM_H__ */
+
+#ifndef INLINE
+#define INLINE static __inline__
+#endif
+
+#if (OPL_SAMPLE_BITS==16)
+typedef INT16 OPLSAMPLE;
+#endif
+#if (OPL_SAMPLE_BITS==8)
+typedef INT8 OPLSAMPLE;
+#endif
+
+
+typedef void (*OPL_TIMERHANDLER)(void *param,int timer,double period);
+typedef void (*OPL_IRQHANDLER)(void *param,int irq);
+typedef void (*OPL_UPDATEHANDLER)(void *param,int min_interval_us);
+typedef void (*OPL_PORTHANDLER_W)(void *param,unsigned char data);
+typedef unsigned char (*OPL_PORTHANDLER_R)(void *param);
+
+
+#if BUILD_YM3812
+
+void *ym3812_init(UINT32 clock, UINT32 rate);
+void ym3812_shutdown(void *chip);
+void ym3812_reset_chip(void *chip);
+int ym3812_write(void *chip, int a, int v);
+unsigned char ym3812_read(void *chip, int a);
+int ym3812_timer_over(void *chip, int c);
+void ym3812_update_one(void *chip, OPLSAMPLE *buffer, int length);
+
+void ym3812_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
+void ym3812_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
+void ym3812_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
+
+#endif /* BUILD_YM3812 */
+
+
+#if BUILD_YM3526
+
+/*
+** Initialize YM3526 emulator(s).
+**
+** 'num' is the number of virtual YM3526's to allocate
+** 'clock' is the chip clock in Hz
+** 'rate' is sampling rate
+*/
+void *ym3526_init(UINT32 clock, UINT32 rate);
+/* shutdown the YM3526 emulators*/
+void ym3526_shutdown(void *chip);
+void ym3526_reset_chip(void *chip);
+int ym3526_write(void *chip, int a, int v);
+unsigned char ym3526_read(void *chip, int a);
+int ym3526_timer_over(void *chip, int c);
+/*
+** Generate samples for one of the YM3526's
+**
+** 'which' is the virtual YM3526 number
+** '*buffer' is the output buffer pointer
+** 'length' is the number of samples that should be generated
+*/
+void ym3526_update_one(void *chip, OPLSAMPLE *buffer, int length);
+
+void ym3526_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
+void ym3526_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
+void ym3526_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
+
+#endif /* BUILD_YM3526 */
+
+
+#if BUILD_Y8950
+
+/* Y8950 port handlers */
+void y8950_set_port_handler(void *chip, OPL_PORTHANDLER_W PortHandler_w, OPL_PORTHANDLER_R PortHandler_r, void *param);
+void y8950_set_keyboard_handler(void *chip, OPL_PORTHANDLER_W KeyboardHandler_w, OPL_PORTHANDLER_R KeyboardHandler_r, void *param);
+void y8950_set_delta_t_memory(void *chip, void * deltat_mem_ptr, int deltat_mem_size );
+
+void * y8950_init(UINT32 clock, UINT32 rate);
+void y8950_shutdown(void *chip);
+void y8950_reset_chip(void *chip);
+int y8950_write(void *chip, int a, int v);
+unsigned char y8950_read (void *chip, int a);
+int y8950_timer_over(void *chip, int c);
+void y8950_update_one(void *chip, OPLSAMPLE *buffer, int length);
+
+void y8950_set_timer_handler(void *chip, OPL_TIMERHANDLER TimerHandler, void *param);
+void y8950_set_irq_handler(void *chip, OPL_IRQHANDLER IRQHandler, void *param);
+void y8950_set_update_handler(void *chip, OPL_UPDATEHANDLER UpdateHandler, void *param);
+
+#endif /* BUILD_Y8950 */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __FMOPL_H__ */
diff --git a/src/include/fmt-types.h b/src/include/fmt-types.h
new file mode 100644
index 0000000..04e7155
--- /dev/null
+++ b/src/include/fmt-types.h
@@ -0,0 +1,153 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* This file is used for file format tables, load ordering, and declarations. It is intended to be included
+after defining macros for handling the various file types listed here, and as such, it is not #ifdef guarded.
+
+The type list should be arranged so that the types with the most specific checks are first, and the vaguest
+ones are down at the bottom. This is to ensure that some lousy type doesn't "steal" files of a different type.
+For example, if IT came before S3M, any S3M file starting with "IMPM" (which is unlikely, but possible, and
+in fact quite easy to do) would be picked up by the IT check. In fact, Impulse Tracker itself has this problem.
+
+Also, a format that might need to do a lot of work to tell if a file is of the right type (i.e. the MDL format
+practically requires reading through the entire file to find the title block) should be down farther on the
+list for performance purposes.
+
+Don't rearrange the formats that are already here unless you have a VERY good reason to do so. I spent a good
+3-4 hours reading all the format specifications, testing files, checking notes, and trying to break the
+program by giving it weird files, and I'm pretty sure that this ordering won't fail unless you really try
+doing weird stuff like hacking the files, but then you're just asking for trouble. ;) */
+
+
+#ifndef READ_INFO
+# define READ_INFO(x)
+#endif
+#ifndef LOAD_SONG
+# define LOAD_SONG(x)
+#endif
+#ifndef SAVE_SONG
+# define SAVE_SONG(x)
+#endif
+#ifndef LOAD_SAMPLE
+# define LOAD_SAMPLE(x)
+#endif
+#ifndef SAVE_SAMPLE
+# define SAVE_SAMPLE(x)
+#endif
+#ifndef LOAD_INSTRUMENT
+# define LOAD_INSTRUMENT(x)
+#endif
+#ifndef SAVE_INSTRUMENT /* not actually used - instrument saving is currently hardcoded to write .iti files */
+# define SAVE_INSTRUMENT(x)
+#endif
+#ifndef EXPORT
+# define EXPORT(x)
+#endif
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+/* 669 has lots of checks to compensate for a really crappy 2-byte magic. (It's even a common English word
+ffs... "if"?!) Still, it's better than STM. The only reason this is first is because the position of the
+SCRM magic lies within the 669 message field, and the 669 check is much more complex (and thus more likely
+to be right). */
+READ_INFO(669) LOAD_SONG(669)
+
+/* Since so many programs have added noncompatible extensions to the mod format, there are about 30 strings to
+compare against for the magic. Also, there are special cases for WOW files, which even share the same magic
+as plain ProTracker, but are quite different; there are some really nasty heuristics to detect these... ugh,
+ugh, ugh. However, it has to be above the formats with the magic at the beginning... */
+READ_INFO(mod) LOAD_SONG(mod)
+
+/* S3M needs to be before a lot of stuff. */
+READ_INFO(s3m) LOAD_SONG(s3m) SAVE_SONG(s3m)
+/* FAR and S3M have different magic in the same place, so it doesn't really matter which one goes
+where. I just have S3M first since it's a more common format. */
+READ_INFO(far) LOAD_SONG(far)
+
+/* These next formats have their magic at the beginning of the data, so none of them can possibly
+conflict with other ones. I've organized them pretty much in order of popularity. */
+READ_INFO(xm) LOAD_SONG(xm)
+READ_INFO(it) LOAD_SONG(it) SAVE_SONG(it)
+READ_INFO(mt2)
+READ_INFO(mtm) LOAD_SONG(mtm)
+READ_INFO(ntk)
+READ_INFO(mdl) LOAD_SONG(mdl)
+READ_INFO(med)
+READ_INFO(okt) LOAD_SONG(okt)
+READ_INFO(mid) LOAD_SONG(mid)
+READ_INFO(mus) LOAD_SONG(mus)
+READ_INFO(mf)
+
+/* Sample formats with magic at start of file */
+READ_INFO(its) LOAD_SAMPLE(its) SAVE_SAMPLE(its)
+READ_INFO(au) LOAD_SAMPLE(au) SAVE_SAMPLE(au)
+READ_INFO(aiff) LOAD_SAMPLE(aiff) SAVE_SAMPLE(aiff) EXPORT(aiff)
+READ_INFO(wav) LOAD_SAMPLE(wav) SAVE_SAMPLE(wav) EXPORT(wav)
+READ_INFO(iti) LOAD_INSTRUMENT(iti)
+READ_INFO(xi) LOAD_INSTRUMENT(xi)
+READ_INFO(pat) LOAD_INSTRUMENT(pat)
+
+READ_INFO(ult) LOAD_SONG(ult)
+READ_INFO(liq)
+
+READ_INFO(ams)
+READ_INFO(f2r)
+
+READ_INFO(s3i) LOAD_SAMPLE(s3i) SAVE_SAMPLE(s3i) /* FIXME should this be moved? S3I has magic at 0x4C... */
+
+/* IMF and SFX (as well as STX) all have the magic values at 0x3C-0x3F, which is positioned in IT's
+"reserved" field, Not sure about this positioning, but these are kind of rare formats anyway. */
+READ_INFO(imf) LOAD_SONG(imf)
+READ_INFO(sfx) LOAD_SONG(sfx)
+
+/* bleh */
+#if defined(USE_NON_TRACKED_TYPES) && defined(HAVE_VORBIS)
+READ_INFO(ogg)
+#endif
+
+/* STM seems to have a case insensitive magic string with several possible values, and only one byte
+is guaranteed to be the same in the whole file... yeagh. */
+READ_INFO(stm) LOAD_SONG(stm)
+
+/* An ID3 tag could actually be anywhere in an MP3 file, and there's no guarantee that it even exists
+at all. I might move this toward the top if I can figure out how to identify an MP3 more precisely. */
+#ifdef USE_NON_TRACKED_TYPES
+READ_INFO(mp3)
+#endif
+
+/* not really a type, so no info reader for these */
+LOAD_SAMPLE(raw) SAVE_SAMPLE(raw)
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+/* Clear these out so subsequent includes don't make an ugly mess */
+
+#undef READ_INFO
+#undef LOAD_SONG
+#undef SAVE_SONG
+#undef LOAD_SAMPLE
+#undef SAVE_SAMPLE
+#undef LOAD_INSTRUMENT
+#undef SAVE_INSTRUMENT
+#undef EXPORT
+
diff --git a/src/include/fmt.h b/src/include/fmt.h
new file mode 100644
index 0000000..2873dfa
--- /dev/null
+++ b/src/include/fmt.h
@@ -0,0 +1,175 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef FMT_H
+#define FMT_H
+
+#include <stdint.h>
+#include "dmoz.h"
+#include "slurp.h"
+#include "util.h"
+
+#include "disko.h"
+
+#include "sndfile.h"
+
+/* --------------------------------------------------------------------------------------------------------- */
+/* module loaders */
+
+/* flags to skip loading some data (mainly for scraping titles)
+this is only a suggestion in order to speed loading; don't be surprised if the loader ignores these */
+#define LOAD_NOSAMPLES 1
+#define LOAD_NOPATTERNS 2
+
+/* return codes for module loaders */
+enum {
+ LOAD_SUCCESS, /* all's well */
+ LOAD_UNSUPPORTED, /* wrong file type for the loader */
+ LOAD_FILE_ERROR, /* couldn't read the file; check errno */
+ LOAD_FORMAT_ERROR, /* it appears to be the correct type, but there's something wrong */
+};
+
+/* return codes for modules savers */
+enum {
+ SAVE_SUCCESS, /* all's well */
+ SAVE_FILE_ERROR, /* couldn't write the file; check errno */
+ SAVE_INTERNAL_ERROR, /* something unrelated to disk i/o */
+};
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+#define PROTO_READ_INFO (dmoz_file_t *file, const uint8_t *data, size_t length)
+#define PROTO_LOAD_SONG (song_t *song, slurp_t *fp, unsigned int lflags)
+#define PROTO_SAVE_SONG (disko_t *fp, song_t *song)
+#define PROTO_LOAD_SAMPLE (const uint8_t *data, size_t length, song_sample_t *smp)
+#define PROTO_SAVE_SAMPLE (disko_t *fp, song_sample_t *smp)
+#define PROTO_LOAD_INSTRUMENT (const uint8_t *data, size_t length, int slot)
+#define PROTO_EXPORT_HEAD (disko_t *fp, int bits, int channels, int rate)
+#define PROTO_EXPORT_SILENCE (disko_t *fp, long bytes)
+#define PROTO_EXPORT_BODY (disko_t *fp, const uint8_t *data, size_t length)
+#define PROTO_EXPORT_TAIL (disko_t *fp)
+
+typedef int (*fmt_read_info_func) PROTO_READ_INFO;
+typedef int (*fmt_load_song_func) PROTO_LOAD_SONG;
+typedef int (*fmt_save_song_func) PROTO_SAVE_SONG;
+typedef int (*fmt_load_sample_func) PROTO_LOAD_SAMPLE;
+typedef int (*fmt_save_sample_func) PROTO_SAVE_SAMPLE;
+typedef int (*fmt_load_instrument_func) PROTO_LOAD_INSTRUMENT;
+typedef int (*fmt_export_head_func) PROTO_EXPORT_HEAD;
+typedef int (*fmt_export_silence_func) PROTO_EXPORT_SILENCE;
+typedef int (*fmt_export_body_func) PROTO_EXPORT_BODY;
+typedef int (*fmt_export_tail_func) PROTO_EXPORT_TAIL;
+
+#define READ_INFO(t) int fmt_##t##_read_info PROTO_READ_INFO;
+#define LOAD_SONG(t) int fmt_##t##_load_song PROTO_LOAD_SONG;
+#define SAVE_SONG(t) int fmt_##t##_save_song PROTO_SAVE_SONG;
+#define LOAD_SAMPLE(t) int fmt_##t##_load_sample PROTO_LOAD_SAMPLE;
+#define SAVE_SAMPLE(t) int fmt_##t##_save_sample PROTO_SAVE_SAMPLE;
+#define LOAD_INSTRUMENT(t) int fmt_##t##_load_instrument PROTO_LOAD_INSTRUMENT;
+#define EXPORT(t) int fmt_##t##_export_head PROTO_EXPORT_HEAD; \
+ int fmt_##t##_export_silence PROTO_EXPORT_SILENCE; \
+ int fmt_##t##_export_body PROTO_EXPORT_BODY; \
+ int fmt_##t##_export_tail PROTO_EXPORT_TAIL;
+
+#include "fmt-types.h"
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+struct save_format {
+ const char *label; // label for the button on the save page
+ const char *name; // long name of format
+ const char *ext; // no dot
+ union {
+ fmt_save_song_func save_song;
+ fmt_save_sample_func save_sample;
+ struct {
+ fmt_export_head_func head;
+ fmt_export_silence_func silence;
+ fmt_export_body_func body;
+ fmt_export_tail_func tail;
+ int multi;
+ } export;
+ } f;
+};
+
+extern const struct save_format song_save_formats[];
+extern const struct save_format song_export_formats[];
+extern const struct save_format sample_save_formats[];
+
+/* --------------------------------------------------------------------------------------------------------- */
+struct instrumentloader {
+ song_instrument_t *inst;
+ int sample_map[MAX_SAMPLES];
+ int basex, slot, expect_samples;
+};
+song_instrument_t *instrument_loader_init(struct instrumentloader *ii, int slot);
+int instrument_loader_abort(struct instrumentloader *ii);
+int instrument_loader_sample(struct instrumentloader *ii, int slot);
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+uint32_t it_decompress8(void *dest, uint32_t len, const void *file, uint32_t filelen, int it215, int channels);
+uint32_t it_decompress16(void *dest, uint32_t len, const void *file, uint32_t filelen, int it215, int channels);
+
+uint16_t mdl_read_bits(uint32_t *bitbuf, uint32_t *bitnum, uint8_t **ibuf, int8_t n);
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+/* shared by the .it, .its, and .iti saving functions */
+void save_its_header(disko_t *fp, song_sample_t *smp);
+int load_its_sample(const uint8_t *header, const uint8_t *data, size_t length, song_sample_t *smp);
+
+/* --------------------------------------------------------------------------------------------------------- */
+// other misc functions...
+
+/* effect_weight[FX_something] => how "important" the effect is. */
+extern const uint8_t effect_weight[];
+
+/* Shuffle the effect and volume-effect values around.
+Note: this does NOT convert between volume and 'normal' effects, it only exchanges them.
+(This function is most useful in conjunction with convert_voleffect in order to try to
+cram ten pounds of crap into a five pound container) */
+void swap_effects(song_note_t *note);
+
+/* Convert volume column data from FX_* to VOLFX_*, if possible.
+Return: 1 = it was properly converted, 0 = couldn't do so without loss of information. */
+int convert_voleffect(uint8_t *effect, uint8_t *param, int force);
+#define convert_voleffect_of(note,force) convert_voleffect(&((note)->voleffect), &((note)->volparam), (force))
+
+// load a .mod-style 4-byte packed note
+void mod_import_note(const uint8_t p[4], song_note_t *note);
+
+// Read a message with fixed-size line lengths
+void read_lined_message(char *msg, slurp_t *fp, int len, int linelen);
+
+
+// get L-R-R-L panning value from a (zero-based!) channel number
+#define PROTRACKER_PANNING(n) (((((n) + 1) >> 1) & 1) * 256)
+
+// convert .mod finetune byte value to c5speed
+#define MOD_FINETUNE(b) (finetune_table[((b) & 0xf) ^ 8])
+
+/* --------------------------------------------------------------------------------------------------------- */
+
+#endif /* ! FMT_H */
+
diff --git a/src/include/headers.h b/src/include/headers.h
new file mode 100644
index 0000000..32e0d42
--- /dev/null
+++ b/src/include/headers.h
@@ -0,0 +1,250 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __headers_h
+#define __headers_h
+/* This is probably overkill, but it's consistent this way. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Some stuff was conditionally included only for files that need it, but really it's not like defining
+bswapLE32 or including sys/time.h adversely affects compilation time. This isn't some xboxhueg project
+that takes hours to build, these are little silly overoptimizations, and it's just troublesome to try
+to work out what order headers are supposed to be processed so that all the other files pick up the bits
+of headers.h that they need (song_t, I'm looking at you)
+Eventually I'll do some housekeeping with the headers and get rid of all these silly NEED_*'s, but this
+will do for now. */
+#define NEED_BYTESWAP
+#define NEED_TIME
+#define NEED_DIRENT
+
+
+#include <stdio.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <stdarg.h>
+
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#include <stdint.h>
+
+
+/* Portability is a pain. */
+#if STDC_HEADERS
+# include <string.h>
+#else
+# ifndef HAVE_STRCHR
+# define strchr index
+# define strrchr rindex
+# endif
+char *strchr(), *strrchr();
+# ifndef HAVE_MEMMOVE
+# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# define memmove(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+#if !defined(HAVE_STRCASECMP) && defined(HAVE_STRICMP)
+# define strcasecmp stricmp
+#endif
+#if !defined(HAVE_STRNCASECMP) && defined(HAVE_STRNICMP)
+# define strncasecmp strnicmp
+#endif
+#ifndef HAVE_STRVERSCMP
+# define strverscmp strcasecmp
+#endif
+#ifndef HAVE_STRCASESTR
+# define strcasestr strstr // derp
+#endif
+
+#if HAVE_UNISTD_H
+# include <sys/types.h>
+# include <unistd.h>
+#endif
+
+
+#ifdef NEED_DIRENT
+# if HAVE_DIRENT_H
+# include <dirent.h>
+# ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(dirent) strlen((dirent)->d_name)
+# endif
+# else
+# define dirent direct
+# ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(dirent) strlen((dirent)->d_name)
+# endif
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# endif
+#endif
+
+/* dumb workaround for dumb devkitppc bug */
+#ifdef GEKKO
+# undef NAME_MAX
+# undef PATH_MAX
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef NAME_MAX
+# ifdef MAXPATHLEN
+# define NAME_MAX MAXPATHLEN /* BSD name */
+# else
+# ifdef FILENAME_MAX
+# define NAME_MAX FILENAME_MAX
+# else
+# define NAME_MAX 256
+# endif
+# endif
+#endif
+
+
+#ifdef NEED_TIME
+# if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+# else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+# endif
+# ifndef timersub
+// from FreeBSD
+# define timersub(tvp, uvp, vvp) \
+ do { \
+ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
+ (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
+ if ((vvp)->tv_usec < 0) { \
+ (vvp)->tv_sec--; \
+ (vvp)->tv_usec += 1000000; \
+ } \
+ } while (0)
+# endif
+#endif
+
+#ifdef REALLY_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
+#define WORDS_BIGENDIAN 1
+#endif
+#endif
+
+#ifdef NEED_BYTESWAP
+# if HAVE_BYTESWAP_H
+/* byteswap.h uses inline assembly if possible (faster than bit-shifting) */
+# include <byteswap.h>
+# else
+# define bswap_32(x) (((((unsigned int)x) & 0xFF) << 24) | ((((unsigned int)x) & 0xFF00) << 8) \
+ | (((((unsigned int)x) & 0xFF0000) >> 8) & 0xFF00) \
+ | ((((((unsigned int)x) & 0xFF000000) >> 24)) & 0xFF))
+# define bswap_16(x) (((((unsigned short)x) >> 8) & 0xFF) | ((((unsigned short)x) << 8) & 0xFF00))
+# endif
+/* define the endian-related byte swapping (taken from libmodplug sndfile.h, glibc, and sdl) */
+# if defined(ARM) && defined(_WIN32_WCE)
+/* I have no idea what this does, but okay :) */
+
+/* This forces integer operations to only occur on aligned
+ addresses. -mrsb */
+static inline unsigned short int ARM_get16(const void *data)
+{
+ unsigned short int s;
+ memcpy(&s,data,sizeof(s));
+ return s;
+}
+static inline unsigned int ARM_get32(const void *data)
+{
+ unsigned int s;
+ memcpy(&s,data,sizeof(s));
+ return s;
+}
+# define bswapLE16(x) ARM_get16(&x)
+# define bswapLE32(x) ARM_get32(&x)
+# define bswapBE16(x) bswap_16(ARM_get16(&x))
+# define bswapBE32(x) bswap_32(ARM_get32(&x))
+# elif WORDS_BIGENDIAN
+# define bswapLE16(x) bswap_16(x)
+# define bswapLE32(x) bswap_32(x)
+# define bswapBE16(x) (x)
+# define bswapBE32(x) (x)
+# else
+# define bswapBE16(x) bswap_16(x)
+# define bswapBE32(x) bswap_32(x)
+# define bswapLE16(x) (x)
+# define bswapLE32(x) (x)
+# endif
+#endif
+
+/* Prototypes for replacement functions */
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **strp, const char *fmt, ...);
+#endif
+#ifndef HAVE_VASPRINTF
+int vasprintf(char **strp, const char *fmt, va_list ap);
+#endif
+#ifdef NEED_TIME
+# ifndef HAVE_STRPTIME
+char *strptime(const char *buf, const char *fmt, struct tm *tm);
+# endif
+# ifdef WIN32
+struct tm *localtime_r(const time_t *timep, struct tm *result);
+# endif
+#endif
+#ifndef HAVE_MKSTEMP
+int mkstemp(char *template);
+#endif
+
+#ifdef __APPLE_CC__
+#define MACOSX 1
+#endif
+
+/* Various other stuff */
+#ifdef WIN32
+# define mkdir(path,mode) mkdir(path)
+# define setenv(a,b,c) /* stupid windows */
+# define fsync _commit
+#endif
+
+#define INT_SHAPED_PTR(v) ((intptr_t)(((void*)(v))))
+#define PTR_SHAPED_INT(i) ((void*)i)
+
+#endif
+
diff --git a/src/include/it_defs.h b/src/include/it_defs.h
new file mode 100644
index 0000000..0c37ac4
--- /dev/null
+++ b/src/include/it_defs.h
@@ -0,0 +1,128 @@
+#ifndef _ITDEFS_H_
+#define _ITDEFS_H_
+
+#pragma pack(push, 1)
+
+struct it_file {
+ uint32_t id; // 0x4D504D49
+ int8_t songname[26];
+ uint8_t hilight_minor;
+ uint8_t hilight_major;
+ uint16_t ordnum;
+ uint16_t insnum;
+ uint16_t smpnum;
+ uint16_t patnum;
+ uint16_t cwtv;
+ uint16_t cmwt;
+ uint16_t flags;
+ uint16_t special;
+ uint8_t globalvol;
+ uint8_t mv;
+ uint8_t speed;
+ uint8_t tempo;
+ uint8_t sep;
+ uint8_t pwd;
+ uint16_t msglength;
+ uint32_t msgoffset;
+ uint32_t reserved2;
+ uint8_t chnpan[64];
+ uint8_t chnvol[64];
+};
+
+
+struct it_envelope {
+ uint8_t flags;
+ uint8_t num;
+ uint8_t lpb;
+ uint8_t lpe;
+ uint8_t slb;
+ uint8_t sle;
+ uint8_t data[25*3];
+ uint8_t reserved;
+};
+
+// Old Impulse Instrument Format (cmwt < 0x200)
+struct it_instrument_old {
+ uint32_t id; // IMPI = 0x49504D49
+ int8_t filename[12]; // DOS file name
+ uint8_t zero;
+ uint8_t flags;
+ uint8_t vls;
+ uint8_t vle;
+ uint8_t sls;
+ uint8_t sle;
+ uint16_t reserved1;
+ uint16_t fadeout;
+ uint8_t nna;
+ uint8_t dnc;
+ uint16_t trkvers;
+ uint8_t nos;
+ uint8_t reserved2;
+ int8_t name[26];
+ uint16_t reserved3[3];
+ uint8_t keyboard[240];
+ uint8_t volenv[200];
+ uint8_t nodes[50];
+};
+
+
+// Impulse Instrument Format
+struct it_instrument {
+ uint32_t id;
+ int8_t filename[12];
+ uint8_t zero;
+ uint8_t nna;
+ uint8_t dct;
+ uint8_t dca;
+ uint16_t fadeout;
+ signed char pps;
+ uint8_t ppc;
+ uint8_t gbv;
+ uint8_t dfp;
+ uint8_t rv;
+ uint8_t rp;
+ uint16_t trkvers;
+ uint8_t nos;
+ uint8_t reserved1;
+ int8_t name[26];
+ uint8_t ifc;
+ uint8_t ifr;
+ uint8_t mch;
+ uint8_t mpr;
+ uint16_t mbank;
+ uint8_t keyboard[240];
+ struct it_envelope volenv;
+ struct it_envelope panenv;
+ struct it_envelope pitchenv;
+ uint8_t dummy[4]; // was 7, but IT v2.17 saves 554 bytes
+};
+
+
+// IT Sample Format
+struct it_sample {
+ uint32_t id; // 0x53504D49
+ int8_t filename[12];
+ uint8_t zero;
+ uint8_t gvl;
+ uint8_t flags;
+ uint8_t vol;
+ int8_t name[26];
+ uint8_t cvt;
+ uint8_t dfp;
+ uint32_t length;
+ uint32_t loopbegin;
+ uint32_t loopend;
+ uint32_t C5Speed;
+ uint32_t susloopbegin;
+ uint32_t susloopend;
+ uint32_t samplepointer;
+ uint8_t vis;
+ uint8_t vid;
+ uint8_t vir;
+ uint8_t vit;
+};
+
+#pragma pack(pop)
+
+
+#endif
diff --git a/src/include/log.h b/src/include/log.h
new file mode 100644
index 0000000..831c120
--- /dev/null
+++ b/src/include/log.h
@@ -0,0 +1,59 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef SCHISM_LOG_H
+#define SCHISM_LOG_H
+
+#if 0
+
+void log_nl(void);
+void log_append(int color, int must_free, const char *text);
+void log_append2(int bios_font, int color, int must_free, const char *text);
+void log_appendf(int color, const char *format, ...)
+ __attribute__ ((format(printf, 2, 3)));
+void log_underline(int chars);
+
+void log_perror(const char *prefix);
+
+void status_text_flash(const char *format, ...)
+ __attribute__ ((format(printf, 1, 2)));
+void status_text_flash_bios(const char *format, ...)
+ __attribute__ ((format(printf, 1, 2)));
+
+#else
+
+#define log_nl()
+
+#define log_append(color, must_free, text)
+#define log_append2(bios_font, color, must_free, text)
+#define log_appendf(color, format, ...)
+#define log_underline(chars)
+
+#define log_perror(prefix)
+
+#define status_text_flash(format, ...)
+#define status_text_flash_bios(format, ...)
+
+#endif
+
+#endif
+
diff --git a/src/include/midi.h b/src/include/midi.h
new file mode 100644
index 0000000..9edb867
--- /dev/null
+++ b/src/include/midi.h
@@ -0,0 +1,162 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MIDI_H
+#define MIDI_H
+
+struct midi_provider;
+struct midi_port;
+
+#define MIDI_PORT_CAN_SCHEDULE 1
+struct midi_driver {
+ unsigned int flags;
+
+ void (*poll)(struct midi_provider *m);
+ int (*thread)(struct midi_provider *m);
+
+ int (*enable)(struct midi_port *d);
+ int (*disable)(struct midi_port *d);
+
+ void (*send)(struct midi_port *d,
+ const unsigned char *seq, unsigned int len, unsigned int delay);
+ void (*drain)(struct midi_port *d);
+};
+
+struct midi_provider {
+ char *name;
+ void (*poll)(struct midi_provider *);
+ void *thread; /*actually SDL_Thread* */
+
+ struct midi_provider *next;
+
+ /* forwarded; don't touch */
+ int (*enable)(struct midi_port *d);
+ int (*disable)(struct midi_port *d);
+
+ void (*send_now)(struct midi_port *d,
+ const unsigned char *seq, unsigned int len, unsigned int delay);
+ void (*send_later)(struct midi_port *d,
+ const unsigned char *seq, unsigned int len, unsigned int delay);
+ void (*drain)(struct midi_port *d);
+};
+
+#define MIDI_INPUT 1
+#define MIDI_OUTPUT 2
+struct midi_port {
+ int io, iocap;
+ char *name;
+ int num;
+
+ void *userdata;
+ int free_userdata;
+ int (*enable)(struct midi_port *d);
+ int (*disable)(struct midi_port *d);
+ void (*send_now)(struct midi_port *d,
+ const unsigned char *seq, unsigned int len, unsigned int delay);
+ void (*send_later)(struct midi_port *d,
+ const unsigned char *seq, unsigned int len, unsigned int delay);
+ void (*drain)(struct midi_port *d);
+
+ struct midi_provider *provider;
+};
+
+
+/* schism calls these directly */
+int midi_engine_start(void);
+void midi_engine_reset(void);
+void midi_engine_stop(void);
+void midi_engine_poll_ports(void);
+
+/* some parts of schism call this; it means "immediately" */
+void midi_send_now(const unsigned char *seq, unsigned int len);
+
+/* ... but the player calls this */
+void midi_send_buffer(const unsigned char *data, unsigned int len, unsigned int pos);
+void midi_send_flush(void);
+
+/* used by the audio thread */
+int midi_need_flush(void);
+
+/* from the SDL event mechanism (x is really SDL_Event) */
+int midi_engine_handle_event(void *x);
+
+struct midi_port *midi_engine_port(int n, const char **name);
+int midi_engine_port_count(void);
+
+/* midi engines register a provider (one each!) */
+struct midi_provider *midi_provider_register(const char *name, struct midi_driver *f);
+
+
+/* midi engines list ports this way */
+int midi_port_register(struct midi_provider *p,
+int inout, const char *name, void *userdata, int free_userdata);
+
+int midi_port_foreach(struct midi_provider *p, struct midi_port **cursor);
+void midi_port_unregister(int num);
+
+/* only call these if the event isn't really MIDI but you want most of the system
+ to act like it is...
+
+ midi drivers should never all these...
+*/
+enum midi_note {
+ MIDI_NOTEOFF,
+ MIDI_NOTEON,
+ MIDI_KEYPRESS,
+};
+void midi_event_note(enum midi_note mnstatus, int channel, int note, int velocity);
+void midi_event_controller(int channel, int param, int value);
+void midi_event_program(int channel, int value);
+void midi_event_aftertouch(int channel, int value);
+void midi_event_pitchbend(int channel, int value);
+void midi_event_tick(void);
+void midi_event_sysex(const unsigned char *data, unsigned int len);
+void midi_event_system(int argv, int param);
+
+/* midi drivers call this when they received an event */
+void midi_received_cb(struct midi_port *src, unsigned char *data, unsigned int len);
+
+
+int ip_midi_setup(void); // USE_NETWORK
+void ip_midi_setports(int n); // USE_NETWORK
+int ip_midi_getports(void); // USE_NETWORK
+
+int oss_midi_setup(void); // USE_OSS
+int alsa_midi_setup(void); // USE_ALSA
+int win32mm_midi_setup(void); // WIN32
+int macosx_midi_setup(void); // MACOSX
+
+
+/* MIDI_PITCH_BEND is defined by OSS -- maybe these need more specific names? */
+#define MIDI_TICK_QUANTIZE 0x00000001
+#define MIDI_BASE_PROGRAM1 0x00000002
+#define MIDI_RECORD_NOTEOFF 0x00000004
+#define MIDI_RECORD_VELOCITY 0x00000008
+#define MIDI_RECORD_AFTERTOUCH 0x00000010
+#define MIDI_CUT_NOTE_OFF 0x00000020
+#define MIDI_PITCHBEND 0x00000040
+#define MIDI_DISABLE_RECORD 0x00010000
+
+extern int midi_flags, midi_pitch_depth, midi_amplification, midi_c5note;
+
+#endif
diff --git a/src/include/osdefs.h b/src/include/osdefs.h
new file mode 100644
index 0000000..25e92f4
--- /dev/null
+++ b/src/include/osdefs.h
@@ -0,0 +1,160 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* OS-dependent code implementations are defined here; the files for each target OS exist in sys/blah/osdefs.c,
+and possibly other files as well. Only one osdefs.c should be in use at a time. */
+
+#ifndef OSDEFS_H
+#define OSDEFS_H
+
+#include "headers.h"
+#include "event.h"
+
+// This is defined in osdefs.c but not used anywhere.
+// Currently, its only purpose is to prevent erroneous linking of multiple osdefs.o files in the same build.
+extern const char *osname;
+
+
+/*
+os_sysinit: any platform-dependent setup that needs to occur directly upon startup.
+This code is processed right as soon as main() starts.
+
+os_sdlinit: any platform-dependent setup that needs to occur after SDL is up and running.
+Currently only used on the Wii in order to get the Wiimote working.
+
+os_sdlevent: preprocessing for SDL events.
+This is used to hack in system-dependent input methods (e.g. F16 and other scancodes on OS X; Wiimote buttons;
+etc.) If defined, this function will be called after capturing an SDL event.
+A return value of 0 indicates that the event should NOT be processed by the main event handler.
+*/
+#if defined(MACOSX)
+# define os_sdlevent macosx_sdlevent
+#elif defined(GEKKO)
+# define os_sysinit wii_sysinit
+# define os_sdlinit wii_sdlinit
+# define os_sysexit wii_sysexit
+# define os_sdlevent wii_sdlevent
+#elif defined(WIN32)
+# define os_sysinit win32_sysinit
+#endif
+
+#ifndef os_sdlevent
+# define os_sdlevent(ev) 1
+#endif
+#ifndef os_sdlinit
+# define os_sdlinit()
+#endif
+#ifndef os_sysinit
+# define os_sysinit(pargc,argv)
+#endif
+#ifndef os_sysexit
+# define os_sysexit()
+#endif
+
+/* os_screensaver_deactivate: whatever is needed to keep the screensaver away.
+Leave this *undefined* if no implementation exists. */
+#if defined(USE_X11)
+# define os_screensaver_deactivate x11_screensaver_deactivate
+#else
+# undef os_screensaver_deactivate
+#endif
+
+/* os_yuvlayout: return the best YUV layout. */
+#if defined(USE_XV)
+# define os_yuvlayout xv_yuvlayout
+#elif defined(USE_X11)
+# define os_yuvlayout() VIDEO_YUV_NONE
+#else
+# define os_yuvlayout() VIDEO_YUV_YUY2
+#endif
+
+
+// Implementations for the above, and more.
+
+int macosx_sdlevent(SDL_Event *event); // patch up osx scancodes for printscreen et al; numlock hack?
+int macosx_ibook_fnswitch(int setting);
+
+void wii_sysinit(int *pargc, char ***pargv); // set up filesystem
+void wii_sysexit(void); // close filesystem
+void wii_sdlinit(void); // set up wiimote
+int wii_sdlevent(SDL_Event *event); // add unicode values; wiimote hack to allow simple playback
+
+void x11_screensaver_deactivate(void);
+unsigned int xv_yuvlayout(void);
+
+void win32_sysinit(int *pargc, char ***pargv);
+void win32_get_modkey(int *m);
+void win32_filecreated_callback(const char *filename);
+
+// migrated from xkb.c
+#if defined(HAVE_X11_XKBLIB_H)
+# define USE_XKB 1
+#endif
+
+#if defined(USE_XKB) || defined(WIN32) || defined(MACOSX)
+int key_scancode_lookup(int k, int def);
+#else
+#define key_scancode_lookup(k, def) def
+#endif
+
+#if defined(USE_X11) || defined(WIN32) || defined(MACOSX)
+unsigned int key_repeat_delay(void);
+unsigned int key_repeat_rate(void);
+#else
+# include "sdlmain.h" // blecch
+# define key_repeat_delay() SDL_DEFAULT_REPEAT_DELAY
+# define key_repeat_rate() SDL_DEFAULT_REPEAT_INTERVAL
+#endif
+
+
+// Mixer interfaces
+
+void volume_setup(void);
+int volume_get_max(void);
+void volume_read(int *left, int *right);
+void volume_write(int left, int right);
+
+
+int alsa_volume_get_max(void);
+void alsa_volume_read(int *, int *);
+void alsa_volume_write(int, int);
+
+int oss_volume_get_max(void);
+void oss_volume_read(int *, int *);
+void oss_volume_write(int, int);
+
+int macosx_volume_get_max(void);
+void macosx_volume_read(int *, int *);
+void macosx_volume_write(int, int);
+
+int win32mm_volume_get_max(void);
+void win32mm_volume_read(int *, int *);
+void win32mm_volume_write(int, int);
+
+
+// Nasty alsa crap
+void alsa_dlinit(void);
+
+
+#endif /* ! OSDEFS_H */
+
diff --git a/src/include/precomp_lut.h b/src/include/precomp_lut.h
new file mode 100644
index 0000000..fefd4f1
--- /dev/null
+++ b/src/include/precomp_lut.h
@@ -0,0 +1,327 @@
+static signed short cubic_spline_lut[4096] = {
+ 0, 16384, 0, 0, -8, 16384, 8, 0, -16, 16384, 16, 0, -24, 16384, 24, 0, -32, 16384, 32, 0, -40, 16383, 41, 0, -47, 16382, 49, 0, -55, 16381, 58, 0, -63, 16381, 66, 0, -71, 16381, 75, -1, -78, 16380, 83, -1, -86, 16379, 92, -1, -94, 16379, 100, -1, -101, 16377, 109, -1, -109, 16377, 118, -2, -117, 16376, 127, -2,
+ -124, 16374, 136, -2, -132, 16373, 145, -2, -139, 16371, 154, -2, -146, 16370, 163, -3, -154, 16369, 172, -3, -161, 16366, 182, -3, -169, 16366, 191, -4, -176, 16364, 200, -4, -183, 16361, 210, -4, -190, 16360, 219, -5, -198, 16358, 229, -5, -205, 16357, 238, -6, -212, 16354, 248, -6, -219, 16351, 258, -6, -226, 16349, 268, -7, -233, 16347, 277, -7,
+ -240, 16345, 287, -8, -247, 16342, 297, -8, -254, 16340, 307, -9, -261, 16337, 317, -9, -268, 16335, 327, -10, -275, 16331, 338, -10, -282, 16329, 348, -11, -289, 16326, 358, -11, -295, 16322, 369, -12, -302, 16320, 379, -13, -309, 16317, 389, -13, -316, 16314, 400, -14, -322, 16309, 411, -14, -329, 16307, 421, -15, -336, 16304, 432, -16, -342, 16299, 443, -16,
+ -349, 16297, 453, -17, -355, 16293, 464, -18, -362, 16290, 475, -19, -368, 16285, 486, -19, -375, 16282, 497, -20, -381, 16278, 508, -21, -388, 16274, 520, -22, -394, 16269, 531, -22, -400, 16265, 542, -23, -407, 16262, 553, -24, -413, 16257, 565, -25, -419, 16253, 576, -26, -425, 16247, 588, -26, -432, 16244, 599, -27, -438, 16239, 611, -28, -444, 16235, 622, -29,
+ -450, 16230, 634, -30, -456, 16225, 646, -31, -462, 16220, 658, -32, -468, 16216, 669, -33, -474, 16211, 681, -34, -480, 16206, 693, -35, -486, 16201, 705, -36, -492, 16196, 717, -37, -498, 16191, 729, -38, -504, 16185, 742, -39, -510, 16180, 754, -40, -515, 16174, 766, -41, -521, 16169, 778, -42, -527, 16163, 791, -43, -533, 16158, 803, -44, -538, 16151, 816, -45,
+ -544, 16146, 828, -46, -550, 16140, 841, -47, -555, 16133, 854, -48, -561, 16128, 866, -49, -566, 16122, 879, -51, -572, 16116, 892, -52, -577, 16109, 905, -53, -583, 16104, 917, -54, -588, 16097, 930, -55, -594, 16092, 943, -57, -599, 16085, 956, -58, -604, 16077, 970, -59, -610, 16071, 983, -60, -615, 16064, 996, -61, -620, 16058, 1009, -63, -626, 16052, 1022, -64,
+ -631, 16044, 1036, -65, -636, 16038, 1049, -67, -641, 16030, 1063, -68, -646, 16023, 1076, -69, -651, 16015, 1090, -70, -656, 16009, 1103, -72, -662, 16002, 1117, -73, -667, 15995, 1131, -75, -672, 15988, 1144, -76, -677, 15980, 1158, -77, -682, 15973, 1172, -79, -686, 15964, 1186, -80, -691, 15957, 1200, -82, -696, 15949, 1214, -83, -701, 15941, 1228, -84, -706, 15934, 1242, -86,
+ -711, 15926, 1256, -87, -715, 15918, 1270, -89, -720, 15910, 1284, -90, -725, 15903, 1298, -92, -730, 15894, 1313, -93, -734, 15886, 1327, -95, -739, 15877, 1342, -96, -744, 15870, 1356, -98, -748, 15861, 1370, -99, -753, 15853, 1385, -101, -757, 15843, 1400, -102, -762, 15836, 1414, -104, -766, 15827, 1429, -106, -771, 15818, 1444, -107, -775, 15810, 1458, -109, -780, 15801, 1473, -110,
+ -784, 15792, 1488, -112, -788, 15783, 1503, -114, -793, 15774, 1518, -115, -797, 15765, 1533, -117, -801, 15756, 1548, -119, -806, 15747, 1563, -120, -810, 15738, 1578, -122, -814, 15729, 1593, -124, -818, 15719, 1608, -125, -822, 15709, 1624, -127, -826, 15700, 1639, -129, -831, 15691, 1654, -130, -835, 15681, 1670, -132, -839, 15672, 1685, -134, -843, 15662, 1701, -136, -847, 15652, 1716, -137,
+ -851, 15642, 1732, -139, -855, 15633, 1747, -141, -859, 15623, 1763, -143, -863, 15613, 1779, -145, -866, 15602, 1794, -146, -870, 15592, 1810, -148, -874, 15582, 1826, -150, -878, 15572, 1842, -152, -882, 15562, 1858, -154, -886, 15552, 1874, -156, -889, 15540, 1890, -157, -893, 15530, 1906, -159, -897, 15520, 1922, -161, -900, 15509, 1938, -163, -904, 15499, 1954, -165, -908, 15489, 1970, -167,
+ -911, 15478, 1986, -169, -915, 15467, 2003, -171, -918, 15456, 2019, -173, -922, 15446, 2035, -175, -925, 15433, 2052, -176, -929, 15423, 2068, -178, -932, 15412, 2084, -180, -936, 15401, 2101, -182, -939, 15390, 2117, -184, -943, 15379, 2134, -186, -946, 15367, 2151, -188, -949, 15356, 2167, -190, -953, 15345, 2184, -192, -956, 15333, 2201, -194, -959, 15321, 2218, -196, -962, 15310, 2234, -198,
+ -966, 15299, 2251, -200, -969, 15287, 2268, -202, -972, 15276, 2285, -205, -975, 15264, 2302, -207, -978, 15252, 2319, -209, -981, 15240, 2336, -211, -984, 15228, 2353, -213, -987, 15216, 2370, -215, -991, 15205, 2387, -217, -994, 15192, 2405, -219, -997, 15180, 2422, -221, -999, 15167, 2439, -223, -1002, 15155, 2456, -225, -1005, 15143, 2474, -228, -1008, 15131, 2491, -230, -1011, 15118, 2509, -232,
+ -1014, 15106, 2526, -234, -1017, 15094, 2543, -236, -1020, 15081, 2561, -238, -1022, 15067, 2579, -240, -1025, 15056, 2596, -243, -1028, 15043, 2614, -245, -1031, 15031, 2631, -247, -1033, 15017, 2649, -249, -1036, 15004, 2667, -251, -1039, 14992, 2685, -254, -1041, 14979, 2702, -256, -1044, 14966, 2720, -258, -1047, 14953, 2738, -260, -1049, 14940, 2756, -263, -1052, 14927, 2774, -265, -1054, 14913, 2792, -267,
+ -1057, 14900, 2810, -269, -1059, 14887, 2828, -272, -1062, 14874, 2846, -274, -1064, 14860, 2864, -276, -1066, 14846, 2882, -278, -1069, 14833, 2901, -281, -1071, 14819, 2919, -283, -1074, 14806, 2937, -285, -1076, 14793, 2955, -288, -1078, 14778, 2974, -290, -1080, 14764, 2992, -292, -1083, 14752, 3010, -295, -1085, 14737, 3029, -297, -1087, 14723, 3047, -299, -1089, 14709, 3066, -302, -1092, 14696, 3084, -304,
+ -1094, 14681, 3103, -306, -1096, 14668, 3121, -309, -1098, 14653, 3140, -311, -1100, 14638, 3159, -313, -1102, 14625, 3177, -316, -1104, 14610, 3196, -318, -1106, 14595, 3215, -320, -1108, 14582, 3233, -323, -1110, 14567, 3252, -325, -1112, 14553, 3271, -328, -1114, 14538, 3290, -330, -1116, 14523, 3309, -332, -1118, 14509, 3328, -335, -1120, 14494, 3347, -337, -1122, 14480, 3366, -340, -1124, 14465, 3385, -342,
+ -1125, 14450, 3404, -345, -1127, 14435, 3423, -347, -1129, 14420, 3442, -349, -1131, 14406, 3461, -352, -1133, 14391, 3480, -354, -1134, 14376, 3499, -357, -1136, 14361, 3518, -359, -1138, 14346, 3538, -362, -1139, 14330, 3557, -364, -1141, 14316, 3576, -367, -1143, 14301, 3595, -369, -1144, 14285, 3615, -372, -1146, 14270, 3634, -374, -1147, 14254, 3654, -377, -1149, 14239, 3673, -379, -1150, 14223, 3693, -382,
+ -1152, 14208, 3712, -384, -1153, 14192, 3732, -387, -1155, 14177, 3751, -389, -1156, 14161, 3771, -392, -1158, 14146, 3790, -394, -1159, 14130, 3810, -397, -1161, 14115, 3829, -399, -1162, 14099, 3849, -402, -1163, 14082, 3869, -404, -1165, 14067, 3889, -407, -1166, 14051, 3908, -409, -1167, 14035, 3928, -412, -1169, 14019, 3948, -414, -1170, 14003, 3968, -417, -1171, 13986, 3988, -419, -1172, 13971, 4007, -422,
+ -1174, 13955, 4027, -424, -1175, 13939, 4047, -427, -1176, 13923, 4067, -430, -1177, 13906, 4087, -432, -1178, 13890, 4107, -435, -1179, 13873, 4127, -437, -1180, 13857, 4147, -440, -1181, 13840, 4167, -442, -1182, 13823, 4188, -445, -1184, 13808, 4208, -448, -1185, 13791, 4228, -450, -1186, 13775, 4248, -453, -1187, 13758, 4268, -455, -1187, 13741, 4288, -458, -1188, 13724, 4309, -461, -1189, 13707, 4329, -463,
+ -1190, 13691, 4349, -466, -1191, 13673, 4370, -468, -1192, 13657, 4390, -471, -1193, 13641, 4410, -474, -1194, 13623, 4431, -476, -1195, 13607, 4451, -479, -1195, 13589, 4471, -481, -1196, 13572, 4492, -484, -1197, 13556, 4512, -487, -1198, 13538, 4533, -489, -1198, 13521, 4553, -492, -1199, 13504, 4574, -495, -1200, 13486, 4595, -497, -1200, 13469, 4615, -500, -1201, 13451, 4636, -502, -1202, 13435, 4656, -505,
+ -1202, 13417, 4677, -508, -1203, 13399, 4698, -510, -1204, 13383, 4718, -513, -1204, 13365, 4739, -516, -1205, 13347, 4760, -518, -1205, 13330, 4780, -521, -1206, 13312, 4801, -523, -1206, 13294, 4822, -526, -1207, 13277, 4843, -529, -1207, 13258, 4864, -531, -1208, 13241, 4885, -534, -1208, 13224, 4905, -537, -1208, 13205, 4926, -539, -1209, 13188, 4947, -542, -1209, 13170, 4968, -545, -1210, 13152, 4989, -547,
+ -1210, 13134, 5010, -550, -1210, 13116, 5031, -553, -1211, 13098, 5052, -555, -1211, 13080, 5073, -558, -1211, 13062, 5094, -561, -1212, 13044, 5115, -563, -1212, 13026, 5136, -566, -1212, 13008, 5157, -569, -1212, 12989, 5178, -571, -1212, 12971, 5199, -574, -1213, 12953, 5221, -577, -1213, 12934, 5242, -579, -1213, 12916, 5263, -582, -1213, 12898, 5284, -585, -1213, 12879, 5305, -587, -1213, 12860, 5327, -590,
+ -1213, 12842, 5348, -593, -1213, 12823, 5369, -595, -1214, 12806, 5390, -598, -1214, 12787, 5412, -601, -1214, 12768, 5433, -603, -1214, 12750, 5454, -606, -1214, 12731, 5476, -609, -1214, 12712, 5497, -611, -1214, 12694, 5518, -614, -1214, 12675, 5540, -617, -1213, 12655, 5561, -619, -1213, 12637, 5582, -622, -1213, 12618, 5604, -625, -1213, 12599, 5625, -627, -1213, 12580, 5647, -630, -1213, 12562, 5668, -633,
+ -1213, 12542, 5690, -635, -1213, 12524, 5711, -638, -1212, 12504, 5733, -641, -1212, 12485, 5754, -643, -1212, 12466, 5776, -646, -1212, 12448, 5797, -649, -1211, 12427, 5819, -651, -1211, 12408, 5841, -654, -1211, 12390, 5862, -657, -1211, 12370, 5884, -659, -1210, 12351, 5905, -662, -1210, 12332, 5927, -665, -1210, 12312, 5949, -667, -1209, 12293, 5970, -670, -1209, 12273, 5992, -672, -1209, 12254, 6014, -675,
+ -1208, 12235, 6035, -678, -1208, 12215, 6057, -680, -1207, 12195, 6079, -683, -1207, 12176, 6101, -686, -1207, 12157, 6122, -688, -1206, 12137, 6144, -691, -1206, 12118, 6166, -694, -1205, 12097, 6188, -696, -1205, 12079, 6209, -699, -1204, 12059, 6231, -702, -1204, 12039, 6253, -704, -1203, 12019, 6275, -707, -1202, 11998, 6297, -709, -1202, 11980, 6318, -712, -1201, 11960, 6340, -715, -1201, 11940, 6362, -717,
+ -1200, 11920, 6384, -720, -1199, 11900, 6406, -723, -1199, 11880, 6428, -725, -1198, 11860, 6450, -728, -1197, 11839, 6472, -730, -1197, 11821, 6493, -733, -1196, 11801, 6515, -736, -1195, 11780, 6537, -738, -1195, 11761, 6559, -741, -1194, 11741, 6581, -744, -1193, 11720, 6603, -746, -1192, 11700, 6625, -749, -1192, 11680, 6647, -751, -1191, 11660, 6669, -754, -1190, 11640, 6691, -757, -1189, 11619, 6713, -759,
+ -1188, 11599, 6735, -762, -1187, 11578, 6757, -764, -1187, 11559, 6779, -767, -1186, 11538, 6801, -769, -1185, 11518, 6823, -772, -1184, 11498, 6845, -775, -1183, 11477, 6867, -777, -1182, 11457, 6889, -780, -1181, 11436, 6911, -782, -1180, 11415, 6934, -785, -1179, 11394, 6956, -787, -1178, 11374, 6978, -790, -1177, 11354, 7000, -793, -1176, 11333, 7022, -795, -1175, 11313, 7044, -798, -1174, 11292, 7066, -800,
+ -1173, 11272, 7088, -803, -1172, 11251, 7110, -805, -1171, 11231, 7132, -808, -1170, 11209, 7155, -810, -1169, 11189, 7177, -813, -1168, 11168, 7199, -815, -1167, 11148, 7221, -818, -1166, 11127, 7243, -820, -1165, 11107, 7265, -823, -1163, 11084, 7288, -825, -1162, 11064, 7310, -828, -1161, 11043, 7332, -830, -1160, 11023, 7354, -833, -1159, 11002, 7376, -835, -1158, 10982, 7398, -838, -1156, 10959, 7421, -840,
+ -1155, 10939, 7443, -843, -1154, 10918, 7465, -845, -1153, 10898, 7487, -848, -1151, 10876, 7509, -850, -1150, 10856, 7531, -853, -1149, 10834, 7554, -855, -1148, 10814, 7576, -858, -1146, 10792, 7598, -860, -1145, 10772, 7620, -863, -1144, 10750, 7643, -865, -1142, 10728, 7665, -867, -1141, 10708, 7687, -870, -1140, 10687, 7709, -872, -1138, 10666, 7731, -875, -1137, 10644, 7754, -877, -1135, 10623, 7776, -880,
+ -1134, 10602, 7798, -882, -1133, 10581, 7820, -884, -1131, 10560, 7842, -887, -1130, 10538, 7865, -889, -1128, 10517, 7887, -892, -1127, 10496, 7909, -894, -1125, 10474, 7931, -896, -1124, 10453, 7954, -899, -1122, 10431, 7976, -901, -1121, 10410, 7998, -903, -1119, 10389, 8020, -906, -1118, 10368, 8042, -908, -1116, 10346, 8065, -911, -1115, 10325, 8087, -913, -1113, 10303, 8109, -915, -1112, 10283, 8131, -918,
+ -1110, 10260, 8154, -920, -1109, 10239, 8176, -922, -1107, 10217, 8198, -924, -1105, 10196, 8220, -927, -1104, 10175, 8242, -929, -1102, 10152, 8265, -931, -1101, 10132, 8287, -934, -1099, 10110, 8309, -936, -1097, 10088, 8331, -938, -1096, 10068, 8353, -941, -1094, 10045, 8376, -943, -1092, 10023, 8398, -945, -1091, 10002, 8420, -947, -1089, 9981, 8442, -950, -1087, 9959, 8464, -952, -1085, 9936, 8487, -954,
+ -1084, 9915, 8509, -956, -1082, 9893, 8531, -958, -1080, 9872, 8553, -961, -1079, 9851, 8575, -963, -1077, 9829, 8597, -965, -1075, 9806, 8620, -967, -1073, 9784, 8642, -969, -1071, 9763, 8664, -972, -1070, 9742, 8686, -974, -1068, 9720, 8708, -976, -1066, 9698, 8730, -978, -1064, 9676, 8752, -980, -1062, 9653, 8775, -982, -1061, 9633, 8797, -985, -1059, 9611, 8819, -987, -1057, 9589, 8841, -989,
+ -1055, 9567, 8863, -991, -1053, 9545, 8885, -993, -1051, 9523, 8907, -995, -1049, 9501, 8929, -997, -1047, 9479, 8951, -999, -1046, 9458, 8974, -1002, -1044, 9436, 8996, -1004, -1042, 9414, 9018, -1006, -1040, 9392, 9040, -1008, -1038, 9370, 9062, -1010, -1036, 9348, 9084, -1012, -1034, 9326, 9106, -1014, -1032, 9304, 9128, -1016, -1030, 9282, 9150, -1018, -1028, 9260, 9172, -1020, -1026, 9238, 9194, -1022,
+ -1024, 9216, 9216, -1024, -1022, 9194, 9238, -1026, -1020, 9172, 9260, -1028, -1018, 9150, 9282, -1030, -1016, 9128, 9304, -1032, -1014, 9106, 9326, -1034, -1012, 9084, 9348, -1036, -1010, 9062, 9370, -1038, -1008, 9040, 9392, -1040, -1006, 9018, 9414, -1042, -1004, 8996, 9436, -1044, -1002, 8974, 9458, -1046, -999, 8951, 9479, -1047, -997, 8929, 9501, -1049, -995, 8907, 9523, -1051, -993, 8885, 9545, -1053,
+ -991, 8863, 9567, -1055, -989, 8841, 9589, -1057, -987, 8819, 9611, -1059, -985, 8797, 9633, -1061, -982, 8775, 9653, -1062, -980, 8752, 9676, -1064, -978, 8730, 9698, -1066, -976, 8708, 9720, -1068, -974, 8686, 9742, -1070, -972, 8664, 9763, -1071, -969, 8642, 9784, -1073, -967, 8620, 9806, -1075, -965, 8597, 9829, -1077, -963, 8575, 9851, -1079, -961, 8553, 9872, -1080, -958, 8531, 9893, -1082,
+ -956, 8509, 9915, -1084, -954, 8487, 9936, -1085, -952, 8464, 9959, -1087, -950, 8442, 9981, -1089, -947, 8420, 10002, -1091, -945, 8398, 10023, -1092, -943, 8376, 10045, -1094, -941, 8353, 10068, -1096, -938, 8331, 10088, -1097, -936, 8309, 10110, -1099, -934, 8287, 10132, -1101, -931, 8265, 10152, -1102, -929, 8242, 10175, -1104, -927, 8220, 10196, -1105, -924, 8198, 10217, -1107, -922, 8176, 10239, -1109,
+ -920, 8154, 10260, -1110, -918, 8131, 10283, -1112, -915, 8109, 10303, -1113, -913, 8087, 10325, -1115, -911, 8065, 10346, -1116, -908, 8042, 10368, -1118, -906, 8020, 10389, -1119, -903, 7998, 10410, -1121, -901, 7976, 10431, -1122, -899, 7954, 10453, -1124, -896, 7931, 10474, -1125, -894, 7909, 10496, -1127, -892, 7887, 10517, -1128, -889, 7865, 10538, -1130, -887, 7842, 10560, -1131, -884, 7820, 10581, -1133,
+ -882, 7798, 10602, -1134, -880, 7776, 10623, -1135, -877, 7754, 10644, -1137, -875, 7731, 10666, -1138, -872, 7709, 10687, -1140, -870, 7687, 10708, -1141, -867, 7665, 10728, -1142, -865, 7643, 10750, -1144, -863, 7620, 10772, -1145, -860, 7598, 10792, -1146, -858, 7576, 10814, -1148, -855, 7554, 10834, -1149, -853, 7531, 10856, -1150, -850, 7509, 10876, -1151, -848, 7487, 10898, -1153, -845, 7465, 10918, -1154,
+ -843, 7443, 10939, -1155, -840, 7421, 10959, -1156, -838, 7398, 10982, -1158, -835, 7376, 11002, -1159, -833, 7354, 11023, -1160, -830, 7332, 11043, -1161, -828, 7310, 11064, -1162, -825, 7288, 11084, -1163, -823, 7265, 11107, -1165, -820, 7243, 11127, -1166, -818, 7221, 11148, -1167, -815, 7199, 11168, -1168, -813, 7177, 11189, -1169, -810, 7155, 11209, -1170, -808, 7132, 11231, -1171, -805, 7110, 11251, -1172,
+ -803, 7088, 11272, -1173, -800, 7066, 11292, -1174, -798, 7044, 11313, -1175, -795, 7022, 11333, -1176, -793, 7000, 11354, -1177, -790, 6978, 11374, -1178, -787, 6956, 11394, -1179, -785, 6934, 11415, -1180, -782, 6911, 11436, -1181, -780, 6889, 11457, -1182, -777, 6867, 11477, -1183, -775, 6845, 11498, -1184, -772, 6823, 11518, -1185, -769, 6801, 11538, -1186, -767, 6779, 11559, -1187, -764, 6757, 11578, -1187,
+ -762, 6735, 11599, -1188, -759, 6713, 11619, -1189, -757, 6691, 11640, -1190, -754, 6669, 11660, -1191, -751, 6647, 11680, -1192, -749, 6625, 11700, -1192, -746, 6603, 11720, -1193, -744, 6581, 11741, -1194, -741, 6559, 11761, -1195, -738, 6537, 11780, -1195, -736, 6515, 11801, -1196, -733, 6493, 11821, -1197, -730, 6472, 11839, -1197, -728, 6450, 11860, -1198, -725, 6428, 11880, -1199, -723, 6406, 11900, -1199,
+ -720, 6384, 11920, -1200, -717, 6362, 11940, -1201, -715, 6340, 11960, -1201, -712, 6318, 11980, -1202, -709, 6297, 11998, -1202, -707, 6275, 12019, -1203, -704, 6253, 12039, -1204, -702, 6231, 12059, -1204, -699, 6209, 12079, -1205, -696, 6188, 12097, -1205, -694, 6166, 12118, -1206, -691, 6144, 12137, -1206, -688, 6122, 12157, -1207, -686, 6101, 12176, -1207, -683, 6079, 12195, -1207, -680, 6057, 12215, -1208,
+ -678, 6035, 12235, -1208, -675, 6014, 12254, -1209, -672, 5992, 12273, -1209, -670, 5970, 12293, -1209, -667, 5949, 12312, -1210, -665, 5927, 12332, -1210, -662, 5905, 12351, -1210, -659, 5884, 12370, -1211, -657, 5862, 12390, -1211, -654, 5841, 12408, -1211, -651, 5819, 12427, -1211, -649, 5797, 12448, -1212, -646, 5776, 12466, -1212, -643, 5754, 12485, -1212, -641, 5733, 12504, -1212, -638, 5711, 12524, -1213,
+ -635, 5690, 12542, -1213, -633, 5668, 12562, -1213, -630, 5647, 12580, -1213, -627, 5625, 12599, -1213, -625, 5604, 12618, -1213, -622, 5582, 12637, -1213, -619, 5561, 12655, -1213, -617, 5540, 12675, -1214, -614, 5518, 12694, -1214, -611, 5497, 12712, -1214, -609, 5476, 12731, -1214, -606, 5454, 12750, -1214, -603, 5433, 12768, -1214, -601, 5412, 12787, -1214, -598, 5390, 12806, -1214, -595, 5369, 12823, -1213,
+ -593, 5348, 12842, -1213, -590, 5327, 12860, -1213, -587, 5305, 12879, -1213, -585, 5284, 12898, -1213, -582, 5263, 12916, -1213, -579, 5242, 12934, -1213, -577, 5221, 12953, -1213, -574, 5199, 12971, -1212, -571, 5178, 12989, -1212, -569, 5157, 13008, -1212, -566, 5136, 13026, -1212, -563, 5115, 13044, -1212, -561, 5094, 13062, -1211, -558, 5073, 13080, -1211, -555, 5052, 13098, -1211, -553, 5031, 13116, -1210,
+ -550, 5010, 13134, -1210, -547, 4989, 13152, -1210, -545, 4968, 13170, -1209, -542, 4947, 13188, -1209, -539, 4926, 13205, -1208, -537, 4905, 13224, -1208, -534, 4885, 13241, -1208, -531, 4864, 13258, -1207, -529, 4843, 13277, -1207, -526, 4822, 13294, -1206, -523, 4801, 13312, -1206, -521, 4780, 13330, -1205, -518, 4760, 13347, -1205, -516, 4739, 13365, -1204, -513, 4718, 13383, -1204, -510, 4698, 13399, -1203,
+ -508, 4677, 13417, -1202, -505, 4656, 13435, -1202, -502, 4636, 13451, -1201, -500, 4615, 13469, -1200, -497, 4595, 13486, -1200, -495, 4574, 13504, -1199, -492, 4553, 13521, -1198, -489, 4533, 13538, -1198, -487, 4512, 13556, -1197, -484, 4492, 13572, -1196, -481, 4471, 13589, -1195, -479, 4451, 13607, -1195, -476, 4431, 13623, -1194, -474, 4410, 13641, -1193, -471, 4390, 13657, -1192, -468, 4370, 13673, -1191,
+ -466, 4349, 13691, -1190, -463, 4329, 13707, -1189, -461, 4309, 13724, -1188, -458, 4288, 13741, -1187, -455, 4268, 13758, -1187, -453, 4248, 13775, -1186, -450, 4228, 13791, -1185, -448, 4208, 13808, -1184, -445, 4188, 13823, -1182, -442, 4167, 13840, -1181, -440, 4147, 13857, -1180, -437, 4127, 13873, -1179, -435, 4107, 13890, -1178, -432, 4087, 13906, -1177, -430, 4067, 13923, -1176, -427, 4047, 13939, -1175,
+ -424, 4027, 13955, -1174, -422, 4007, 13971, -1172, -419, 3988, 13986, -1171, -417, 3968, 14003, -1170, -414, 3948, 14019, -1169, -412, 3928, 14035, -1167, -409, 3908, 14051, -1166, -407, 3889, 14067, -1165, -404, 3869, 14082, -1163, -402, 3849, 14099, -1162, -399, 3829, 14115, -1161, -397, 3810, 14130, -1159, -394, 3790, 14146, -1158, -392, 3771, 14161, -1156, -389, 3751, 14177, -1155, -387, 3732, 14192, -1153,
+ -384, 3712, 14208, -1152, -382, 3693, 14223, -1150, -379, 3673, 14239, -1149, -377, 3654, 14254, -1147, -374, 3634, 14270, -1146, -372, 3615, 14285, -1144, -369, 3595, 14301, -1143, -367, 3576, 14316, -1141, -364, 3557, 14330, -1139, -362, 3538, 14346, -1138, -359, 3518, 14361, -1136, -357, 3499, 14376, -1134, -354, 3480, 14391, -1133, -352, 3461, 14406, -1131, -349, 3442, 14420, -1129, -347, 3423, 14435, -1127,
+ -345, 3404, 14450, -1125, -342, 3385, 14465, -1124, -340, 3366, 14480, -1122, -337, 3347, 14494, -1120, -335, 3328, 14509, -1118, -332, 3309, 14523, -1116, -330, 3290, 14538, -1114, -328, 3271, 14553, -1112, -325, 3252, 14567, -1110, -323, 3233, 14582, -1108, -320, 3215, 14595, -1106, -318, 3196, 14610, -1104, -316, 3177, 14625, -1102, -313, 3159, 14638, -1100, -311, 3140, 14653, -1098, -309, 3121, 14668, -1096,
+ -306, 3103, 14681, -1094, -304, 3084, 14696, -1092, -302, 3066, 14709, -1089, -299, 3047, 14723, -1087, -297, 3029, 14737, -1085, -295, 3010, 14752, -1083, -292, 2992, 14764, -1080, -290, 2974, 14778, -1078, -288, 2955, 14793, -1076, -285, 2937, 14806, -1074, -283, 2919, 14819, -1071, -281, 2901, 14833, -1069, -278, 2882, 14846, -1066, -276, 2864, 14860, -1064, -274, 2846, 14874, -1062, -272, 2828, 14887, -1059,
+ -269, 2810, 14900, -1057, -267, 2792, 14913, -1054, -265, 2774, 14927, -1052, -263, 2756, 14940, -1049, -260, 2738, 14953, -1047, -258, 2720, 14966, -1044, -256, 2702, 14979, -1041, -254, 2685, 14992, -1039, -251, 2667, 15004, -1036, -249, 2649, 15017, -1033, -247, 2631, 15031, -1031, -245, 2614, 15043, -1028, -243, 2596, 15056, -1025, -240, 2579, 15067, -1022, -238, 2561, 15081, -1020, -236, 2543, 15094, -1017,
+ -234, 2526, 15106, -1014, -232, 2509, 15118, -1011, -230, 2491, 15131, -1008, -228, 2474, 15143, -1005, -225, 2456, 15155, -1002, -223, 2439, 15167, -999, -221, 2422, 15180, -997, -219, 2405, 15192, -994, -217, 2387, 15205, -991, -215, 2370, 15216, -987, -213, 2353, 15228, -984, -211, 2336, 15240, -981, -209, 2319, 15252, -978, -207, 2302, 15264, -975, -205, 2285, 15276, -972, -202, 2268, 15287, -969,
+ -200, 2251, 15299, -966, -198, 2234, 15310, -962, -196, 2218, 15321, -959, -194, 2201, 15333, -956, -192, 2184, 15345, -953, -190, 2167, 15356, -949, -188, 2151, 15367, -946, -186, 2134, 15379, -943, -184, 2117, 15390, -939, -182, 2101, 15401, -936, -180, 2084, 15412, -932, -178, 2068, 15423, -929, -176, 2052, 15433, -925, -175, 2035, 15446, -922, -173, 2019, 15456, -918, -171, 2003, 15467, -915,
+ -169, 1986, 15478, -911, -167, 1970, 15489, -908, -165, 1954, 15499, -904, -163, 1938, 15509, -900, -161, 1922, 15520, -897, -159, 1906, 15530, -893, -157, 1890, 15540, -889, -156, 1874, 15552, -886, -154, 1858, 15562, -882, -152, 1842, 15572, -878, -150, 1826, 15582, -874, -148, 1810, 15592, -870, -146, 1794, 15602, -866, -145, 1779, 15613, -863, -143, 1763, 15623, -859, -141, 1747, 15633, -855,
+ -139, 1732, 15642, -851, -137, 1716, 15652, -847, -136, 1701, 15662, -843, -134, 1685, 15672, -839, -132, 1670, 15681, -835, -130, 1654, 15691, -831, -129, 1639, 15700, -826, -127, 1624, 15709, -822, -125, 1608, 15719, -818, -124, 1593, 15729, -814, -122, 1578, 15738, -810, -120, 1563, 15747, -806, -119, 1548, 15756, -801, -117, 1533, 15765, -797, -115, 1518, 15774, -793, -114, 1503, 15783, -788,
+ -112, 1488, 15792, -784, -110, 1473, 15801, -780, -109, 1458, 15810, -775, -107, 1444, 15818, -771, -106, 1429, 15827, -766, -104, 1414, 15836, -762, -102, 1400, 15843, -757, -101, 1385, 15853, -753, -99, 1370, 15861, -748, -98, 1356, 15870, -744, -96, 1342, 15877, -739, -95, 1327, 15886, -734, -93, 1313, 15894, -730, -92, 1298, 15903, -725, -90, 1284, 15910, -720, -89, 1270, 15918, -715,
+ -87, 1256, 15926, -711, -86, 1242, 15934, -706, -84, 1228, 15941, -701, -83, 1214, 15949, -696, -82, 1200, 15957, -691, -80, 1186, 15964, -686, -79, 1172, 15973, -682, -77, 1158, 15980, -677, -76, 1144, 15988, -672, -75, 1131, 15995, -667, -73, 1117, 16002, -662, -72, 1103, 16009, -656, -70, 1090, 16015, -651, -69, 1076, 16023, -646, -68, 1063, 16030, -641, -67, 1049, 16038, -636,
+ -65, 1036, 16044, -631, -64, 1022, 16052, -626, -63, 1009, 16058, -620, -61, 996, 16064, -615, -60, 983, 16071, -610, -59, 970, 16077, -604, -58, 956, 16085, -599, -57, 943, 16092, -594, -55, 930, 16097, -588, -54, 917, 16104, -583, -53, 905, 16109, -577, -52, 892, 16116, -572, -51, 879, 16122, -566, -49, 866, 16128, -561, -48, 854, 16133, -555, -47, 841, 16140, -550,
+ -46, 828, 16146, -544, -45, 816, 16151, -538, -44, 803, 16158, -533, -43, 791, 16163, -527, -42, 778, 16169, -521, -41, 766, 16174, -515, -40, 754, 16180, -510, -39, 742, 16185, -504, -38, 729, 16191, -498, -37, 717, 16196, -492, -36, 705, 16201, -486, -35, 693, 16206, -480, -34, 681, 16211, -474, -33, 669, 16216, -468, -32, 658, 16220, -462, -31, 646, 16225, -456,
+ -30, 634, 16230, -450, -29, 622, 16235, -444, -28, 611, 16239, -438, -27, 599, 16244, -432, -26, 588, 16247, -425, -26, 576, 16253, -419, -25, 565, 16257, -413, -24, 553, 16262, -407, -23, 542, 16265, -400, -22, 531, 16269, -394, -22, 520, 16274, -388, -21, 508, 16278, -381, -20, 497, 16282, -375, -19, 486, 16285, -368, -19, 475, 16290, -362, -18, 464, 16293, -355,
+ -17, 453, 16297, -349, -16, 443, 16299, -342, -16, 432, 16304, -336, -15, 421, 16307, -329, -14, 411, 16309, -322, -14, 400, 16314, -316, -13, 389, 16317, -309, -13, 379, 16320, -302, -12, 369, 16322, -295, -11, 358, 16326, -289, -11, 348, 16329, -282, -10, 338, 16331, -275, -10, 327, 16335, -268, -9, 317, 16337, -261, -9, 307, 16340, -254, -8, 297, 16342, -247,
+ -8, 287, 16345, -240, -7, 277, 16347, -233, -7, 268, 16349, -226, -6, 258, 16351, -219, -6, 248, 16354, -212, -6, 238, 16357, -205, -5, 229, 16358, -198, -5, 219, 16360, -190, -4, 210, 16361, -183, -4, 200, 16364, -176, -4, 191, 16366, -169, -3, 182, 16366, -161, -3, 172, 16369, -154, -3, 163, 16370, -146, -2, 154, 16371, -139, -2, 145, 16373, -132,
+ -2, 136, 16374, -124, -2, 127, 16376, -117, -2, 118, 16377, -109, -1, 109, 16377, -101, -1, 100, 16379, -94, -1, 92, 16379, -86, -1, 83, 16380, -78, -1, 75, 16381, -71, 0, 66, 16381, -63, 0, 58, 16381, -55, 0, 49, 16382, -47, 0, 41, 16383, -40, 0, 32, 16384, -32, 0, 24, 16384, -24, 0, 16, 16384, -16, 0, 8, 16384, -8,
+};
+
+static signed short windowed_fir_lut[16392] = {
+ 55, -727, 2306, 29549, 2306, -727, 55, -48, 54, -725, 2294, 29549, 2317, -729, 55, -48, 54, -723, 2282, 29549, 2329, -731, 55, -48, 54, -721, 2271, 29549, 2341, -733, 55, -48, 54, -718, 2259, 29549, 2353, -735, 55, -48, 54, -716, 2247, 29549, 2364, -738, 56, -48, 54, -714, 2236, 29548, 2376, -740, 56, -48, 53, -712, 2224, 29548, 2388, -742, 56, -48,
+ 53, -710, 2213, 29548, 2400, -744, 56, -48, 53, -708, 2201, 29548, 2411, -746, 56, -48, 53, -706, 2189, 29547, 2423, -748, 56, -47, 53, -704, 2178, 29547, 2435, -750, 57, -47, 53, -702, 2166, 29547, 2447, -752, 57, -47, 52, -699, 2155, 29546, 2459, -755, 57, -47, 52, -697, 2143, 29546, 2471, -757, 57, -47, 52, -695, 2132, 29546, 2483, -759, 57, -47,
+ 52, -693, 2120, 29545, 2494, -761, 58, -47, 52, -691, 2109, 29545, 2506, -763, 58, -47, 52, -689, 2097, 29544, 2518, -765, 58, -47, 51, -687, 2086, 29544, 2530, -768, 58, -47, 51, -685, 2074, 29543, 2542, -770, 58, -47, 51, -683, 2063, 29543, 2554, -772, 58, -47, 51, -681, 2052, 29542, 2566, -774, 59, -47, 51, -679, 2040, 29542, 2578, -776, 59, -47,
+ 50, -677, 2029, 29541, 2590, -778, 59, -46, 50, -674, 2017, 29540, 2602, -781, 59, -46, 50, -672, 2006, 29540, 2614, -783, 59, -46, 50, -670, 1995, 29539, 2626, -785, 60, -46, 50, -668, 1983, 29538, 2638, -787, 60, -46, 50, -666, 1972, 29537, 2650, -789, 60, -46, 49, -664, 1961, 29537, 2662, -791, 60, -46, 49, -662, 1949, 29536, 2675, -794, 60, -46,
+ 49, -660, 1938, 29535, 2687, -796, 60, -46, 49, -658, 1927, 29534, 2699, -798, 61, -46, 49, -656, 1916, 29533, 2711, -800, 61, -46, 49, -654, 1904, 29533, 2723, -802, 61, -46, 48, -652, 1893, 29532, 2735, -804, 61, -46, 48, -650, 1882, 29531, 2747, -807, 61, -45, 48, -648, 1871, 29530, 2760, -809, 62, -45, 48, -646, 1860, 29529, 2772, -811, 62, -45,
+ 48, -644, 1848, 29528, 2784, -813, 62, -45, 48, -642, 1837, 29527, 2796, -815, 62, -45, 47, -640, 1826, 29526, 2808, -818, 62, -45, 47, -638, 1815, 29525, 2821, -820, 63, -45, 47, -635, 1804, 29524, 2833, -822, 63, -45, 47, -633, 1793, 29522, 2845, -824, 63, -45, 47, -631, 1782, 29521, 2858, -826, 63, -45, 47, -629, 1771, 29520, 2870, -829, 63, -45,
+ 47, -627, 1760, 29519, 2882, -831, 64, -45, 46, -625, 1749, 29518, 2895, -833, 64, -45, 46, -623, 1738, 29517, 2907, -835, 64, -44, 46, -621, 1727, 29515, 2919, -838, 64, -44, 46, -619, 1716, 29514, 2932, -840, 64, -44, 46, -617, 1705, 29513, 2944, -842, 64, -44, 46, -615, 1694, 29511, 2956, -844, 65, -44, 45, -613, 1683, 29510, 2969, -846, 65, -44,
+ 45, -611, 1672, 29509, 2981, -849, 65, -44, 45, -609, 1661, 29507, 2994, -851, 65, -44, 45, -607, 1650, 29506, 3006, -853, 65, -44, 45, -605, 1639, 29504, 3019, -855, 66, -44, 45, -603, 1628, 29503, 3031, -858, 66, -44, 44, -601, 1617, 29502, 3044, -860, 66, -44, 44, -599, 1606, 29500, 3056, -862, 66, -44, 44, -597, 1595, 29498, 3069, -864, 66, -43,
+ 44, -595, 1585, 29497, 3081, -867, 67, -43, 44, -593, 1574, 29495, 3094, -869, 67, -43, 44, -591, 1563, 29494, 3106, -871, 67, -43, 43, -589, 1552, 29492, 3119, -873, 67, -43, 43, -587, 1541, 29490, 3131, -876, 67, -43, 43, -585, 1531, 29489, 3144, -878, 68, -43, 43, -583, 1520, 29487, 3157, -880, 68, -43, 43, -581, 1509, 29485, 3169, -882, 68, -43,
+ 43, -579, 1498, 29484, 3182, -885, 68, -43, 43, -578, 1488, 29482, 3194, -887, 68, -43, 42, -576, 1477, 29480, 3207, -889, 69, -43, 42, -574, 1466, 29478, 3220, -891, 69, -43, 42, -572, 1456, 29476, 3232, -894, 69, -42, 42, -570, 1445, 29475, 3245, -896, 69, -42, 42, -568, 1434, 29473, 3258, -898, 69, -42, 42, -566, 1424, 29471, 3271, -900, 70, -42,
+ 42, -564, 1413, 29469, 3283, -903, 70, -42, 41, -562, 1403, 29467, 3296, -905, 70, -42, 41, -560, 1392, 29465, 3309, -907, 70, -42, 41, -558, 1381, 29463, 3322, -909, 70, -42, 41, -556, 1371, 29461, 3334, -912, 71, -42, 41, -554, 1360, 29459, 3347, -914, 71, -42, 41, -552, 1350, 29457, 3360, -916, 71, -42, 40, -550, 1339, 29455, 3373, -919, 71, -42,
+ 40, -548, 1329, 29452, 3386, -921, 71, -42, 40, -546, 1318, 29450, 3399, -923, 72, -41, 40, -544, 1308, 29448, 3411, -925, 72, -41, 40, -542, 1297, 29446, 3424, -928, 72, -41, 40, -541, 1287, 29444, 3437, -930, 72, -41, 40, -539, 1276, 29442, 3450, -932, 72, -41, 39, -537, 1266, 29439, 3463, -935, 73, -41, 39, -535, 1256, 29437, 3476, -937, 73, -41,
+ 39, -533, 1245, 29435, 3489, -939, 73, -41, 39, -531, 1235, 29432, 3502, -941, 73, -41, 39, -529, 1224, 29430, 3515, -944, 74, -41, 39, -527, 1214, 29428, 3528, -946, 74, -41, 39, -525, 1204, 29425, 3541, -948, 74, -41, 38, -523, 1193, 29423, 3554, -951, 74, -41, 38, -521, 1183, 29420, 3567, -953, 74, -40, 38, -520, 1173, 29418, 3580, -955, 75, -40,
+ 38, -518, 1163, 29415, 3593, -958, 75, -40, 38, -516, 1152, 29413, 3606, -960, 75, -40, 38, -514, 1142, 29410, 3619, -962, 75, -40, 38, -512, 1132, 29408, 3632, -965, 75, -40, 37, -510, 1122, 29405, 3645, -967, 76, -40, 37, -508, 1111, 29403, 3658, -969, 76, -40, 37, -506, 1101, 29400, 3671, -971, 76, -40, 37, -504, 1091, 29397, 3684, -974, 76, -40,
+ 37, -502, 1081, 29395, 3698, -976, 76, -40, 37, -501, 1071, 29392, 3711, -978, 77, -40, 37, -499, 1061, 29389, 3724, -981, 77, -40, 36, -497, 1050, 29386, 3737, -983, 77, -39, 36, -495, 1040, 29384, 3750, -985, 77, -39, 36, -493, 1030, 29381, 3764, -988, 77, -39, 36, -491, 1020, 29378, 3777, -990, 78, -39, 36, -489, 1010, 29375, 3790, -992, 78, -39,
+ 36, -488, 1000, 29372, 3803, -995, 78, -39, 36, -486, 990, 29369, 3816, -997, 78, -39, 35, -484, 980, 29367, 3830, -999, 79, -39, 35, -482, 970, 29364, 3843, -1002, 79, -39, 35, -480, 960, 29361, 3856, -1004, 79, -39, 35, -478, 950, 29358, 3870, -1006, 79, -39, 35, -476, 940, 29355, 3883, -1009, 79, -39, 35, -475, 930, 29352, 3896, -1011, 80, -39,
+ 35, -473, 920, 29349, 3910, -1014, 80, -38, 34, -471, 910, 29346, 3923, -1016, 80, -38, 34, -469, 900, 29342, 3936, -1018, 80, -38, 34, -467, 890, 29339, 3950, -1021, 80, -38, 34, -465, 880, 29336, 3963, -1023, 81, -38, 34, -464, 871, 29333, 3976, -1025, 81, -38, 34, -462, 861, 29330, 3990, -1028, 81, -38, 34, -460, 851, 29327, 4003, -1030, 81, -38,
+ 34, -458, 841, 29323, 4017, -1032, 82, -38, 33, -456, 831, 29320, 4030, -1035, 82, -38, 33, -454, 821, 29317, 4044, -1037, 82, -38, 33, -453, 812, 29314, 4057, -1039, 82, -38, 33, -451, 802, 29310, 4071, -1042, 82, -38, 33, -449, 792, 29307, 4084, -1044, 83, -37, 33, -447, 782, 29303, 4098, -1047, 83, -37, 33, -445, 773, 29300, 4111, -1049, 83, -37,
+ 32, -444, 763, 29297, 4125, -1051, 83, -37, 32, -442, 753, 29293, 4138, -1054, 84, -37, 32, -440, 743, 29290, 4152, -1056, 84, -37, 32, -438, 734, 29286, 4165, -1058, 84, -37, 32, -436, 724, 29283, 4179, -1061, 84, -37, 32, -435, 714, 29279, 4193, -1063, 84, -37, 32, -433, 705, 29276, 4206, -1066, 85, -37, 32, -431, 695, 29272, 4220, -1068, 85, -37,
+ 31, -429, 686, 29268, 4234, -1070, 85, -37, 31, -427, 676, 29265, 4247, -1073, 85, -36, 31, -426, 666, 29261, 4261, -1075, 86, -36, 31, -424, 657, 29258, 4274, -1077, 86, -36, 31, -422, 647, 29254, 4288, -1080, 86, -36, 31, -420, 638, 29250, 4302, -1082, 86, -36, 31, -419, 628, 29246, 4316, -1085, 86, -36, 31, -417, 619, 29243, 4329, -1087, 87, -36,
+ 30, -415, 609, 29239, 4343, -1089, 87, -36, 30, -413, 600, 29235, 4357, -1092, 87, -36, 30, -411, 590, 29231, 4371, -1094, 87, -36, 30, -410, 581, 29227, 4384, -1097, 88, -36, 30, -408, 571, 29223, 4398, -1099, 88, -36, 30, -406, 562, 29220, 4412, -1101, 88, -36, 30, -404, 552, 29216, 4426, -1104, 88, -35, 30, -403, 543, 29212, 4440, -1106, 88, -35,
+ 29, -401, 534, 29208, 4453, -1109, 89, -35, 29, -399, 524, 29204, 4467, -1111, 89, -35, 29, -397, 515, 29200, 4481, -1113, 89, -35, 29, -396, 506, 29196, 4495, -1116, 89, -35, 29, -394, 496, 29192, 4509, -1118, 90, -35, 29, -392, 487, 29188, 4523, -1121, 90, -35, 29, -391, 478, 29183, 4537, -1123, 90, -35, 29, -389, 468, 29179, 4551, -1125, 90, -35,
+ 28, -387, 459, 29175, 4564, -1128, 91, -35, 28, -385, 450, 29171, 4578, -1130, 91, -35, 28, -384, 441, 29167, 4592, -1133, 91, -35, 28, -382, 431, 29163, 4606, -1135, 91, -34, 28, -380, 422, 29158, 4620, -1138, 91, -34, 28, -378, 413, 29154, 4634, -1140, 92, -34, 28, -377, 404, 29150, 4648, -1142, 92, -34, 28, -375, 395, 29145, 4662, -1145, 92, -34,
+ 27, -373, 385, 29141, 4676, -1147, 92, -34, 27, -372, 376, 29137, 4690, -1150, 93, -34, 27, -370, 367, 29132, 4704, -1152, 93, -34, 27, -368, 358, 29128, 4718, -1154, 93, -34, 27, -366, 349, 29124, 4732, -1157, 93, -34, 27, -365, 340, 29119, 4747, -1159, 94, -34, 27, -363, 331, 29115, 4761, -1162, 94, -34, 27, -361, 322, 29110, 4775, -1164, 94, -34,
+ 27, -360, 313, 29106, 4789, -1167, 94, -33, 26, -358, 304, 29101, 4803, -1169, 94, -33, 26, -356, 295, 29096, 4817, -1172, 95, -33, 26, -355, 286, 29092, 4831, -1174, 95, -33, 26, -353, 277, 29087, 4845, -1176, 95, -33, 26, -351, 268, 29083, 4860, -1179, 95, -33, 26, -350, 259, 29078, 4874, -1181, 96, -33, 26, -348, 250, 29073, 4888, -1184, 96, -33,
+ 26, -346, 241, 29069, 4902, -1186, 96, -33, 25, -345, 232, 29064, 4916, -1189, 96, -33, 25, -343, 223, 29059, 4931, -1191, 97, -33, 25, -341, 214, 29054, 4945, -1194, 97, -33, 25, -340, 205, 29050, 4959, -1196, 97, -33, 25, -338, 196, 29045, 4973, -1198, 97, -32, 25, -336, 187, 29040, 4988, -1201, 97, -32, 25, -335, 179, 29035, 5002, -1203, 98, -32,
+ 25, -333, 170, 29030, 5016, -1206, 98, -32, 25, -331, 161, 29025, 5031, -1208, 98, -32, 24, -330, 152, 29020, 5045, -1211, 98, -32, 24, -328, 143, 29015, 5059, -1213, 99, -32, 24, -326, 135, 29010, 5074, -1216, 99, -32, 24, -325, 126, 29005, 5088, -1218, 99, -32, 24, -323, 117, 29000, 5102, -1221, 99, -32, 24, -321, 108, 28995, 5117, -1223, 100, -32,
+ 24, -320, 100, 28990, 5131, -1225, 100, -32, 24, -318, 91, 28985, 5146, -1228, 100, -32, 24, -317, 82, 28980, 5160, -1230, 100, -31, 23, -315, 74, 28975, 5174, -1233, 101, -31, 23, -313, 65, 28970, 5189, -1235, 101, -31, 23, -312, 56, 28965, 5203, -1238, 101, -31, 23, -310, 48, 28960, 5218, -1240, 101, -31, 23, -308, 39, 28954, 5232, -1243, 102, -31,
+ 23, -307, 30, 28949, 5247, -1245, 102, -31, 23, -305, 22, 28944, 5261, -1248, 102, -31, 23, -304, 13, 28939, 5276, -1250, 102, -31, 23, -302, 5, 28933, 5290, -1253, 103, -31, 23, -300, -4, 28928, 5305, -1255, 103, -31, 22, -299, -12, 28923, 5319, -1258, 103, -31, 22, -297, -21, 28917, 5334, -1260, 103, -31, 22, -296, -29, 28912, 5348, -1262, 103, -30,
+ 22, -294, -38, 28906, 5363, -1265, 104, -30, 22, -292, -46, 28901, 5378, -1267, 104, -30, 22, -291, -55, 28896, 5392, -1270, 104, -30, 22, -289, -63, 28890, 5407, -1272, 104, -30, 22, -288, -72, 28885, 5421, -1275, 105, -30, 22, -286, -80, 28879, 5436, -1277, 105, -30, 21, -285, -88, 28873, 5451, -1280, 105, -30, 21, -283, -97, 28868, 5465, -1282, 105, -30,
+ 21, -281, -105, 28862, 5480, -1285, 106, -30, 21, -280, -114, 28857, 5495, -1287, 106, -30, 21, -278, -122, 28851, 5509, -1290, 106, -30, 21, -277, -130, 28845, 5524, -1292, 106, -30, 21, -275, -139, 28840, 5539, -1295, 107, -29, 21, -274, -147, 28834, 5553, -1297, 107, -29, 21, -272, -155, 28828, 5568, -1300, 107, -29, 21, -270, -163, 28822, 5583, -1302, 107, -29,
+ 20, -269, -172, 28817, 5598, -1305, 108, -29, 20, -267, -180, 28811, 5612, -1307, 108, -29, 20, -266, -188, 28805, 5627, -1310, 108, -29, 20, -264, -196, 28799, 5642, -1312, 108, -29, 20, -263, -205, 28793, 5657, -1315, 109, -29, 20, -261, -213, 28788, 5672, -1317, 109, -29, 20, -260, -221, 28782, 5686, -1320, 109, -29, 20, -258, -229, 28776, 5701, -1322, 109, -29,
+ 20, -257, -237, 28770, 5716, -1325, 110, -29, 20, -255, -246, 28764, 5731, -1327, 110, -28, 19, -254, -254, 28758, 5746, -1330, 110, -28, 19, -252, -262, 28752, 5761, -1332, 110, -28, 19, -250, -270, 28746, 5776, -1335, 111, -28, 19, -249, -278, 28740, 5791, -1337, 111, -28, 19, -247, -286, 28734, 5805, -1340, 111, -28, 19, -246, -294, 28727, 5820, -1342, 111, -28,
+ 19, -244, -302, 28721, 5835, -1345, 112, -28, 19, -243, -310, 28715, 5850, -1347, 112, -28, 19, -241, -318, 28709, 5865, -1350, 112, -28, 19, -240, -326, 28703, 5880, -1352, 112, -28, 19, -238, -334, 28697, 5895, -1355, 113, -28, 18, -237, -342, 28690, 5910, -1357, 113, -28, 18, -235, -350, 28684, 5925, -1360, 113, -28, 18, -234, -358, 28678, 5940, -1362, 113, -27,
+ 18, -232, -366, 28672, 5955, -1365, 114, -27, 18, -231, -374, 28665, 5970, -1367, 114, -27, 18, -229, -382, 28659, 5985, -1370, 114, -27, 18, -228, -390, 28653, 6000, -1372, 114, -27, 18, -226, -398, 28646, 6015, -1375, 115, -27, 18, -225, -405, 28640, 6030, -1377, 115, -27, 18, -223, -413, 28633, 6045, -1380, 115, -27, 18, -222, -421, 28627, 6061, -1382, 115, -27,
+ 17, -220, -429, 28620, 6076, -1385, 116, -27, 17, -219, -437, 28614, 6091, -1387, 116, -27, 17, -218, -444, 28607, 6106, -1390, 116, -27, 17, -216, -452, 28601, 6121, -1392, 116, -27, 17, -215, -460, 28594, 6136, -1395, 117, -26, 17, -213, -468, 28588, 6151, -1397, 117, -26, 17, -212, -476, 28581, 6166, -1400, 117, -26, 17, -210, -483, 28574, 6182, -1403, 117, -26,
+ 17, -209, -491, 28568, 6197, -1405, 118, -26, 17, -207, -499, 28561, 6212, -1408, 118, -26, 17, -206, -506, 28554, 6227, -1410, 118, -26, 16, -204, -514, 28548, 6242, -1413, 118, -26, 16, -203, -522, 28541, 6258, -1415, 119, -26, 16, -202, -529, 28534, 6273, -1418, 119, -26, 16, -200, -537, 28527, 6288, -1420, 119, -26, 16, -199, -545, 28521, 6303, -1423, 119, -26,
+ 16, -197, -552, 28514, 6319, -1425, 120, -26, 16, -196, -560, 28507, 6334, -1428, 120, -26, 16, -194, -567, 28500, 6349, -1430, 120, -25, 16, -193, -575, 28493, 6365, -1433, 120, -25, 16, -191, -582, 28486, 6380, -1435, 121, -25, 16, -190, -590, 28479, 6395, -1438, 121, -25, 16, -189, -597, 28472, 6410, -1440, 121, -25, 15, -187, -605, 28465, 6426, -1443, 121, -25,
+ 15, -186, -612, 28458, 6441, -1445, 122, -25, 15, -184, -620, 28451, 6457, -1448, 122, -25, 15, -183, -627, 28444, 6472, -1451, 122, -25, 15, -182, -635, 28437, 6487, -1453, 122, -25, 15, -180, -642, 28430, 6503, -1456, 123, -25, 15, -179, -650, 28423, 6518, -1458, 123, -25, 15, -177, -657, 28416, 6533, -1461, 123, -25, 15, -176, -664, 28409, 6549, -1463, 124, -25,
+ 15, -175, -672, 28402, 6564, -1466, 124, -24, 15, -173, -679, 28395, 6580, -1468, 124, -24, 15, -172, -687, 28387, 6595, -1471, 124, -24, 14, -170, -694, 28380, 6611, -1473, 125, -24, 14, -169, -701, 28373, 6626, -1476, 125, -24, 14, -168, -708, 28366, 6642, -1478, 125, -24, 14, -166, -716, 28358, 6657, -1481, 125, -24, 14, -165, -723, 28351, 6673, -1484, 126, -24,
+ 14, -163, -730, 28344, 6688, -1486, 126, -24, 14, -162, -738, 28336, 6704, -1489, 126, -24, 14, -161, -745, 28329, 6719, -1491, 126, -24, 14, -159, -752, 28321, 6735, -1494, 127, -24, 14, -158, -759, 28314, 6750, -1496, 127, -24, 14, -157, -766, 28307, 6766, -1499, 127, -24, 14, -155, -774, 28299, 6781, -1501, 127, -23, 14, -154, -781, 28292, 6797, -1504, 128, -23,
+ 13, -153, -788, 28284, 6813, -1506, 128, -23, 13, -151, -795, 28277, 6828, -1509, 128, -23, 13, -150, -802, 28269, 6844, -1511, 128, -23, 13, -149, -809, 28261, 6859, -1514, 129, -23, 13, -147, -816, 28254, 6875, -1517, 129, -23, 13, -146, -824, 28246, 6891, -1519, 129, -23, 13, -144, -831, 28239, 6906, -1522, 130, -23, 13, -143, -838, 28231, 6922, -1524, 130, -23,
+ 13, -142, -845, 28223, 6938, -1527, 130, -23, 13, -140, -852, 28216, 6953, -1529, 130, -23, 13, -139, -859, 28208, 6969, -1532, 131, -23, 13, -138, -866, 28200, 6985, -1534, 131, -23, 13, -136, -873, 28192, 7001, -1537, 131, -22, 12, -135, -880, 28185, 7016, -1539, 131, -22, 12, -134, -887, 28177, 7032, -1542, 132, -22, 12, -133, -894, 28169, 7048, -1545, 132, -22,
+ 12, -131, -901, 28161, 7063, -1547, 132, -22, 12, -130, -907, 28153, 7079, -1550, 132, -22, 12, -129, -914, 28145, 7095, -1552, 133, -22, 12, -127, -921, 28138, 7111, -1555, 133, -22, 12, -126, -928, 28130, 7127, -1557, 133, -22, 12, -125, -935, 28122, 7142, -1560, 133, -22, 12, -123, -942, 28114, 7158, -1562, 134, -22, 12, -122, -949, 28106, 7174, -1565, 134, -22,
+ 12, -121, -956, 28098, 7190, -1567, 134, -22, 12, -119, -962, 28090, 7206, -1570, 135, -22, 12, -118, -969, 28082, 7221, -1573, 135, -21, 11, -117, -976, 28073, 7237, -1575, 135, -21, 11, -116, -983, 28065, 7253, -1578, 135, -21, 11, -114, -989, 28057, 7269, -1580, 136, -21, 11, -113, -996, 28049, 7285, -1583, 136, -21, 11, -112, -1003, 28041, 7301, -1585, 136, -21,
+ 11, -110, -1010, 28033, 7317, -1588, 136, -21, 11, -109, -1016, 28025, 7333, -1590, 137, -21, 11, -108, -1023, 28016, 7349, -1593, 137, -21, 11, -107, -1030, 28008, 7365, -1595, 137, -21, 11, -105, -1036, 28000, 7380, -1598, 137, -21, 11, -104, -1043, 27992, 7396, -1601, 138, -21, 11, -103, -1050, 27983, 7412, -1603, 138, -21, 11, -102, -1056, 27975, 7428, -1606, 138, -21,
+ 11, -100, -1063, 27967, 7444, -1608, 138, -21, 11, -99, -1070, 27958, 7460, -1611, 139, -20, 10, -98, -1076, 27950, 7476, -1613, 139, -20, 10, -97, -1083, 27941, 7492, -1616, 139, -20, 10, -95, -1089, 27933, 7508, -1618, 140, -20, 10, -94, -1096, 27925, 7524, -1621, 140, -20, 10, -93, -1102, 27916, 7540, -1624, 140, -20, 10, -92, -1109, 27908, 7556, -1626, 140, -20,
+ 10, -90, -1115, 27899, 7572, -1629, 141, -20, 10, -89, -1122, 27891, 7589, -1631, 141, -20, 10, -88, -1128, 27882, 7605, -1634, 141, -20, 10, -87, -1135, 27874, 7621, -1636, 141, -20, 10, -85, -1141, 27865, 7637, -1639, 142, -20, 10, -84, -1148, 27856, 7653, -1641, 142, -20, 10, -83, -1154, 27848, 7669, -1644, 142, -20, 10, -82, -1160, 27839, 7685, -1646, 142, -20,
+ 10, -81, -1167, 27830, 7701, -1649, 143, -19, 9, -79, -1173, 27822, 7717, -1652, 143, -19, 9, -78, -1180, 27813, 7733, -1654, 143, -19, 9, -77, -1186, 27804, 7750, -1657, 144, -19, 9, -76, -1192, 27795, 7766, -1659, 144, -19, 9, -74, -1199, 27787, 7782, -1662, 144, -19, 9, -73, -1205, 27778, 7798, -1664, 144, -19, 9, -72, -1211, 27769, 7814, -1667, 145, -19,
+ 9, -71, -1218, 27760, 7830, -1669, 145, -19, 9, -70, -1224, 27751, 7847, -1672, 145, -19, 9, -68, -1230, 27743, 7863, -1674, 145, -19, 9, -67, -1236, 27734, 7879, -1677, 146, -19, 9, -66, -1243, 27725, 7895, -1680, 146, -19, 9, -65, -1249, 27716, 7912, -1682, 146, -19, 9, -64, -1255, 27707, 7928, -1685, 147, -19, 9, -63, -1261, 27698, 7944, -1687, 147, -18,
+ 9, -61, -1267, 27689, 7960, -1690, 147, -18, 9, -60, -1273, 27680, 7977, -1692, 147, -18, 8, -59, -1280, 27671, 7993, -1695, 148, -18, 8, -58, -1286, 27662, 8009, -1697, 148, -18, 8, -57, -1292, 27653, 8025, -1700, 148, -18, 8, -55, -1298, 27644, 8042, -1703, 148, -18, 8, -54, -1304, 27634, 8058, -1705, 149, -18, 8, -53, -1310, 27625, 8074, -1708, 149, -18,
+ 8, -52, -1316, 27616, 8091, -1710, 149, -18, 8, -51, -1322, 27607, 8107, -1713, 149, -18, 8, -50, -1328, 27598, 8123, -1715, 150, -18, 8, -49, -1334, 27589, 8140, -1718, 150, -18, 8, -47, -1340, 27579, 8156, -1720, 150, -18, 8, -46, -1346, 27570, 8173, -1723, 151, -18, 8, -45, -1352, 27561, 8189, -1725, 151, -18, 8, -44, -1358, 27552, 8205, -1728, 151, -17,
+ 8, -43, -1364, 27542, 8222, -1730, 151, -17, 8, -42, -1370, 27533, 8238, -1733, 152, -17, 8, -40, -1376, 27523, 8255, -1736, 152, -17, 8, -39, -1382, 27514, 8271, -1738, 152, -17, 7, -38, -1388, 27505, 8287, -1741, 152, -17, 7, -37, -1394, 27495, 8304, -1743, 153, -17, 7, -36, -1400, 27486, 8320, -1746, 153, -17, 7, -35, -1406, 27476, 8337, -1748, 153, -17,
+ 7, -34, -1412, 27467, 8353, -1751, 154, -17, 7, -33, -1417, 27457, 8370, -1753, 154, -17, 7, -31, -1423, 27448, 8386, -1756, 154, -17, 7, -30, -1429, 27438, 8403, -1758, 154, -17, 7, -29, -1435, 27429, 8419, -1761, 155, -17, 7, -28, -1441, 27419, 8436, -1763, 155, -17, 7, -27, -1446, 27410, 8452, -1766, 155, -17, 7, -26, -1452, 27400, 8469, -1769, 155, -16,
+ 7, -25, -1458, 27390, 8485, -1771, 156, -16, 7, -24, -1464, 27381, 8502, -1774, 156, -16, 7, -23, -1469, 27371, 8518, -1776, 156, -16, 7, -22, -1475, 27361, 8535, -1779, 157, -16, 7, -20, -1481, 27352, 8552, -1781, 157, -16, 7, -19, -1486, 27342, 8568, -1784, 157, -16, 7, -18, -1492, 27332, 8585, -1786, 157, -16, 6, -17, -1498, 27322, 8601, -1789, 158, -16,
+ 6, -16, -1503, 27313, 8618, -1791, 158, -16, 6, -15, -1509, 27303, 8634, -1794, 158, -16, 6, -14, -1515, 27293, 8651, -1796, 158, -16, 6, -13, -1520, 27283, 8668, -1799, 159, -16, 6, -12, -1526, 27273, 8684, -1801, 159, -16, 6, -11, -1532, 27263, 8701, -1804, 159, -16, 6, -10, -1537, 27254, 8718, -1807, 159, -16, 6, -9, -1543, 27244, 8734, -1809, 160, -16,
+ 6, -8, -1548, 27234, 8751, -1812, 160, -15, 6, -6, -1554, 27224, 8768, -1814, 160, -15, 6, -5, -1559, 27214, 8784, -1817, 161, -15, 6, -4, -1565, 27204, 8801, -1819, 161, -15, 6, -3, -1570, 27194, 8818, -1822, 161, -15, 6, -2, -1576, 27184, 8834, -1824, 161, -15, 6, -1, -1581, 27174, 8851, -1827, 162, -15, 6, 0, -1587, 27164, 8868, -1829, 162, -15,
+ 6, 1, -1592, 27153, 8885, -1832, 162, -15, 6, 2, -1597, 27143, 8901, -1834, 162, -15, 6, 3, -1603, 27133, 8918, -1837, 163, -15, 6, 4, -1608, 27123, 8935, -1839, 163, -15, 6, 5, -1614, 27113, 8952, -1842, 163, -15, 5, 6, -1619, 27103, 8968, -1844, 164, -15, 5, 7, -1624, 27092, 8985, -1847, 164, -15, 5, 8, -1630, 27082, 9002, -1849, 164, -15,
+ 5, 9, -1635, 27072, 9019, -1852, 164, -15, 5, 10, -1640, 27062, 9035, -1854, 165, -14, 5, 11, -1646, 27051, 9052, -1857, 165, -14, 5, 12, -1651, 27041, 9069, -1859, 165, -14, 5, 13, -1656, 27031, 9086, -1862, 165, -14, 5, 14, -1661, 27020, 9103, -1865, 166, -14, 5, 15, -1667, 27010, 9119, -1867, 166, -14, 5, 16, -1672, 27000, 9136, -1870, 166, -14,
+ 5, 17, -1677, 26989, 9153, -1872, 167, -14, 5, 18, -1682, 26979, 9170, -1875, 167, -14, 5, 19, -1688, 26968, 9187, -1877, 167, -14, 5, 20, -1693, 26958, 9204, -1880, 167, -14, 5, 21, -1698, 26948, 9221, -1882, 168, -14, 5, 22, -1703, 26937, 9237, -1885, 168, -14, 5, 23, -1708, 26926, 9254, -1887, 168, -14, 5, 24, -1713, 26916, 9271, -1890, 168, -14,
+ 5, 25, -1719, 26905, 9288, -1892, 169, -14, 5, 26, -1724, 26895, 9305, -1895, 169, -14, 5, 27, -1729, 26884, 9322, -1897, 169, -13, 5, 28, -1734, 26874, 9339, -1900, 170, -13, 4, 29, -1739, 26863, 9356, -1902, 170, -13, 4, 30, -1744, 26852, 9373, -1905, 170, -13, 4, 31, -1749, 26842, 9390, -1907, 170, -13, 4, 32, -1754, 26831, 9407, -1910, 171, -13,
+ 4, 33, -1759, 26820, 9424, -1912, 171, -13, 4, 34, -1764, 26810, 9441, -1915, 171, -13, 4, 35, -1769, 26799, 9458, -1917, 171, -13, 4, 36, -1774, 26788, 9475, -1920, 172, -13, 4, 37, -1779, 26777, 9492, -1922, 172, -13, 4, 38, -1784, 26767, 9509, -1925, 172, -13, 4, 39, -1789, 26756, 9526, -1927, 173, -13, 4, 40, -1794, 26745, 9543, -1930, 173, -13,
+ 4, 41, -1799, 26734, 9560, -1932, 173, -13, 4, 42, -1804, 26723, 9577, -1935, 173, -13, 4, 43, -1809, 26712, 9594, -1937, 174, -13, 4, 44, -1813, 26701, 9611, -1939, 174, -13, 4, 45, -1818, 26690, 9628, -1942, 174, -13, 4, 46, -1823, 26679, 9645, -1944, 174, -12, 4, 46, -1828, 26669, 9662, -1947, 175, -12, 4, 47, -1833, 26658, 9679, -1949, 175, -12,
+ 4, 48, -1838, 26647, 9696, -1952, 175, -12, 4, 49, -1843, 26636, 9713, -1954, 176, -12, 4, 50, -1847, 26625, 9730, -1957, 176, -12, 4, 51, -1852, 26613, 9747, -1959, 176, -12, 4, 52, -1857, 26602, 9764, -1962, 176, -12, 4, 53, -1862, 26591, 9781, -1964, 177, -12, 4, 54, -1866, 26580, 9799, -1967, 177, -12, 3, 55, -1871, 26569, 9816, -1969, 177, -12,
+ 3, 56, -1876, 26558, 9833, -1972, 177, -12, 3, 57, -1880, 26547, 9850, -1974, 178, -12, 3, 58, -1885, 26536, 9867, -1977, 178, -12, 3, 58, -1890, 26524, 9884, -1979, 178, -12, 3, 59, -1895, 26513, 9901, -1982, 178, -12, 3, 60, -1899, 26502, 9919, -1984, 179, -12, 3, 61, -1904, 26491, 9936, -1986, 179, -12, 3, 62, -1908, 26479, 9953, -1989, 179, -11,
+ 3, 63, -1913, 26468, 9970, -1991, 180, -11, 3, 64, -1918, 26457, 9987, -1994, 180, -11, 3, 65, -1922, 26445, 10004, -1996, 180, -11, 3, 66, -1927, 26434, 10022, -1999, 180, -11, 3, 67, -1931, 26423, 10039, -2001, 181, -11, 3, 67, -1936, 26411, 10056, -2004, 181, -11, 3, 68, -1940, 26400, 10073, -2006, 181, -11, 3, 69, -1945, 26389, 10090, -2009, 181, -11,
+ 3, 70, -1949, 26377, 10108, -2011, 182, -11, 3, 71, -1954, 26366, 10125, -2013, 182, -11, 3, 72, -1958, 26354, 10142, -2016, 182, -11, 3, 73, -1963, 26343, 10159, -2018, 183, -11, 3, 74, -1967, 26331, 10177, -2021, 183, -11, 3, 74, -1972, 26320, 10194, -2023, 183, -11, 3, 75, -1976, 26308, 10211, -2026, 183, -11, 3, 76, -1981, 26297, 10228, -2028, 184, -11,
+ 3, 77, -1985, 26285, 10246, -2031, 184, -11, 3, 78, -1990, 26273, 10263, -2033, 184, -11, 3, 79, -1994, 26262, 10280, -2035, 184, -11, 3, 80, -1998, 26250, 10298, -2038, 185, -10, 3, 80, -2003, 26239, 10315, -2040, 185, -10, 3, 81, -2007, 26227, 10332, -2043, 185, -10, 3, 82, -2011, 26215, 10350, -2045, 185, -10, 2, 83, -2016, 26204, 10367, -2048, 186, -10,
+ 2, 84, -2020, 26192, 10384, -2050, 186, -10, 2, 85, -2024, 26180, 10402, -2052, 186, -10, 2, 85, -2029, 26168, 10419, -2055, 187, -10, 2, 86, -2033, 26157, 10436, -2057, 187, -10, 2, 87, -2037, 26145, 10454, -2060, 187, -10, 2, 88, -2041, 26133, 10471, -2062, 187, -10, 2, 89, -2046, 26121, 10488, -2065, 188, -10, 2, 90, -2050, 26109, 10506, -2067, 188, -10,
+ 2, 90, -2054, 26097, 10523, -2069, 188, -10, 2, 91, -2058, 26086, 10540, -2072, 188, -10, 2, 92, -2062, 26074, 10558, -2074, 189, -10, 2, 93, -2067, 26062, 10575, -2077, 189, -10, 2, 94, -2071, 26050, 10593, -2079, 189, -10, 2, 95, -2075, 26038, 10610, -2081, 189, -10, 2, 95, -2079, 26026, 10627, -2084, 190, -10, 2, 96, -2083, 26014, 10645, -2086, 190, -10,
+ 2, 97, -2087, 26002, 10662, -2089, 190, -9, 2, 98, -2091, 25990, 10680, -2091, 191, -9, 2, 99, -2096, 25978, 10697, -2093, 191, -9, 2, 99, -2100, 25966, 10715, -2096, 191, -9, 2, 100, -2104, 25954, 10732, -2098, 191, -9, 2, 101, -2108, 25942, 10749, -2101, 192, -9, 2, 102, -2112, 25930, 10767, -2103, 192, -9, 2, 103, -2116, 25918, 10784, -2105, 192, -9,
+ 2, 103, -2120, 25905, 10802, -2108, 192, -9, 2, 104, -2124, 25893, 10819, -2110, 193, -9, 2, 105, -2128, 25881, 10837, -2113, 193, -9, 2, 106, -2132, 25869, 10854, -2115, 193, -9, 2, 106, -2136, 25857, 10872, -2117, 193, -9, 2, 107, -2140, 25845, 10889, -2120, 194, -9, 2, 108, -2144, 25832, 10907, -2122, 194, -9, 2, 109, -2148, 25820, 10924, -2125, 194, -9,
+ 2, 110, -2152, 25808, 10942, -2127, 194, -9, 2, 110, -2155, 25796, 10959, -2129, 195, -9, 2, 111, -2159, 25783, 10977, -2132, 195, -9, 2, 112, -2163, 25771, 10994, -2134, 195, -9, 2, 113, -2167, 25759, 11012, -2136, 196, -9, 2, 113, -2171, 25746, 11029, -2139, 196, -9, 2, 114, -2175, 25734, 11047, -2141, 196, -8, 1, 115, -2179, 25722, 11064, -2143, 196, -8,
+ 1, 116, -2182, 25709, 11082, -2146, 197, -8, 1, 116, -2186, 25697, 11099, -2148, 197, -8, 1, 117, -2190, 25684, 11117, -2151, 197, -8, 1, 118, -2194, 25672, 11135, -2153, 197, -8, 1, 119, -2198, 25659, 11152, -2155, 198, -8, 1, 119, -2201, 25647, 11170, -2158, 198, -8, 1, 120, -2205, 25634, 11187, -2160, 198, -8, 1, 121, -2209, 25622, 11205, -2162, 198, -8,
+ 1, 122, -2213, 25609, 11222, -2165, 199, -8, 1, 122, -2216, 25597, 11240, -2167, 199, -8, 1, 123, -2220, 25584, 11258, -2169, 199, -8, 1, 124, -2224, 25572, 11275, -2172, 199, -8, 1, 125, -2227, 25559, 11293, -2174, 200, -8, 1, 125, -2231, 25546, 11311, -2176, 200, -8, 1, 126, -2235, 25534, 11328, -2179, 200, -8, 1, 127, -2238, 25521, 11346, -2181, 200, -8,
+ 1, 127, -2242, 25508, 11363, -2183, 201, -8, 1, 128, -2246, 25496, 11381, -2186, 201, -8, 1, 129, -2249, 25483, 11399, -2188, 201, -8, 1, 130, -2253, 25470, 11416, -2190, 202, -8, 1, 130, -2256, 25458, 11434, -2193, 202, -8, 1, 131, -2260, 25445, 11452, -2195, 202, -8, 1, 132, -2264, 25432, 11469, -2197, 202, -7, 1, 132, -2267, 25419, 11487, -2200, 203, -7,
+ 1, 133, -2271, 25407, 11505, -2202, 203, -7, 1, 134, -2274, 25394, 11522, -2204, 203, -7, 1, 135, -2278, 25381, 11540, -2207, 203, -7, 1, 135, -2281, 25368, 11558, -2209, 204, -7, 1, 136, -2285, 25355, 11575, -2211, 204, -7, 1, 137, -2288, 25342, 11593, -2213, 204, -7, 1, 137, -2292, 25329, 11611, -2216, 204, -7, 1, 138, -2295, 25317, 11628, -2218, 205, -7,
+ 1, 139, -2299, 25304, 11646, -2220, 205, -7, 1, 139, -2302, 25291, 11664, -2223, 205, -7, 1, 140, -2305, 25278, 11681, -2225, 205, -7, 1, 141, -2309, 25265, 11699, -2227, 206, -7, 1, 141, -2312, 25252, 11717, -2229, 206, -7, 1, 142, -2316, 25239, 11735, -2232, 206, -7, 1, 143, -2319, 25226, 11752, -2234, 206, -7, 1, 143, -2322, 25213, 11770, -2236, 207, -7,
+ 1, 144, -2326, 25200, 11788, -2239, 207, -7, 1, 145, -2329, 25187, 11806, -2241, 207, -7, 1, 145, -2332, 25173, 11823, -2243, 207, -7, 1, 146, -2336, 25160, 11841, -2245, 208, -7, 1, 147, -2339, 25147, 11859, -2248, 208, -7, 1, 147, -2342, 25134, 11877, -2250, 208, -7, 1, 148, -2346, 25121, 11894, -2252, 208, -7, 1, 149, -2349, 25108, 11912, -2254, 209, -6,
+ 1, 149, -2352, 25095, 11930, -2257, 209, -6, 1, 150, -2355, 25081, 11948, -2259, 209, -6, 1, 151, -2359, 25068, 11965, -2261, 209, -6, 1, 151, -2362, 25055, 11983, -2264, 210, -6, 1, 152, -2365, 25042, 12001, -2266, 210, -6, 1, 153, -2368, 25029, 12019, -2268, 210, -6, 1, 153, -2371, 25015, 12036, -2270, 210, -6, 0, 154, -2375, 25002, 12054, -2272, 211, -6,
+ 0, 154, -2378, 24989, 12072, -2275, 211, -6, 0, 155, -2381, 24975, 12090, -2277, 211, -6, 0, 156, -2384, 24962, 12108, -2279, 211, -6, 0, 156, -2387, 24949, 12126, -2281, 212, -6, 0, 157, -2390, 24935, 12143, -2284, 212, -6, 0, 158, -2393, 24922, 12161, -2286, 212, -6, 0, 158, -2396, 24909, 12179, -2288, 212, -6, 0, 159, -2400, 24895, 12197, -2290, 213, -6,
+ 0, 159, -2403, 24882, 12215, -2293, 213, -6, 0, 160, -2406, 24868, 12232, -2295, 213, -6, 0, 161, -2409, 24855, 12250, -2297, 213, -6, 0, 161, -2412, 24841, 12268, -2299, 214, -6, 0, 162, -2415, 24828, 12286, -2301, 214, -6, 0, 163, -2418, 24814, 12304, -2304, 214, -6, 0, 163, -2421, 24801, 12322, -2306, 214, -6, 0, 164, -2424, 24787, 12340, -2308, 215, -6,
+ 0, 164, -2427, 24774, 12357, -2310, 215, -6, 0, 165, -2430, 24760, 12375, -2312, 215, -6, 0, 166, -2433, 24747, 12393, -2315, 215, -5, 0, 166, -2436, 24733, 12411, -2317, 216, -5, 0, 167, -2439, 24719, 12429, -2319, 216, -5, 0, 167, -2442, 24706, 12447, -2321, 216, -5, 0, 168, -2444, 24692, 12465, -2323, 216, -5, 0, 168, -2447, 24679, 12482, -2326, 217, -5,
+ 0, 169, -2450, 24665, 12500, -2328, 217, -5, 0, 170, -2453, 24651, 12518, -2330, 217, -5, 0, 170, -2456, 24637, 12536, -2332, 217, -5, 0, 171, -2459, 24624, 12554, -2334, 217, -5, 0, 171, -2462, 24610, 12572, -2336, 218, -5, 0, 172, -2465, 24596, 12590, -2339, 218, -5, 0, 173, -2467, 24583, 12608, -2341, 218, -5, 0, 173, -2470, 24569, 12626, -2343, 218, -5,
+ 0, 174, -2473, 24555, 12644, -2345, 219, -5, 0, 174, -2476, 24541, 12661, -2347, 219, -5, 0, 175, -2479, 24527, 12679, -2349, 219, -5, 0, 175, -2481, 24514, 12697, -2351, 219, -5, 0, 176, -2484, 24500, 12715, -2354, 220, -5, 0, 176, -2487, 24486, 12733, -2356, 220, -5, 0, 177, -2490, 24472, 12751, -2358, 220, -5, 0, 178, -2492, 24458, 12769, -2360, 220, -5,
+ 0, 178, -2495, 24444, 12787, -2362, 221, -5, 0, 179, -2498, 24430, 12805, -2364, 221, -5, 0, 179, -2500, 24416, 12823, -2366, 221, -5, 0, 180, -2503, 24402, 12841, -2369, 221, -5, 0, 180, -2506, 24388, 12859, -2371, 222, -5, 0, 181, -2508, 24374, 12877, -2373, 222, -5, 0, 181, -2511, 24360, 12895, -2375, 222, -5, 0, 182, -2514, 24346, 12913, -2377, 222, -5,
+ 0, 183, -2516, 24332, 12931, -2379, 222, -5, 0, 183, -2519, 24318, 12949, -2381, 223, -4, 0, 184, -2521, 24304, 12966, -2383, 223, -4, 0, 184, -2524, 24290, 12984, -2385, 223, -4, 0, 185, -2527, 24276, 13002, -2388, 223, -4, 0, 185, -2529, 24262, 13020, -2390, 224, -4, 0, 186, -2532, 24248, 13038, -2392, 224, -4, 0, 186, -2534, 24234, 13056, -2394, 224, -4,
+ 0, 187, -2537, 24220, 13074, -2396, 224, -4, 0, 187, -2539, 24206, 13092, -2398, 225, -4, 0, 188, -2542, 24191, 13110, -2400, 225, -4, 0, 188, -2544, 24177, 13128, -2402, 225, -4, 0, 189, -2547, 24163, 13146, -2404, 225, -4, 0, 189, -2549, 24149, 13164, -2406, 225, -4, 0, 190, -2552, 24135, 13182, -2408, 226, -4, 0, 190, -2554, 24120, 13200, -2410, 226, -4,
+ 0, 191, -2557, 24106, 13218, -2412, 226, -4, 0, 191, -2559, 24092, 13236, -2414, 226, -4, 0, 192, -2562, 24078, 13254, -2417, 227, -4, 0, 192, -2564, 24063, 13272, -2419, 227, -4, 0, 193, -2566, 24049, 13290, -2421, 227, -4, 0, 193, -2569, 24035, 13308, -2423, 227, -4, 0, 194, -2571, 24020, 13326, -2425, 228, -4, 0, 194, -2574, 24006, 13344, -2427, 228, -4,
+ 0, 195, -2576, 23992, 13362, -2429, 228, -4, 0, 195, -2578, 23977, 13380, -2431, 228, -4, 0, 196, -2581, 23963, 13398, -2433, 228, -4, 0, 196, -2583, 23948, 13416, -2435, 229, -4, 0, 197, -2585, 23934, 13434, -2437, 229, -4, 0, 197, -2588, 23920, 13452, -2439, 229, -4, 0, 198, -2590, 23905, 13470, -2441, 229, -4, 0, 198, -2592, 23891, 13488, -2443, 230, -4,
+ 0, 199, -2594, 23876, 13506, -2445, 230, -4, 0, 199, -2597, 23862, 13525, -2447, 230, -4, 0, 200, -2599, 23847, 13543, -2449, 230, -4, 0, 200, -2601, 23833, 13561, -2451, 230, -3, 0, 201, -2603, 23818, 13579, -2453, 231, -3, 0, 201, -2606, 23804, 13597, -2455, 231, -3, 0, 201, -2608, 23789, 13615, -2457, 231, -3, 0, 202, -2610, 23775, 13633, -2459, 231, -3,
+ 0, 202, -2612, 23760, 13651, -2461, 231, -3, 0, 203, -2614, 23745, 13669, -2463, 232, -3, 0, 203, -2617, 23731, 13687, -2465, 232, -3, 0, 204, -2619, 23716, 13705, -2467, 232, -3, 0, 204, -2621, 23702, 13723, -2469, 232, -3, 0, 205, -2623, 23687, 13741, -2471, 233, -3, 0, 205, -2625, 23672, 13759, -2473, 233, -3, 0, 206, -2627, 23658, 13777, -2475, 233, -3,
+ 0, 206, -2629, 23643, 13795, -2477, 233, -3, 0, 206, -2631, 23628, 13813, -2479, 233, -3, 0, 207, -2634, 23614, 13831, -2480, 234, -3, 0, 207, -2636, 23599, 13849, -2482, 234, -3, 0, 208, -2638, 23584, 13868, -2484, 234, -3, 0, 208, -2640, 23569, 13886, -2486, 234, -3, 0, 209, -2642, 23555, 13904, -2488, 234, -3, 0, 209, -2644, 23540, 13922, -2490, 235, -3,
+ 0, 210, -2646, 23525, 13940, -2492, 235, -3, 0, 210, -2648, 23510, 13958, -2494, 235, -3, 0, 210, -2650, 23495, 13976, -2496, 235, -3, 0, 211, -2652, 23481, 13994, -2498, 236, -3, 0, 211, -2654, 23466, 14012, -2500, 236, -3, 0, 212, -2656, 23451, 14030, -2502, 236, -3, 0, 212, -2658, 23436, 14048, -2504, 236, -3, 0, 212, -2660, 23421, 14066, -2505, 236, -3,
+ 0, 213, -2662, 23406, 14084, -2507, 237, -3, 0, 213, -2664, 23391, 14103, -2509, 237, -3, 0, 214, -2665, 23376, 14121, -2511, 237, -3, 0, 214, -2667, 23361, 14139, -2513, 237, -3, 0, 215, -2669, 23346, 14157, -2515, 237, -3, 0, 215, -2671, 23332, 14175, -2517, 238, -3, 0, 215, -2673, 23317, 14193, -2519, 238, -3, 0, 216, -2675, 23302, 14211, -2521, 238, -3,
+ 0, 216, -2677, 23287, 14229, -2522, 238, -3, 0, 217, -2679, 23272, 14247, -2524, 238, -3, 0, 217, -2680, 23257, 14265, -2526, 239, -3, 0, 217, -2682, 23242, 14283, -2528, 239, -3, 0, 218, -2684, 23226, 14302, -2530, 239, -2, 0, 218, -2686, 23211, 14320, -2532, 239, -2, 0, 219, -2688, 23196, 14338, -2533, 239, -2, 0, 219, -2689, 23181, 14356, -2535, 240, -2,
+ 0, 219, -2691, 23166, 14374, -2537, 240, -2, 0, 220, -2693, 23151, 14392, -2539, 240, -2, 0, 220, -2695, 23136, 14410, -2541, 240, -2, 0, 220, -2697, 23121, 14428, -2543, 240, -2, 0, 221, -2698, 23106, 14446, -2544, 241, -2, 0, 221, -2700, 23090, 14464, -2546, 241, -2, 0, 222, -2702, 23075, 14483, -2548, 241, -2, 0, 222, -2703, 23060, 14501, -2550, 241, -2,
+ 0, 222, -2705, 23045, 14519, -2552, 241, -2, 0, 223, -2707, 23030, 14537, -2553, 242, -2, 0, 223, -2708, 23015, 14555, -2555, 242, -2, 0, 223, -2710, 22999, 14573, -2557, 242, -2, 0, 224, -2712, 22984, 14591, -2559, 242, -2, 0, 224, -2713, 22969, 14609, -2561, 242, -2, 0, 225, -2715, 22954, 14627, -2562, 243, -2, 0, 225, -2717, 22938, 14646, -2564, 243, -2,
+ 0, 225, -2718, 22923, 14664, -2566, 243, -2, 0, 226, -2720, 22908, 14682, -2568, 243, -2, 0, 226, -2721, 22892, 14700, -2569, 243, -2, 0, 226, -2723, 22877, 14718, -2571, 243, -2, 0, 227, -2725, 22862, 14736, -2573, 244, -2, 0, 227, -2726, 22846, 14754, -2575, 244, -2, 0, 227, -2728, 22831, 14772, -2576, 244, -2, 0, 228, -2729, 22816, 14790, -2578, 244, -2,
+ 0, 228, -2731, 22800, 14809, -2580, 244, -2, 0, 228, -2732, 22785, 14827, -2582, 245, -2, 0, 229, -2734, 22769, 14845, -2583, 245, -2, 0, 229, -2735, 22754, 14863, -2585, 245, -2, 0, 229, -2737, 22738, 14881, -2587, 245, -2, 0, 230, -2738, 22723, 14899, -2589, 245, -2, 0, 230, -2740, 22708, 14917, -2590, 245, -2, 0, 230, -2741, 22692, 14935, -2592, 246, -2,
+ 0, 231, -2743, 22677, 14953, -2594, 246, -2, 0, 231, -2744, 22661, 14972, -2595, 246, -2, 0, 231, -2746, 22646, 14990, -2597, 246, -2, 0, 232, -2747, 22630, 15008, -2599, 246, -2, 0, 232, -2748, 22615, 15026, -2600, 247, -2, 0, 232, -2750, 22599, 15044, -2602, 247, -2, 0, 233, -2751, 22583, 15062, -2604, 247, -2, 0, 233, -2753, 22568, 15080, -2606, 247, -2,
+ 0, 233, -2754, 22552, 15098, -2607, 247, -2, 0, 234, -2755, 22537, 15116, -2609, 247, -2, 0, 234, -2757, 22521, 15135, -2611, 248, -2, 0, 234, -2758, 22506, 15153, -2612, 248, -2, 0, 235, -2759, 22490, 15171, -2614, 248, -2, 0, 235, -2761, 22474, 15189, -2615, 248, -2, 0, 235, -2762, 22459, 15207, -2617, 248, -2, 0, 236, -2763, 22443, 15225, -2619, 248, -2,
+ 0, 236, -2765, 22427, 15243, -2620, 249, -1, 0, 236, -2766, 22412, 15261, -2622, 249, -1, 0, 236, -2767, 22396, 15279, -2624, 249, -1, 0, 237, -2769, 22380, 15298, -2625, 249, -1, 0, 237, -2770, 22365, 15316, -2627, 249, -1, 0, 237, -2771, 22349, 15334, -2628, 249, -1, 0, 238, -2772, 22333, 15352, -2630, 250, -1, 0, 238, -2774, 22317, 15370, -2632, 250, -1,
+ 0, 238, -2775, 22302, 15388, -2633, 250, -1, 0, 239, -2776, 22286, 15406, -2635, 250, -1, 0, 239, -2777, 22270, 15424, -2636, 250, -1, 0, 239, -2778, 22254, 15442, -2638, 250, -1, 0, 239, -2780, 22238, 15460, -2640, 251, -1, 0, 240, -2781, 22223, 15479, -2641, 251, -1, 0, 240, -2782, 22207, 15497, -2643, 251, -1, 0, 240, -2783, 22191, 15515, -2644, 251, -1,
+ 0, 241, -2784, 22175, 15533, -2646, 251, -1, 0, 241, -2785, 22159, 15551, -2647, 251, -1, 0, 241, -2786, 22143, 15569, -2649, 252, -1, 0, 241, -2788, 22128, 15587, -2651, 252, -1, 0, 242, -2789, 22112, 15605, -2652, 252, -1, 0, 242, -2790, 22096, 15623, -2654, 252, -1, 0, 242, -2791, 22080, 15641, -2655, 252, -1, 0, 242, -2792, 22064, 15660, -2657, 252, -1,
+ 0, 243, -2793, 22048, 15678, -2658, 253, -1, 0, 243, -2794, 22032, 15696, -2660, 253, -1, 0, 243, -2795, 22016, 15714, -2661, 253, -1, 0, 243, -2796, 22000, 15732, -2663, 253, -1, 0, 244, -2797, 21984, 15750, -2664, 253, -1, 0, 244, -2798, 21968, 15768, -2666, 253, -1, 0, 244, -2799, 21952, 15786, -2667, 253, -1, 0, 244, -2800, 21936, 15804, -2669, 254, -1,
+ 0, 245, -2801, 21920, 15822, -2670, 254, -1, 0, 245, -2802, 21904, 15840, -2672, 254, -1, 0, 245, -2803, 21888, 15858, -2673, 254, -1, 0, 245, -2804, 21872, 15877, -2675, 254, -1, 0, 246, -2805, 21856, 15895, -2676, 254, -1, 0, 246, -2806, 21840, 15913, -2678, 254, -1, 0, 246, -2807, 21824, 15931, -2679, 255, -1, 0, 246, -2808, 21808, 15949, -2680, 255, -1,
+ 0, 247, -2809, 21792, 15967, -2682, 255, -1, 0, 247, -2810, 21776, 15985, -2683, 255, -1, 0, 247, -2811, 21759, 16003, -2685, 255, -1, 0, 247, -2812, 21743, 16021, -2686, 255, -1, 0, 248, -2813, 21727, 16039, -2688, 255, -1, 0, 248, -2813, 21711, 16057, -2689, 256, -1, 0, 248, -2814, 21695, 16075, -2691, 256, -1, 0, 248, -2815, 21679, 16093, -2692, 256, -1,
+ 0, 249, -2816, 21662, 16111, -2693, 256, -1, 0, 249, -2817, 21646, 16130, -2695, 256, -1, 0, 249, -2818, 21630, 16148, -2696, 256, -1, 0, 249, -2819, 21614, 16166, -2698, 256, -1, 0, 249, -2819, 21598, 16184, -2699, 257, -1, 0, 250, -2820, 21581, 16202, -2700, 257, -1, 0, 250, -2821, 21565, 16220, -2702, 257, -1, 0, 250, -2822, 21549, 16238, -2703, 257, -1,
+ 0, 250, -2823, 21533, 16256, -2704, 257, -1, 0, 251, -2823, 21516, 16274, -2706, 257, -1, 0, 251, -2824, 21500, 16292, -2707, 257, -1, 0, 251, -2825, 21484, 16310, -2708, 257, -1, 0, 251, -2826, 21468, 16328, -2710, 258, -1, 0, 251, -2826, 21451, 16346, -2711, 258, -1, 0, 252, -2827, 21435, 16364, -2712, 258, -1, 0, 252, -2828, 21419, 16382, -2714, 258, -1,
+ 0, 252, -2829, 21402, 16400, -2715, 258, -1, 0, 252, -2829, 21386, 16418, -2716, 258, -1, 0, 252, -2830, 21370, 16436, -2718, 258, -1, 0, 253, -2831, 21353, 16454, -2719, 259, -1, 0, 253, -2831, 21337, 16472, -2720, 259, -1, 0, 253, -2832, 21320, 16490, -2722, 259, -1, 0, 253, -2833, 21304, 16508, -2723, 259, -1, 0, 253, -2833, 21288, 16526, -2724, 259, -1,
+ 0, 254, -2834, 21271, 16544, -2726, 259, -1, 0, 254, -2835, 21255, 16562, -2727, 259, -1, 0, 254, -2835, 21238, 16580, -2728, 259, -1, 0, 254, -2836, 21222, 16598, -2729, 259, -1, 0, 254, -2836, 21205, 16616, -2731, 260, -1, 0, 255, -2837, 21189, 16634, -2732, 260, -1, 0, 255, -2838, 21173, 16652, -2733, 260, -1, 0, 255, -2838, 21156, 16670, -2734, 260, -1,
+ 0, 255, -2839, 21140, 16688, -2736, 260, -1, 0, 255, -2839, 21123, 16706, -2737, 260, 0, 0, 255, -2840, 21107, 16724, -2738, 260, 0, 0, 256, -2840, 21090, 16742, -2739, 260, 0, 0, 256, -2841, 21074, 16760, -2740, 260, 0, 0, 256, -2841, 21057, 16778, -2742, 261, 0, 0, 256, -2842, 21040, 16796, -2743, 261, 0, 0, 256, -2842, 21024, 16814, -2744, 261, 0,
+ 0, 256, -2843, 21007, 16832, -2745, 261, 0, 0, 257, -2843, 20991, 16850, -2746, 261, 0, 0, 257, -2844, 20974, 16868, -2748, 261, 0, 0, 257, -2844, 20958, 16886, -2749, 261, 0, 0, 257, -2845, 20941, 16904, -2750, 261, 0, 0, 257, -2845, 20924, 16922, -2751, 261, 0, 0, 257, -2846, 20908, 16940, -2752, 262, 0, 0, 258, -2846, 20891, 16958, -2753, 262, 0,
+ 0, 258, -2847, 20875, 16976, -2755, 262, 0, 0, 258, -2847, 20858, 16994, -2756, 262, 0, 0, 258, -2847, 20841, 17012, -2757, 262, 0, 0, 258, -2848, 20825, 17030, -2758, 262, 0, 0, 258, -2848, 20808, 17048, -2759, 262, 0, 0, 258, -2849, 20791, 17066, -2760, 262, 0, 0, 259, -2849, 20775, 17084, -2761, 262, 0, 0, 259, -2849, 20758, 17101, -2763, 262, 0,
+ 0, 259, -2850, 20741, 17119, -2764, 262, 0, 0, 259, -2850, 20724, 17137, -2765, 263, 0, 0, 259, -2851, 20708, 17155, -2766, 263, 0, 0, 259, -2851, 20691, 17173, -2767, 263, 0, 0, 259, -2851, 20674, 17191, -2768, 263, 0, 0, 260, -2852, 20657, 17209, -2769, 263, 0, 0, 260, -2852, 20641, 17227, -2770, 263, 0, 0, 260, -2852, 20624, 17245, -2771, 263, 0,
+ 0, 260, -2852, 20607, 17263, -2772, 263, 0, 0, 260, -2853, 20590, 17281, -2773, 263, 0, 0, 260, -2853, 20574, 17299, -2774, 263, 0, 0, 260, -2853, 20557, 17316, -2775, 263, 0, 0, 261, -2854, 20540, 17334, -2776, 264, 0, 0, 261, -2854, 20523, 17352, -2777, 264, 0, 0, 261, -2854, 20506, 17370, -2778, 264, 0, 0, 261, -2854, 20490, 17388, -2779, 264, 0,
+ 0, 261, -2855, 20473, 17406, -2780, 264, 0, 0, 261, -2855, 20456, 17424, -2782, 264, 0, 0, 261, -2855, 20439, 17442, -2783, 264, 0, 0, 261, -2855, 20422, 17459, -2783, 264, 0, 0, 262, -2855, 20405, 17477, -2784, 264, 0, 0, 262, -2856, 20388, 17495, -2785, 264, 0, 0, 262, -2856, 20372, 17513, -2786, 264, 0, 0, 262, -2856, 20355, 17531, -2787, 264, 0,
+ 0, 262, -2856, 20338, 17549, -2788, 264, 0, 0, 262, -2856, 20321, 17567, -2789, 264, 0, 0, 262, -2856, 20304, 17584, -2790, 265, 0, 0, 262, -2857, 20287, 17602, -2791, 265, 0, 0, 262, -2857, 20270, 17620, -2792, 265, 0, 0, 263, -2857, 20253, 17638, -2793, 265, 0, 0, 263, -2857, 20236, 17656, -2794, 265, 0, 0, 263, -2857, 20219, 17673, -2795, 265, 0,
+ 0, 263, -2857, 20202, 17691, -2796, 265, 0, 0, 263, -2857, 20185, 17709, -2797, 265, 0, 0, 263, -2857, 20168, 17727, -2798, 265, 0, 0, 263, -2857, 20151, 17745, -2799, 265, 0, 0, 263, -2858, 20134, 17763, -2799, 265, 0, 0, 263, -2858, 20117, 17780, -2800, 265, 0, 0, 263, -2858, 20100, 17798, -2801, 265, 0, 0, 264, -2858, 20083, 17816, -2802, 265, 0,
+ 0, 264, -2858, 20066, 17834, -2803, 265, 0, 0, 264, -2858, 20049, 17851, -2804, 265, 0, 0, 264, -2858, 20032, 17869, -2805, 266, 0, 0, 264, -2858, 20015, 17887, -2806, 266, 0, 0, 264, -2858, 19998, 17905, -2806, 266, 0, 0, 264, -2858, 19981, 17923, -2807, 266, 0, 0, 264, -2858, 19964, 17940, -2808, 266, 0, 0, 264, -2858, 19947, 17958, -2809, 266, 0,
+ 0, 264, -2858, 19930, 17976, -2810, 266, 0, 0, 264, -2858, 19913, 17994, -2810, 266, 0, 0, 264, -2858, 19896, 18011, -2811, 266, 0, 0, 265, -2858, 19878, 18029, -2812, 266, 0, 0, 265, -2858, 19861, 18047, -2813, 266, 0, 0, 265, -2858, 19844, 18064, -2814, 266, 0, 0, 265, -2858, 19827, 18082, -2814, 266, 0, 0, 265, -2857, 19810, 18100, -2815, 266, 0,
+ 0, 265, -2857, 19793, 18118, -2816, 266, 0, 0, 265, -2857, 19776, 18135, -2817, 266, 0, 0, 265, -2857, 19758, 18153, -2817, 266, 0, 0, 265, -2857, 19741, 18171, -2818, 266, 0, 0, 265, -2857, 19724, 18188, -2819, 266, 0, 0, 265, -2857, 19707, 18206, -2820, 266, 0, 0, 265, -2857, 19690, 18224, -2820, 266, 0, 0, 265, -2857, 19673, 18241, -2821, 266, 0,
+ 0, 265, -2856, 19655, 18259, -2822, 266, 0, 0, 265, -2856, 19638, 18277, -2823, 266, 0, 0, 266, -2856, 19621, 18294, -2823, 267, 0, 0, 266, -2856, 19604, 18312, -2824, 267, 0, 0, 266, -2856, 19586, 18330, -2825, 267, 0, 0, 266, -2856, 19569, 18347, -2825, 267, 0, 0, 266, -2855, 19552, 18365, -2826, 267, 0, 0, 266, -2855, 19535, 18383, -2827, 267, 0,
+ 0, 266, -2855, 19518, 18400, -2827, 267, 0, 0, 266, -2855, 19500, 18418, -2828, 267, 0, 0, 266, -2855, 19483, 18436, -2829, 267, 0, 0, 266, -2854, 19466, 18453, -2829, 267, 0, 0, 266, -2854, 19448, 18471, -2830, 267, 0, 0, 266, -2854, 19431, 18488, -2830, 267, 0, 0, 266, -2854, 19414, 18506, -2831, 267, 0, 0, 266, -2853, 19397, 18524, -2832, 267, 0,
+ 0, 266, -2853, 19379, 18541, -2832, 267, 0, 0, 266, -2853, 19362, 18559, -2833, 267, 0, 0, 266, -2853, 19345, 18576, -2833, 267, 0, 0, 266, -2852, 19327, 18594, -2834, 267, 0, 0, 266, -2852, 19310, 18612, -2835, 267, 0, 0, 266, -2852, 19293, 18629, -2835, 267, 0, 0, 266, -2851, 19275, 18647, -2836, 267, 0, 0, 266, -2851, 19258, 18664, -2836, 267, 0,
+ 0, 266, -2851, 19241, 18682, -2837, 267, 0, 0, 267, -2851, 19223, 18699, -2837, 267, 0, 0, 267, -2850, 19206, 18717, -2838, 267, 0, 0, 267, -2850, 19188, 18734, -2839, 267, 0, 0, 267, -2850, 19171, 18752, -2839, 267, 0, 0, 267, -2849, 19154, 18770, -2840, 267, 0, 0, 267, -2849, 19136, 18787, -2840, 267, 0, 0, 267, -2848, 19119, 18805, -2841, 267, 0,
+ 0, 267, -2848, 19101, 18822, -2841, 267, 0, 0, 267, -2848, 19084, 18840, -2842, 267, 0, 0, 267, -2847, 19067, 18857, -2842, 267, 0, 0, 267, -2847, 19049, 18875, -2843, 267, 0, 0, 267, -2846, 19032, 18892, -2843, 267, 0, 0, 267, -2846, 19014, 18910, -2843, 267, 0, 0, 267, -2846, 18997, 18927, -2844, 267, 0, 0, 267, -2845, 18979, 18944, -2844, 267, 0,
+ 0, 267, -2845, 18962, 18962, -2845, 267, 0, 0, 267, -2844, 18944, 18979, -2845, 267, 0, 0, 267, -2844, 18927, 18997, -2846, 267, 0, 0, 267, -2843, 18910, 19014, -2846, 267, 0, 0, 267, -2843, 18892, 19032, -2846, 267, 0, 0, 267, -2843, 18875, 19049, -2847, 267, 0, 0, 267, -2842, 18857, 19067, -2847, 267, 0, 0, 267, -2842, 18840, 19084, -2848, 267, 0,
+ 0, 267, -2841, 18822, 19101, -2848, 267, 0, 0, 267, -2841, 18805, 19119, -2848, 267, 0, 0, 267, -2840, 18787, 19136, -2849, 267, 0, 0, 267, -2840, 18770, 19154, -2849, 267, 0, 0, 267, -2839, 18752, 19171, -2850, 267, 0, 0, 267, -2839, 18734, 19188, -2850, 267, 0, 0, 267, -2838, 18717, 19206, -2850, 267, 0, 0, 267, -2837, 18699, 19223, -2851, 267, 0,
+ 0, 267, -2837, 18682, 19241, -2851, 266, 0, 0, 267, -2836, 18664, 19258, -2851, 266, 0, 0, 267, -2836, 18647, 19275, -2851, 266, 0, 0, 267, -2835, 18629, 19293, -2852, 266, 0, 0, 267, -2835, 18612, 19310, -2852, 266, 0, 0, 267, -2834, 18594, 19327, -2852, 266, 0, 0, 267, -2833, 18576, 19345, -2853, 266, 0, 0, 267, -2833, 18559, 19362, -2853, 266, 0,
+ 0, 267, -2832, 18541, 19379, -2853, 266, 0, 0, 267, -2832, 18524, 19397, -2853, 266, 0, 0, 267, -2831, 18506, 19414, -2854, 266, 0, 0, 267, -2830, 18488, 19431, -2854, 266, 0, 0, 267, -2830, 18471, 19448, -2854, 266, 0, 0, 267, -2829, 18453, 19466, -2854, 266, 0, 0, 267, -2829, 18436, 19483, -2855, 266, 0, 0, 267, -2828, 18418, 19500, -2855, 266, 0,
+ 0, 267, -2827, 18400, 19518, -2855, 266, 0, 0, 267, -2827, 18383, 19535, -2855, 266, 0, 0, 267, -2826, 18365, 19552, -2855, 266, 0, 0, 267, -2825, 18347, 19569, -2856, 266, 0, 0, 267, -2825, 18330, 19586, -2856, 266, 0, 0, 267, -2824, 18312, 19604, -2856, 266, 0, 0, 267, -2823, 18294, 19621, -2856, 266, 0, 0, 266, -2823, 18277, 19638, -2856, 265, 0,
+ 0, 266, -2822, 18259, 19655, -2856, 265, 0, 0, 266, -2821, 18241, 19673, -2857, 265, 0, 0, 266, -2820, 18224, 19690, -2857, 265, 0, 0, 266, -2820, 18206, 19707, -2857, 265, 0, 0, 266, -2819, 18188, 19724, -2857, 265, 0, 0, 266, -2818, 18171, 19741, -2857, 265, 0, 0, 266, -2817, 18153, 19758, -2857, 265, 0, 0, 266, -2817, 18135, 19776, -2857, 265, 0,
+ 0, 266, -2816, 18118, 19793, -2857, 265, 0, 0, 266, -2815, 18100, 19810, -2857, 265, 0, 0, 266, -2814, 18082, 19827, -2858, 265, 0, 0, 266, -2814, 18064, 19844, -2858, 265, 0, 0, 266, -2813, 18047, 19861, -2858, 265, 0, 0, 266, -2812, 18029, 19878, -2858, 265, 0, 0, 266, -2811, 18011, 19896, -2858, 264, 0, 0, 266, -2810, 17994, 19913, -2858, 264, 0,
+ 0, 266, -2810, 17976, 19930, -2858, 264, 0, 0, 266, -2809, 17958, 19947, -2858, 264, 0, 0, 266, -2808, 17940, 19964, -2858, 264, 0, 0, 266, -2807, 17923, 19981, -2858, 264, 0, 0, 266, -2806, 17905, 19998, -2858, 264, 0, 0, 266, -2806, 17887, 20015, -2858, 264, 0, 0, 266, -2805, 17869, 20032, -2858, 264, 0, 0, 265, -2804, 17851, 20049, -2858, 264, 0,
+ 0, 265, -2803, 17834, 20066, -2858, 264, 0, 0, 265, -2802, 17816, 20083, -2858, 264, 0, 0, 265, -2801, 17798, 20100, -2858, 263, 0, 0, 265, -2800, 17780, 20117, -2858, 263, 0, 0, 265, -2799, 17763, 20134, -2858, 263, 0, 0, 265, -2799, 17745, 20151, -2857, 263, 0, 0, 265, -2798, 17727, 20168, -2857, 263, 0, 0, 265, -2797, 17709, 20185, -2857, 263, 0,
+ 0, 265, -2796, 17691, 20202, -2857, 263, 0, 0, 265, -2795, 17673, 20219, -2857, 263, 0, 0, 265, -2794, 17656, 20236, -2857, 263, 0, 0, 265, -2793, 17638, 20253, -2857, 263, 0, 0, 265, -2792, 17620, 20270, -2857, 262, 0, 0, 265, -2791, 17602, 20287, -2857, 262, 0, 0, 265, -2790, 17584, 20304, -2856, 262, 0, 0, 264, -2789, 17567, 20321, -2856, 262, 0,
+ 0, 264, -2788, 17549, 20338, -2856, 262, 0, 0, 264, -2787, 17531, 20355, -2856, 262, 0, 0, 264, -2786, 17513, 20372, -2856, 262, 0, 0, 264, -2785, 17495, 20388, -2856, 262, 0, 0, 264, -2784, 17477, 20405, -2855, 262, 0, 0, 264, -2783, 17459, 20422, -2855, 261, 0, 0, 264, -2783, 17442, 20439, -2855, 261, 0, 0, 264, -2782, 17424, 20456, -2855, 261, 0,
+ 0, 264, -2780, 17406, 20473, -2855, 261, 0, 0, 264, -2779, 17388, 20490, -2854, 261, 0, 0, 264, -2778, 17370, 20506, -2854, 261, 0, 0, 264, -2777, 17352, 20523, -2854, 261, 0, 0, 264, -2776, 17334, 20540, -2854, 261, 0, 0, 263, -2775, 17316, 20557, -2853, 260, 0, 0, 263, -2774, 17299, 20574, -2853, 260, 0, 0, 263, -2773, 17281, 20590, -2853, 260, 0,
+ 0, 263, -2772, 17263, 20607, -2852, 260, 0, 0, 263, -2771, 17245, 20624, -2852, 260, 0, 0, 263, -2770, 17227, 20641, -2852, 260, 0, 0, 263, -2769, 17209, 20657, -2852, 260, 0, 0, 263, -2768, 17191, 20674, -2851, 259, 0, 0, 263, -2767, 17173, 20691, -2851, 259, 0, 0, 263, -2766, 17155, 20708, -2851, 259, 0, 0, 263, -2765, 17137, 20724, -2850, 259, 0,
+ 0, 262, -2764, 17119, 20741, -2850, 259, 0, 0, 262, -2763, 17101, 20758, -2849, 259, 0, 0, 262, -2761, 17084, 20775, -2849, 259, 0, 0, 262, -2760, 17066, 20791, -2849, 258, 0, 0, 262, -2759, 17048, 20808, -2848, 258, 0, 0, 262, -2758, 17030, 20825, -2848, 258, 0, 0, 262, -2757, 17012, 20841, -2847, 258, 0, 0, 262, -2756, 16994, 20858, -2847, 258, 0,
+ 0, 262, -2755, 16976, 20875, -2847, 258, 0, 0, 262, -2753, 16958, 20891, -2846, 258, 0, 0, 262, -2752, 16940, 20908, -2846, 257, 0, 0, 261, -2751, 16922, 20924, -2845, 257, 0, 0, 261, -2750, 16904, 20941, -2845, 257, 0, 0, 261, -2749, 16886, 20958, -2844, 257, 0, 0, 261, -2748, 16868, 20974, -2844, 257, 0, 0, 261, -2746, 16850, 20991, -2843, 257, 0,
+ 0, 261, -2745, 16832, 21007, -2843, 256, 0, 0, 261, -2744, 16814, 21024, -2842, 256, 0, 0, 261, -2743, 16796, 21040, -2842, 256, 0, 0, 261, -2742, 16778, 21057, -2841, 256, 0, 0, 260, -2740, 16760, 21074, -2841, 256, 0, 0, 260, -2739, 16742, 21090, -2840, 256, 0, 0, 260, -2738, 16724, 21107, -2840, 255, 0, 0, 260, -2737, 16706, 21123, -2839, 255, 0,
+ -1, 260, -2736, 16688, 21140, -2839, 255, 0, -1, 260, -2734, 16670, 21156, -2838, 255, 0, -1, 260, -2733, 16652, 21173, -2838, 255, 0, -1, 260, -2732, 16634, 21189, -2837, 255, 0, -1, 260, -2731, 16616, 21205, -2836, 254, 0, -1, 259, -2729, 16598, 21222, -2836, 254, 0, -1, 259, -2728, 16580, 21238, -2835, 254, 0, -1, 259, -2727, 16562, 21255, -2835, 254, 0,
+ -1, 259, -2726, 16544, 21271, -2834, 254, 0, -1, 259, -2724, 16526, 21288, -2833, 253, 0, -1, 259, -2723, 16508, 21304, -2833, 253, 0, -1, 259, -2722, 16490, 21320, -2832, 253, 0, -1, 259, -2720, 16472, 21337, -2831, 253, 0, -1, 259, -2719, 16454, 21353, -2831, 253, 0, -1, 258, -2718, 16436, 21370, -2830, 252, 0, -1, 258, -2716, 16418, 21386, -2829, 252, 0,
+ -1, 258, -2715, 16400, 21402, -2829, 252, 0, -1, 258, -2714, 16382, 21419, -2828, 252, 0, -1, 258, -2712, 16364, 21435, -2827, 252, 0, -1, 258, -2711, 16346, 21451, -2826, 251, 0, -1, 258, -2710, 16328, 21468, -2826, 251, 0, -1, 257, -2708, 16310, 21484, -2825, 251, 0, -1, 257, -2707, 16292, 21500, -2824, 251, 0, -1, 257, -2706, 16274, 21516, -2823, 251, 0,
+ -1, 257, -2704, 16256, 21533, -2823, 250, 0, -1, 257, -2703, 16238, 21549, -2822, 250, 0, -1, 257, -2702, 16220, 21565, -2821, 250, 0, -1, 257, -2700, 16202, 21581, -2820, 250, 0, -1, 257, -2699, 16184, 21598, -2819, 249, 0, -1, 256, -2698, 16166, 21614, -2819, 249, 0, -1, 256, -2696, 16148, 21630, -2818, 249, 0, -1, 256, -2695, 16130, 21646, -2817, 249, 0,
+ -1, 256, -2693, 16111, 21662, -2816, 249, 0, -1, 256, -2692, 16093, 21679, -2815, 248, 0, -1, 256, -2691, 16075, 21695, -2814, 248, 0, -1, 256, -2689, 16057, 21711, -2813, 248, 0, -1, 255, -2688, 16039, 21727, -2813, 248, 0, -1, 255, -2686, 16021, 21743, -2812, 247, 0, -1, 255, -2685, 16003, 21759, -2811, 247, 0, -1, 255, -2683, 15985, 21776, -2810, 247, 0,
+ -1, 255, -2682, 15967, 21792, -2809, 247, 0, -1, 255, -2680, 15949, 21808, -2808, 246, 0, -1, 255, -2679, 15931, 21824, -2807, 246, 0, -1, 254, -2678, 15913, 21840, -2806, 246, 0, -1, 254, -2676, 15895, 21856, -2805, 246, 0, -1, 254, -2675, 15877, 21872, -2804, 245, 0, -1, 254, -2673, 15858, 21888, -2803, 245, 0, -1, 254, -2672, 15840, 21904, -2802, 245, 0,
+ -1, 254, -2670, 15822, 21920, -2801, 245, 0, -1, 254, -2669, 15804, 21936, -2800, 244, 0, -1, 253, -2667, 15786, 21952, -2799, 244, 0, -1, 253, -2666, 15768, 21968, -2798, 244, 0, -1, 253, -2664, 15750, 21984, -2797, 244, 0, -1, 253, -2663, 15732, 22000, -2796, 243, 0, -1, 253, -2661, 15714, 22016, -2795, 243, 0, -1, 253, -2660, 15696, 22032, -2794, 243, 0,
+ -1, 253, -2658, 15678, 22048, -2793, 243, 0, -1, 252, -2657, 15660, 22064, -2792, 242, 0, -1, 252, -2655, 15641, 22080, -2791, 242, 0, -1, 252, -2654, 15623, 22096, -2790, 242, 0, -1, 252, -2652, 15605, 22112, -2789, 242, 0, -1, 252, -2651, 15587, 22128, -2788, 241, 0, -1, 252, -2649, 15569, 22143, -2786, 241, 0, -1, 251, -2647, 15551, 22159, -2785, 241, 0,
+ -1, 251, -2646, 15533, 22175, -2784, 241, 0, -1, 251, -2644, 15515, 22191, -2783, 240, 0, -1, 251, -2643, 15497, 22207, -2782, 240, 0, -1, 251, -2641, 15479, 22223, -2781, 240, 0, -1, 251, -2640, 15460, 22238, -2780, 239, 0, -1, 250, -2638, 15442, 22254, -2778, 239, 0, -1, 250, -2636, 15424, 22270, -2777, 239, 0, -1, 250, -2635, 15406, 22286, -2776, 239, 0,
+ -1, 250, -2633, 15388, 22302, -2775, 238, 0, -1, 250, -2632, 15370, 22317, -2774, 238, 0, -1, 250, -2630, 15352, 22333, -2772, 238, 0, -1, 249, -2628, 15334, 22349, -2771, 237, 0, -1, 249, -2627, 15316, 22365, -2770, 237, 0, -1, 249, -2625, 15298, 22380, -2769, 237, 0, -1, 249, -2624, 15279, 22396, -2767, 236, 0, -1, 249, -2622, 15261, 22412, -2766, 236, 0,
+ -1, 249, -2620, 15243, 22427, -2765, 236, 0, -2, 248, -2619, 15225, 22443, -2763, 236, 0, -2, 248, -2617, 15207, 22459, -2762, 235, 0, -2, 248, -2615, 15189, 22474, -2761, 235, 0, -2, 248, -2614, 15171, 22490, -2759, 235, 0, -2, 248, -2612, 15153, 22506, -2758, 234, 0, -2, 248, -2611, 15135, 22521, -2757, 234, 0, -2, 247, -2609, 15116, 22537, -2755, 234, 0,
+ -2, 247, -2607, 15098, 22552, -2754, 233, 0, -2, 247, -2606, 15080, 22568, -2753, 233, 0, -2, 247, -2604, 15062, 22583, -2751, 233, 0, -2, 247, -2602, 15044, 22599, -2750, 232, 0, -2, 247, -2600, 15026, 22615, -2748, 232, 0, -2, 246, -2599, 15008, 22630, -2747, 232, 0, -2, 246, -2597, 14990, 22646, -2746, 231, 0, -2, 246, -2595, 14972, 22661, -2744, 231, 0,
+ -2, 246, -2594, 14953, 22677, -2743, 231, 0, -2, 246, -2592, 14935, 22692, -2741, 230, 0, -2, 245, -2590, 14917, 22708, -2740, 230, 0, -2, 245, -2589, 14899, 22723, -2738, 230, 0, -2, 245, -2587, 14881, 22738, -2737, 229, 0, -2, 245, -2585, 14863, 22754, -2735, 229, 0, -2, 245, -2583, 14845, 22769, -2734, 229, 0, -2, 245, -2582, 14827, 22785, -2732, 228, 0,
+ -2, 244, -2580, 14809, 22800, -2731, 228, 0, -2, 244, -2578, 14790, 22816, -2729, 228, 0, -2, 244, -2576, 14772, 22831, -2728, 227, 0, -2, 244, -2575, 14754, 22846, -2726, 227, 0, -2, 244, -2573, 14736, 22862, -2725, 227, 0, -2, 243, -2571, 14718, 22877, -2723, 226, 0, -2, 243, -2569, 14700, 22892, -2721, 226, 0, -2, 243, -2568, 14682, 22908, -2720, 226, 0,
+ -2, 243, -2566, 14664, 22923, -2718, 225, 0, -2, 243, -2564, 14646, 22938, -2717, 225, 0, -2, 243, -2562, 14627, 22954, -2715, 225, 0, -2, 242, -2561, 14609, 22969, -2713, 224, 0, -2, 242, -2559, 14591, 22984, -2712, 224, 0, -2, 242, -2557, 14573, 22999, -2710, 223, 0, -2, 242, -2555, 14555, 23015, -2708, 223, 0, -2, 242, -2553, 14537, 23030, -2707, 223, 0,
+ -2, 241, -2552, 14519, 23045, -2705, 222, 0, -2, 241, -2550, 14501, 23060, -2703, 222, 0, -2, 241, -2548, 14483, 23075, -2702, 222, 0, -2, 241, -2546, 14464, 23090, -2700, 221, 0, -2, 241, -2544, 14446, 23106, -2698, 221, 0, -2, 240, -2543, 14428, 23121, -2697, 220, 0, -2, 240, -2541, 14410, 23136, -2695, 220, 0, -2, 240, -2539, 14392, 23151, -2693, 220, 0,
+ -2, 240, -2537, 14374, 23166, -2691, 219, 0, -2, 240, -2535, 14356, 23181, -2689, 219, 0, -2, 239, -2533, 14338, 23196, -2688, 219, 0, -2, 239, -2532, 14320, 23211, -2686, 218, 0, -2, 239, -2530, 14302, 23226, -2684, 218, 0, -3, 239, -2528, 14283, 23242, -2682, 217, 0, -3, 239, -2526, 14265, 23257, -2680, 217, 0, -3, 238, -2524, 14247, 23272, -2679, 217, 0,
+ -3, 238, -2522, 14229, 23287, -2677, 216, 0, -3, 238, -2521, 14211, 23302, -2675, 216, 0, -3, 238, -2519, 14193, 23317, -2673, 215, 0, -3, 238, -2517, 14175, 23332, -2671, 215, 0, -3, 237, -2515, 14157, 23346, -2669, 215, 0, -3, 237, -2513, 14139, 23361, -2667, 214, 0, -3, 237, -2511, 14121, 23376, -2665, 214, 0, -3, 237, -2509, 14103, 23391, -2664, 213, 0,
+ -3, 237, -2507, 14084, 23406, -2662, 213, 0, -3, 236, -2505, 14066, 23421, -2660, 212, 0, -3, 236, -2504, 14048, 23436, -2658, 212, 0, -3, 236, -2502, 14030, 23451, -2656, 212, 0, -3, 236, -2500, 14012, 23466, -2654, 211, 0, -3, 236, -2498, 13994, 23481, -2652, 211, 0, -3, 235, -2496, 13976, 23495, -2650, 210, 0, -3, 235, -2494, 13958, 23510, -2648, 210, 0,
+ -3, 235, -2492, 13940, 23525, -2646, 210, 0, -3, 235, -2490, 13922, 23540, -2644, 209, 0, -3, 234, -2488, 13904, 23555, -2642, 209, 0, -3, 234, -2486, 13886, 23569, -2640, 208, 0, -3, 234, -2484, 13868, 23584, -2638, 208, 0, -3, 234, -2482, 13849, 23599, -2636, 207, 0, -3, 234, -2480, 13831, 23614, -2634, 207, 0, -3, 233, -2479, 13813, 23628, -2631, 206, 0,
+ -3, 233, -2477, 13795, 23643, -2629, 206, 0, -3, 233, -2475, 13777, 23658, -2627, 206, 0, -3, 233, -2473, 13759, 23672, -2625, 205, 0, -3, 233, -2471, 13741, 23687, -2623, 205, 0, -3, 232, -2469, 13723, 23702, -2621, 204, 0, -3, 232, -2467, 13705, 23716, -2619, 204, 0, -3, 232, -2465, 13687, 23731, -2617, 203, 0, -3, 232, -2463, 13669, 23745, -2614, 203, 0,
+ -3, 231, -2461, 13651, 23760, -2612, 202, 0, -3, 231, -2459, 13633, 23775, -2610, 202, 0, -3, 231, -2457, 13615, 23789, -2608, 201, 0, -3, 231, -2455, 13597, 23804, -2606, 201, 0, -3, 231, -2453, 13579, 23818, -2603, 201, 0, -3, 230, -2451, 13561, 23833, -2601, 200, 0, -4, 230, -2449, 13543, 23847, -2599, 200, 0, -4, 230, -2447, 13525, 23862, -2597, 199, 0,
+ -4, 230, -2445, 13506, 23876, -2594, 199, 0, -4, 230, -2443, 13488, 23891, -2592, 198, 0, -4, 229, -2441, 13470, 23905, -2590, 198, 0, -4, 229, -2439, 13452, 23920, -2588, 197, 0, -4, 229, -2437, 13434, 23934, -2585, 197, 0, -4, 229, -2435, 13416, 23948, -2583, 196, 0, -4, 228, -2433, 13398, 23963, -2581, 196, 0, -4, 228, -2431, 13380, 23977, -2578, 195, 0,
+ -4, 228, -2429, 13362, 23992, -2576, 195, 0, -4, 228, -2427, 13344, 24006, -2574, 194, 0, -4, 228, -2425, 13326, 24020, -2571, 194, 0, -4, 227, -2423, 13308, 24035, -2569, 193, 0, -4, 227, -2421, 13290, 24049, -2566, 193, 0, -4, 227, -2419, 13272, 24063, -2564, 192, 0, -4, 227, -2417, 13254, 24078, -2562, 192, 0, -4, 226, -2414, 13236, 24092, -2559, 191, 0,
+ -4, 226, -2412, 13218, 24106, -2557, 191, 0, -4, 226, -2410, 13200, 24120, -2554, 190, 0, -4, 226, -2408, 13182, 24135, -2552, 190, 0, -4, 225, -2406, 13164, 24149, -2549, 189, 0, -4, 225, -2404, 13146, 24163, -2547, 189, 0, -4, 225, -2402, 13128, 24177, -2544, 188, 0, -4, 225, -2400, 13110, 24191, -2542, 188, 0, -4, 225, -2398, 13092, 24206, -2539, 187, 0,
+ -4, 224, -2396, 13074, 24220, -2537, 187, 0, -4, 224, -2394, 13056, 24234, -2534, 186, 0, -4, 224, -2392, 13038, 24248, -2532, 186, 0, -4, 224, -2390, 13020, 24262, -2529, 185, 0, -4, 223, -2388, 13002, 24276, -2527, 185, 0, -4, 223, -2385, 12984, 24290, -2524, 184, 0, -4, 223, -2383, 12966, 24304, -2521, 184, 0, -4, 223, -2381, 12949, 24318, -2519, 183, 0,
+ -5, 222, -2379, 12931, 24332, -2516, 183, 0, -5, 222, -2377, 12913, 24346, -2514, 182, 0, -5, 222, -2375, 12895, 24360, -2511, 181, 0, -5, 222, -2373, 12877, 24374, -2508, 181, 0, -5, 222, -2371, 12859, 24388, -2506, 180, 0, -5, 221, -2369, 12841, 24402, -2503, 180, 0, -5, 221, -2366, 12823, 24416, -2500, 179, 0, -5, 221, -2364, 12805, 24430, -2498, 179, 0,
+ -5, 221, -2362, 12787, 24444, -2495, 178, 0, -5, 220, -2360, 12769, 24458, -2492, 178, 0, -5, 220, -2358, 12751, 24472, -2490, 177, 0, -5, 220, -2356, 12733, 24486, -2487, 176, 0, -5, 220, -2354, 12715, 24500, -2484, 176, 0, -5, 219, -2351, 12697, 24514, -2481, 175, 0, -5, 219, -2349, 12679, 24527, -2479, 175, 0, -5, 219, -2347, 12661, 24541, -2476, 174, 0,
+ -5, 219, -2345, 12644, 24555, -2473, 174, 0, -5, 218, -2343, 12626, 24569, -2470, 173, 0, -5, 218, -2341, 12608, 24583, -2467, 173, 0, -5, 218, -2339, 12590, 24596, -2465, 172, 0, -5, 218, -2336, 12572, 24610, -2462, 171, 0, -5, 217, -2334, 12554, 24624, -2459, 171, 0, -5, 217, -2332, 12536, 24637, -2456, 170, 0, -5, 217, -2330, 12518, 24651, -2453, 170, 0,
+ -5, 217, -2328, 12500, 24665, -2450, 169, 0, -5, 217, -2326, 12482, 24679, -2447, 168, 0, -5, 216, -2323, 12465, 24692, -2444, 168, 0, -5, 216, -2321, 12447, 24706, -2442, 167, 0, -5, 216, -2319, 12429, 24719, -2439, 167, 0, -5, 216, -2317, 12411, 24733, -2436, 166, 0, -5, 215, -2315, 12393, 24747, -2433, 166, 0, -6, 215, -2312, 12375, 24760, -2430, 165, 0,
+ -6, 215, -2310, 12357, 24774, -2427, 164, 0, -6, 215, -2308, 12340, 24787, -2424, 164, 0, -6, 214, -2306, 12322, 24801, -2421, 163, 0, -6, 214, -2304, 12304, 24814, -2418, 163, 0, -6, 214, -2301, 12286, 24828, -2415, 162, 0, -6, 214, -2299, 12268, 24841, -2412, 161, 0, -6, 213, -2297, 12250, 24855, -2409, 161, 0, -6, 213, -2295, 12232, 24868, -2406, 160, 0,
+ -6, 213, -2293, 12215, 24882, -2403, 159, 0, -6, 213, -2290, 12197, 24895, -2400, 159, 0, -6, 212, -2288, 12179, 24909, -2396, 158, 0, -6, 212, -2286, 12161, 24922, -2393, 158, 0, -6, 212, -2284, 12143, 24935, -2390, 157, 0, -6, 212, -2281, 12126, 24949, -2387, 156, 0, -6, 211, -2279, 12108, 24962, -2384, 156, 0, -6, 211, -2277, 12090, 24975, -2381, 155, 0,
+ -6, 211, -2275, 12072, 24989, -2378, 154, 0, -6, 211, -2272, 12054, 25002, -2375, 154, 0, -6, 210, -2270, 12036, 25015, -2371, 153, 1, -6, 210, -2268, 12019, 25029, -2368, 153, 1, -6, 210, -2266, 12001, 25042, -2365, 152, 1, -6, 210, -2264, 11983, 25055, -2362, 151, 1, -6, 209, -2261, 11965, 25068, -2359, 151, 1, -6, 209, -2259, 11948, 25081, -2355, 150, 1,
+ -6, 209, -2257, 11930, 25095, -2352, 149, 1, -6, 209, -2254, 11912, 25108, -2349, 149, 1, -7, 208, -2252, 11894, 25121, -2346, 148, 1, -7, 208, -2250, 11877, 25134, -2342, 147, 1, -7, 208, -2248, 11859, 25147, -2339, 147, 1, -7, 208, -2245, 11841, 25160, -2336, 146, 1, -7, 207, -2243, 11823, 25173, -2332, 145, 1, -7, 207, -2241, 11806, 25187, -2329, 145, 1,
+ -7, 207, -2239, 11788, 25200, -2326, 144, 1, -7, 207, -2236, 11770, 25213, -2322, 143, 1, -7, 206, -2234, 11752, 25226, -2319, 143, 1, -7, 206, -2232, 11735, 25239, -2316, 142, 1, -7, 206, -2229, 11717, 25252, -2312, 141, 1, -7, 206, -2227, 11699, 25265, -2309, 141, 1, -7, 205, -2225, 11681, 25278, -2305, 140, 1, -7, 205, -2223, 11664, 25291, -2302, 139, 1,
+ -7, 205, -2220, 11646, 25304, -2299, 139, 1, -7, 205, -2218, 11628, 25317, -2295, 138, 1, -7, 204, -2216, 11611, 25329, -2292, 137, 1, -7, 204, -2213, 11593, 25342, -2288, 137, 1, -7, 204, -2211, 11575, 25355, -2285, 136, 1, -7, 204, -2209, 11558, 25368, -2281, 135, 1, -7, 203, -2207, 11540, 25381, -2278, 135, 1, -7, 203, -2204, 11522, 25394, -2274, 134, 1,
+ -7, 203, -2202, 11505, 25407, -2271, 133, 1, -7, 203, -2200, 11487, 25419, -2267, 132, 1, -7, 202, -2197, 11469, 25432, -2264, 132, 1, -8, 202, -2195, 11452, 25445, -2260, 131, 1, -8, 202, -2193, 11434, 25458, -2256, 130, 1, -8, 202, -2190, 11416, 25470, -2253, 130, 1, -8, 201, -2188, 11399, 25483, -2249, 129, 1, -8, 201, -2186, 11381, 25496, -2246, 128, 1,
+ -8, 201, -2183, 11363, 25508, -2242, 127, 1, -8, 200, -2181, 11346, 25521, -2238, 127, 1, -8, 200, -2179, 11328, 25534, -2235, 126, 1, -8, 200, -2176, 11311, 25546, -2231, 125, 1, -8, 200, -2174, 11293, 25559, -2227, 125, 1, -8, 199, -2172, 11275, 25572, -2224, 124, 1, -8, 199, -2169, 11258, 25584, -2220, 123, 1, -8, 199, -2167, 11240, 25597, -2216, 122, 1,
+ -8, 199, -2165, 11222, 25609, -2213, 122, 1, -8, 198, -2162, 11205, 25622, -2209, 121, 1, -8, 198, -2160, 11187, 25634, -2205, 120, 1, -8, 198, -2158, 11170, 25647, -2201, 119, 1, -8, 198, -2155, 11152, 25659, -2198, 119, 1, -8, 197, -2153, 11135, 25672, -2194, 118, 1, -8, 197, -2151, 11117, 25684, -2190, 117, 1, -8, 197, -2148, 11099, 25697, -2186, 116, 1,
+ -8, 197, -2146, 11082, 25709, -2182, 116, 1, -8, 196, -2143, 11064, 25722, -2179, 115, 1, -8, 196, -2141, 11047, 25734, -2175, 114, 2, -9, 196, -2139, 11029, 25746, -2171, 113, 2, -9, 196, -2136, 11012, 25759, -2167, 113, 2, -9, 195, -2134, 10994, 25771, -2163, 112, 2, -9, 195, -2132, 10977, 25783, -2159, 111, 2, -9, 195, -2129, 10959, 25796, -2155, 110, 2,
+ -9, 194, -2127, 10942, 25808, -2152, 110, 2, -9, 194, -2125, 10924, 25820, -2148, 109, 2, -9, 194, -2122, 10907, 25832, -2144, 108, 2, -9, 194, -2120, 10889, 25845, -2140, 107, 2, -9, 193, -2117, 10872, 25857, -2136, 106, 2, -9, 193, -2115, 10854, 25869, -2132, 106, 2, -9, 193, -2113, 10837, 25881, -2128, 105, 2, -9, 193, -2110, 10819, 25893, -2124, 104, 2,
+ -9, 192, -2108, 10802, 25905, -2120, 103, 2, -9, 192, -2105, 10784, 25918, -2116, 103, 2, -9, 192, -2103, 10767, 25930, -2112, 102, 2, -9, 192, -2101, 10749, 25942, -2108, 101, 2, -9, 191, -2098, 10732, 25954, -2104, 100, 2, -9, 191, -2096, 10715, 25966, -2100, 99, 2, -9, 191, -2093, 10697, 25978, -2096, 99, 2, -9, 191, -2091, 10680, 25990, -2091, 98, 2,
+ -9, 190, -2089, 10662, 26002, -2087, 97, 2, -10, 190, -2086, 10645, 26014, -2083, 96, 2, -10, 190, -2084, 10627, 26026, -2079, 95, 2, -10, 189, -2081, 10610, 26038, -2075, 95, 2, -10, 189, -2079, 10593, 26050, -2071, 94, 2, -10, 189, -2077, 10575, 26062, -2067, 93, 2, -10, 189, -2074, 10558, 26074, -2062, 92, 2, -10, 188, -2072, 10540, 26086, -2058, 91, 2,
+ -10, 188, -2069, 10523, 26097, -2054, 90, 2, -10, 188, -2067, 10506, 26109, -2050, 90, 2, -10, 188, -2065, 10488, 26121, -2046, 89, 2, -10, 187, -2062, 10471, 26133, -2041, 88, 2, -10, 187, -2060, 10454, 26145, -2037, 87, 2, -10, 187, -2057, 10436, 26157, -2033, 86, 2, -10, 187, -2055, 10419, 26168, -2029, 85, 2, -10, 186, -2052, 10402, 26180, -2024, 85, 2,
+ -10, 186, -2050, 10384, 26192, -2020, 84, 2, -10, 186, -2048, 10367, 26204, -2016, 83, 2, -10, 185, -2045, 10350, 26215, -2011, 82, 3, -10, 185, -2043, 10332, 26227, -2007, 81, 3, -10, 185, -2040, 10315, 26239, -2003, 80, 3, -10, 185, -2038, 10298, 26250, -1998, 80, 3, -11, 184, -2035, 10280, 26262, -1994, 79, 3, -11, 184, -2033, 10263, 26273, -1990, 78, 3,
+ -11, 184, -2031, 10246, 26285, -1985, 77, 3, -11, 184, -2028, 10228, 26297, -1981, 76, 3, -11, 183, -2026, 10211, 26308, -1976, 75, 3, -11, 183, -2023, 10194, 26320, -1972, 74, 3, -11, 183, -2021, 10177, 26331, -1967, 74, 3, -11, 183, -2018, 10159, 26343, -1963, 73, 3, -11, 182, -2016, 10142, 26354, -1958, 72, 3, -11, 182, -2013, 10125, 26366, -1954, 71, 3,
+ -11, 182, -2011, 10108, 26377, -1949, 70, 3, -11, 181, -2009, 10090, 26389, -1945, 69, 3, -11, 181, -2006, 10073, 26400, -1940, 68, 3, -11, 181, -2004, 10056, 26411, -1936, 67, 3, -11, 181, -2001, 10039, 26423, -1931, 67, 3, -11, 180, -1999, 10022, 26434, -1927, 66, 3, -11, 180, -1996, 10004, 26445, -1922, 65, 3, -11, 180, -1994, 9987, 26457, -1918, 64, 3,
+ -11, 180, -1991, 9970, 26468, -1913, 63, 3, -11, 179, -1989, 9953, 26479, -1908, 62, 3, -12, 179, -1986, 9936, 26491, -1904, 61, 3, -12, 179, -1984, 9919, 26502, -1899, 60, 3, -12, 178, -1982, 9901, 26513, -1895, 59, 3, -12, 178, -1979, 9884, 26524, -1890, 58, 3, -12, 178, -1977, 9867, 26536, -1885, 58, 3, -12, 178, -1974, 9850, 26547, -1880, 57, 3,
+ -12, 177, -1972, 9833, 26558, -1876, 56, 3, -12, 177, -1969, 9816, 26569, -1871, 55, 3, -12, 177, -1967, 9799, 26580, -1866, 54, 4, -12, 177, -1964, 9781, 26591, -1862, 53, 4, -12, 176, -1962, 9764, 26602, -1857, 52, 4, -12, 176, -1959, 9747, 26613, -1852, 51, 4, -12, 176, -1957, 9730, 26625, -1847, 50, 4, -12, 176, -1954, 9713, 26636, -1843, 49, 4,
+ -12, 175, -1952, 9696, 26647, -1838, 48, 4, -12, 175, -1949, 9679, 26658, -1833, 47, 4, -12, 175, -1947, 9662, 26669, -1828, 46, 4, -12, 174, -1944, 9645, 26679, -1823, 46, 4, -13, 174, -1942, 9628, 26690, -1818, 45, 4, -13, 174, -1939, 9611, 26701, -1813, 44, 4, -13, 174, -1937, 9594, 26712, -1809, 43, 4, -13, 173, -1935, 9577, 26723, -1804, 42, 4,
+ -13, 173, -1932, 9560, 26734, -1799, 41, 4, -13, 173, -1930, 9543, 26745, -1794, 40, 4, -13, 173, -1927, 9526, 26756, -1789, 39, 4, -13, 172, -1925, 9509, 26767, -1784, 38, 4, -13, 172, -1922, 9492, 26777, -1779, 37, 4, -13, 172, -1920, 9475, 26788, -1774, 36, 4, -13, 171, -1917, 9458, 26799, -1769, 35, 4, -13, 171, -1915, 9441, 26810, -1764, 34, 4,
+ -13, 171, -1912, 9424, 26820, -1759, 33, 4, -13, 171, -1910, 9407, 26831, -1754, 32, 4, -13, 170, -1907, 9390, 26842, -1749, 31, 4, -13, 170, -1905, 9373, 26852, -1744, 30, 4, -13, 170, -1902, 9356, 26863, -1739, 29, 4, -13, 170, -1900, 9339, 26874, -1734, 28, 5, -13, 169, -1897, 9322, 26884, -1729, 27, 5, -14, 169, -1895, 9305, 26895, -1724, 26, 5,
+ -14, 169, -1892, 9288, 26905, -1719, 25, 5, -14, 168, -1890, 9271, 26916, -1713, 24, 5, -14, 168, -1887, 9254, 26926, -1708, 23, 5, -14, 168, -1885, 9237, 26937, -1703, 22, 5, -14, 168, -1882, 9221, 26947, -1698, 21, 5, -14, 167, -1880, 9204, 26958, -1693, 20, 5, -14, 167, -1877, 9187, 26968, -1688, 19, 5, -14, 167, -1875, 9170, 26979, -1682, 18, 5,
+ -14, 167, -1872, 9153, 26989, -1677, 17, 5, -14, 166, -1870, 9136, 27000, -1672, 16, 5, -14, 166, -1867, 9119, 27010, -1667, 15, 5, -14, 166, -1865, 9103, 27020, -1661, 14, 5, -14, 165, -1862, 9086, 27031, -1656, 13, 5, -14, 165, -1859, 9069, 27041, -1651, 12, 5, -14, 165, -1857, 9052, 27051, -1646, 11, 5, -14, 165, -1854, 9035, 27062, -1640, 10, 5,
+ -15, 164, -1852, 9019, 27072, -1635, 9, 5, -15, 164, -1849, 9002, 27082, -1630, 8, 5, -15, 164, -1847, 8985, 27092, -1624, 7, 5, -15, 164, -1844, 8968, 27103, -1619, 6, 5, -15, 163, -1842, 8952, 27113, -1614, 5, 6, -15, 163, -1839, 8935, 27123, -1608, 4, 6, -15, 163, -1837, 8918, 27133, -1603, 3, 6, -15, 162, -1834, 8901, 27143, -1597, 2, 6,
+ -15, 162, -1832, 8885, 27153, -1592, 1, 6, -15, 162, -1829, 8868, 27164, -1587, 0, 6, -15, 162, -1827, 8851, 27174, -1581, -1, 6, -15, 161, -1824, 8834, 27184, -1576, -2, 6, -15, 161, -1822, 8818, 27194, -1570, -3, 6, -15, 161, -1819, 8801, 27204, -1565, -4, 6, -15, 161, -1817, 8784, 27214, -1559, -5, 6, -15, 160, -1814, 8768, 27224, -1554, -6, 6,
+ -15, 160, -1812, 8751, 27234, -1548, -8, 6, -16, 160, -1809, 8734, 27244, -1543, -9, 6, -16, 159, -1807, 8718, 27254, -1537, -10, 6, -16, 159, -1804, 8701, 27263, -1532, -11, 6, -16, 159, -1801, 8684, 27273, -1526, -12, 6, -16, 159, -1799, 8668, 27283, -1520, -13, 6, -16, 158, -1796, 8651, 27293, -1515, -14, 6, -16, 158, -1794, 8634, 27303, -1509, -15, 6,
+ -16, 158, -1791, 8618, 27313, -1503, -16, 6, -16, 158, -1789, 8601, 27322, -1498, -17, 6, -16, 157, -1786, 8585, 27332, -1492, -18, 7, -16, 157, -1784, 8568, 27342, -1486, -19, 7, -16, 157, -1781, 8552, 27352, -1481, -20, 7, -16, 157, -1779, 8535, 27361, -1475, -22, 7, -16, 156, -1776, 8518, 27371, -1469, -23, 7, -16, 156, -1774, 8502, 27381, -1464, -24, 7,
+ -16, 156, -1771, 8485, 27390, -1458, -25, 7, -16, 155, -1769, 8469, 27400, -1452, -26, 7, -17, 155, -1766, 8452, 27410, -1446, -27, 7, -17, 155, -1763, 8436, 27419, -1441, -28, 7, -17, 155, -1761, 8419, 27429, -1435, -29, 7, -17, 154, -1758, 8403, 27438, -1429, -30, 7, -17, 154, -1756, 8386, 27448, -1423, -31, 7, -17, 154, -1753, 8370, 27457, -1417, -33, 7,
+ -17, 154, -1751, 8353, 27467, -1412, -34, 7, -17, 153, -1748, 8337, 27476, -1406, -35, 7, -17, 153, -1746, 8320, 27486, -1400, -36, 7, -17, 153, -1743, 8304, 27495, -1394, -37, 7, -17, 152, -1741, 8287, 27505, -1388, -38, 7, -17, 152, -1738, 8271, 27514, -1382, -39, 8, -17, 152, -1736, 8255, 27523, -1376, -40, 8, -17, 152, -1733, 8238, 27533, -1370, -42, 8,
+ -17, 151, -1730, 8222, 27542, -1364, -43, 8, -17, 151, -1728, 8205, 27552, -1358, -44, 8, -18, 151, -1725, 8189, 27561, -1352, -45, 8, -18, 151, -1723, 8173, 27570, -1346, -46, 8, -18, 150, -1720, 8156, 27579, -1340, -47, 8, -18, 150, -1718, 8140, 27589, -1334, -49, 8, -18, 150, -1715, 8123, 27598, -1328, -50, 8, -18, 149, -1713, 8107, 27607, -1322, -51, 8,
+ -18, 149, -1710, 8091, 27616, -1316, -52, 8, -18, 149, -1708, 8074, 27625, -1310, -53, 8, -18, 149, -1705, 8058, 27634, -1304, -54, 8, -18, 148, -1703, 8042, 27644, -1298, -55, 8, -18, 148, -1700, 8025, 27653, -1292, -57, 8, -18, 148, -1697, 8009, 27662, -1286, -58, 8, -18, 148, -1695, 7993, 27671, -1280, -59, 8, -18, 147, -1692, 7977, 27680, -1273, -60, 9,
+ -18, 147, -1690, 7960, 27689, -1267, -61, 9, -18, 147, -1687, 7944, 27698, -1261, -63, 9, -19, 147, -1685, 7928, 27707, -1255, -64, 9, -19, 146, -1682, 7912, 27716, -1249, -65, 9, -19, 146, -1680, 7895, 27725, -1243, -66, 9, -19, 146, -1677, 7879, 27734, -1236, -67, 9, -19, 145, -1674, 7863, 27743, -1230, -68, 9, -19, 145, -1672, 7847, 27751, -1224, -70, 9,
+ -19, 145, -1669, 7830, 27760, -1218, -71, 9, -19, 145, -1667, 7814, 27769, -1211, -72, 9, -19, 144, -1664, 7798, 27778, -1205, -73, 9, -19, 144, -1662, 7782, 27787, -1199, -74, 9, -19, 144, -1659, 7766, 27795, -1192, -76, 9, -19, 144, -1657, 7750, 27804, -1186, -77, 9, -19, 143, -1654, 7733, 27813, -1180, -78, 9, -19, 143, -1652, 7717, 27822, -1173, -79, 9,
+ -19, 143, -1649, 7701, 27830, -1167, -81, 10, -20, 142, -1646, 7685, 27839, -1160, -82, 10, -20, 142, -1644, 7669, 27848, -1154, -83, 10, -20, 142, -1641, 7653, 27856, -1148, -84, 10, -20, 142, -1639, 7637, 27865, -1141, -85, 10, -20, 141, -1636, 7621, 27874, -1135, -87, 10, -20, 141, -1634, 7605, 27882, -1128, -88, 10, -20, 141, -1631, 7589, 27891, -1122, -89, 10,
+ -20, 141, -1629, 7572, 27899, -1115, -90, 10, -20, 140, -1626, 7556, 27908, -1109, -92, 10, -20, 140, -1624, 7540, 27916, -1102, -93, 10, -20, 140, -1621, 7524, 27925, -1096, -94, 10, -20, 140, -1618, 7508, 27933, -1089, -95, 10, -20, 139, -1616, 7492, 27941, -1083, -97, 10, -20, 139, -1613, 7476, 27950, -1076, -98, 10, -20, 139, -1611, 7460, 27958, -1070, -99, 11,
+ -21, 138, -1608, 7444, 27967, -1063, -100, 11, -21, 138, -1606, 7428, 27975, -1056, -102, 11, -21, 138, -1603, 7412, 27983, -1050, -103, 11, -21, 138, -1601, 7396, 27992, -1043, -104, 11, -21, 137, -1598, 7380, 28000, -1036, -105, 11, -21, 137, -1595, 7365, 28008, -1030, -107, 11, -21, 137, -1593, 7349, 28016, -1023, -108, 11, -21, 137, -1590, 7333, 28025, -1016, -109, 11,
+ -21, 136, -1588, 7317, 28033, -1010, -110, 11, -21, 136, -1585, 7301, 28041, -1003, -112, 11, -21, 136, -1583, 7285, 28049, -996, -113, 11, -21, 136, -1580, 7269, 28057, -989, -114, 11, -21, 135, -1578, 7253, 28065, -983, -116, 11, -21, 135, -1575, 7237, 28073, -976, -117, 11, -21, 135, -1573, 7221, 28082, -969, -118, 12, -22, 135, -1570, 7206, 28090, -962, -119, 12,
+ -22, 134, -1567, 7190, 28098, -956, -121, 12, -22, 134, -1565, 7174, 28106, -949, -122, 12, -22, 134, -1562, 7158, 28114, -942, -123, 12, -22, 133, -1560, 7142, 28122, -935, -125, 12, -22, 133, -1557, 7127, 28130, -928, -126, 12, -22, 133, -1555, 7111, 28137, -921, -127, 12, -22, 133, -1552, 7095, 28145, -914, -129, 12, -22, 132, -1550, 7079, 28153, -907, -130, 12,
+ -22, 132, -1547, 7063, 28161, -901, -131, 12, -22, 132, -1545, 7048, 28169, -894, -133, 12, -22, 132, -1542, 7032, 28177, -887, -134, 12, -22, 131, -1539, 7016, 28185, -880, -135, 12, -22, 131, -1537, 7001, 28192, -873, -136, 13, -23, 131, -1534, 6985, 28200, -866, -138, 13, -23, 131, -1532, 6969, 28208, -859, -139, 13, -23, 130, -1529, 6953, 28216, -852, -140, 13,
+ -23, 130, -1527, 6938, 28223, -845, -142, 13, -23, 130, -1524, 6922, 28231, -838, -143, 13, -23, 130, -1522, 6906, 28239, -831, -144, 13, -23, 129, -1519, 6891, 28246, -824, -146, 13, -23, 129, -1517, 6875, 28254, -816, -147, 13, -23, 129, -1514, 6859, 28261, -809, -149, 13, -23, 128, -1511, 6844, 28269, -802, -150, 13, -23, 128, -1509, 6828, 28277, -795, -151, 13,
+ -23, 128, -1506, 6813, 28284, -788, -153, 13, -23, 128, -1504, 6797, 28292, -781, -154, 14, -23, 127, -1501, 6781, 28299, -774, -155, 14, -24, 127, -1499, 6766, 28307, -766, -157, 14, -24, 127, -1496, 6750, 28314, -759, -158, 14, -24, 127, -1494, 6735, 28321, -752, -159, 14, -24, 126, -1491, 6719, 28329, -745, -161, 14, -24, 126, -1489, 6704, 28336, -738, -162, 14,
+ -24, 126, -1486, 6688, 28344, -730, -163, 14, -24, 126, -1484, 6673, 28351, -723, -165, 14, -24, 125, -1481, 6657, 28358, -716, -166, 14, -24, 125, -1478, 6642, 28366, -708, -168, 14, -24, 125, -1476, 6626, 28373, -701, -169, 14, -24, 125, -1473, 6611, 28380, -694, -170, 14, -24, 124, -1471, 6595, 28387, -687, -172, 15, -24, 124, -1468, 6580, 28395, -679, -173, 15,
+ -24, 124, -1466, 6564, 28402, -672, -175, 15, -25, 124, -1463, 6549, 28409, -664, -176, 15, -25, 123, -1461, 6533, 28416, -657, -177, 15, -25, 123, -1458, 6518, 28423, -650, -179, 15, -25, 123, -1456, 6503, 28430, -642, -180, 15, -25, 122, -1453, 6487, 28437, -635, -182, 15, -25, 122, -1451, 6472, 28444, -627, -183, 15, -25, 122, -1448, 6457, 28451, -620, -184, 15,
+ -25, 122, -1445, 6441, 28458, -612, -186, 15, -25, 121, -1443, 6426, 28465, -605, -187, 15, -25, 121, -1440, 6410, 28472, -597, -189, 16, -25, 121, -1438, 6395, 28479, -590, -190, 16, -25, 121, -1435, 6380, 28486, -582, -191, 16, -25, 120, -1433, 6365, 28493, -575, -193, 16, -25, 120, -1430, 6349, 28500, -567, -194, 16, -26, 120, -1428, 6334, 28507, -560, -196, 16,
+ -26, 120, -1425, 6319, 28514, -552, -197, 16, -26, 119, -1423, 6303, 28521, -545, -199, 16, -26, 119, -1420, 6288, 28527, -537, -200, 16, -26, 119, -1418, 6273, 28534, -529, -202, 16, -26, 119, -1415, 6258, 28541, -522, -203, 16, -26, 118, -1413, 6242, 28548, -514, -204, 16, -26, 118, -1410, 6227, 28554, -506, -206, 17, -26, 118, -1408, 6212, 28561, -499, -207, 17,
+ -26, 118, -1405, 6197, 28568, -491, -209, 17, -26, 117, -1403, 6182, 28574, -483, -210, 17, -26, 117, -1400, 6166, 28581, -476, -212, 17, -26, 117, -1397, 6151, 28588, -468, -213, 17, -26, 117, -1395, 6136, 28594, -460, -215, 17, -27, 116, -1392, 6121, 28601, -452, -216, 17, -27, 116, -1390, 6106, 28607, -444, -218, 17, -27, 116, -1387, 6091, 28614, -437, -219, 17,
+ -27, 116, -1385, 6076, 28620, -429, -220, 17, -27, 115, -1382, 6061, 28627, -421, -222, 18, -27, 115, -1380, 6045, 28633, -413, -223, 18, -27, 115, -1377, 6030, 28640, -405, -225, 18, -27, 115, -1375, 6015, 28646, -398, -226, 18, -27, 114, -1372, 6000, 28653, -390, -228, 18, -27, 114, -1370, 5985, 28659, -382, -229, 18, -27, 114, -1367, 5970, 28665, -374, -231, 18,
+ -27, 114, -1365, 5955, 28672, -366, -232, 18, -27, 113, -1362, 5940, 28678, -358, -234, 18, -28, 113, -1360, 5925, 28684, -350, -235, 18, -28, 113, -1357, 5910, 28690, -342, -237, 18, -28, 113, -1355, 5895, 28697, -334, -238, 19, -28, 112, -1352, 5880, 28703, -326, -240, 19, -28, 112, -1350, 5865, 28709, -318, -241, 19, -28, 112, -1347, 5850, 28715, -310, -243, 19,
+ -28, 112, -1345, 5835, 28721, -302, -244, 19, -28, 111, -1342, 5820, 28727, -294, -246, 19, -28, 111, -1340, 5805, 28734, -286, -247, 19, -28, 111, -1337, 5791, 28740, -278, -249, 19, -28, 111, -1335, 5776, 28746, -270, -250, 19, -28, 110, -1332, 5761, 28752, -262, -252, 19, -28, 110, -1330, 5746, 28758, -254, -254, 19, -28, 110, -1327, 5731, 28764, -246, -255, 20,
+ -29, 110, -1325, 5716, 28770, -237, -257, 20, -29, 109, -1322, 5701, 28776, -229, -258, 20, -29, 109, -1320, 5686, 28782, -221, -260, 20, -29, 109, -1317, 5672, 28788, -213, -261, 20, -29, 109, -1315, 5657, 28793, -205, -263, 20, -29, 108, -1312, 5642, 28799, -196, -264, 20, -29, 108, -1310, 5627, 28805, -188, -266, 20, -29, 108, -1307, 5612, 28811, -180, -267, 20,
+ -29, 108, -1305, 5598, 28817, -172, -269, 20, -29, 107, -1302, 5583, 28822, -163, -270, 21, -29, 107, -1300, 5568, 28828, -155, -272, 21, -29, 107, -1297, 5553, 28834, -147, -274, 21, -29, 107, -1295, 5539, 28840, -139, -275, 21, -30, 106, -1292, 5524, 28845, -130, -277, 21, -30, 106, -1290, 5509, 28851, -122, -278, 21, -30, 106, -1287, 5495, 28857, -114, -280, 21,
+ -30, 106, -1285, 5480, 28862, -105, -281, 21, -30, 105, -1282, 5465, 28868, -97, -283, 21, -30, 105, -1280, 5451, 28873, -88, -285, 21, -30, 105, -1277, 5436, 28879, -80, -286, 22, -30, 105, -1275, 5421, 28885, -72, -288, 22, -30, 104, -1272, 5407, 28890, -63, -289, 22, -30, 104, -1270, 5392, 28896, -55, -291, 22, -30, 104, -1267, 5378, 28901, -46, -292, 22,
+ -30, 104, -1265, 5363, 28906, -38, -294, 22, -30, 103, -1262, 5348, 28912, -29, -296, 22, -31, 103, -1260, 5334, 28917, -21, -297, 22, -31, 103, -1258, 5319, 28923, -12, -299, 22, -31, 103, -1255, 5305, 28928, -4, -300, 23, -31, 103, -1253, 5290, 28933, 5, -302, 23, -31, 102, -1250, 5276, 28939, 13, -304, 23, -31, 102, -1248, 5261, 28944, 22, -305, 23,
+ -31, 102, -1245, 5247, 28949, 30, -307, 23, -31, 102, -1243, 5232, 28954, 39, -308, 23, -31, 101, -1240, 5218, 28960, 48, -310, 23, -31, 101, -1238, 5203, 28965, 56, -312, 23, -31, 101, -1235, 5189, 28970, 65, -313, 23, -31, 101, -1233, 5174, 28975, 74, -315, 23, -31, 100, -1230, 5160, 28980, 82, -317, 24, -32, 100, -1228, 5146, 28985, 91, -318, 24,
+ -32, 100, -1225, 5131, 28990, 100, -320, 24, -32, 100, -1223, 5117, 28995, 108, -321, 24, -32, 99, -1221, 5102, 29000, 117, -323, 24, -32, 99, -1218, 5088, 29006, 126, -325, 24, -32, 99, -1216, 5074, 29010, 135, -326, 24, -32, 99, -1213, 5059, 29015, 143, -328, 24, -32, 98, -1211, 5045, 29020, 152, -330, 24, -32, 98, -1208, 5031, 29025, 161, -331, 25,
+ -32, 98, -1206, 5016, 29030, 170, -333, 25, -32, 98, -1203, 5002, 29035, 179, -335, 25, -32, 97, -1201, 4988, 29040, 187, -336, 25, -32, 97, -1198, 4973, 29045, 196, -338, 25, -33, 97, -1196, 4959, 29050, 205, -340, 25, -33, 97, -1194, 4945, 29054, 214, -341, 25, -33, 97, -1191, 4931, 29059, 223, -343, 25, -33, 96, -1189, 4916, 29064, 232, -345, 25,
+ -33, 96, -1186, 4902, 29069, 241, -346, 26, -33, 96, -1184, 4888, 29073, 250, -348, 26, -33, 96, -1181, 4874, 29078, 259, -350, 26, -33, 95, -1179, 4860, 29083, 268, -351, 26, -33, 95, -1176, 4845, 29087, 277, -353, 26, -33, 95, -1174, 4831, 29092, 286, -355, 26, -33, 95, -1172, 4817, 29096, 295, -356, 26, -33, 94, -1169, 4803, 29101, 304, -358, 26,
+ -33, 94, -1167, 4789, 29106, 313, -360, 27, -34, 94, -1164, 4775, 29110, 322, -361, 27, -34, 94, -1162, 4761, 29115, 331, -363, 27, -34, 94, -1159, 4747, 29119, 340, -365, 27, -34, 93, -1157, 4732, 29124, 349, -366, 27, -34, 93, -1154, 4718, 29128, 358, -368, 27, -34, 93, -1152, 4704, 29132, 367, -370, 27, -34, 93, -1150, 4690, 29137, 376, -372, 27,
+ -34, 92, -1147, 4676, 29141, 385, -373, 27, -34, 92, -1145, 4662, 29145, 395, -375, 28, -34, 92, -1142, 4648, 29150, 404, -377, 28, -34, 92, -1140, 4634, 29154, 413, -378, 28, -34, 91, -1138, 4620, 29158, 422, -380, 28, -34, 91, -1135, 4606, 29163, 431, -382, 28, -35, 91, -1133, 4592, 29167, 441, -384, 28, -35, 91, -1130, 4578, 29171, 450, -385, 28,
+ -35, 91, -1128, 4564, 29175, 459, -387, 28, -35, 90, -1125, 4551, 29179, 468, -389, 29, -35, 90, -1123, 4537, 29183, 478, -391, 29, -35, 90, -1121, 4523, 29188, 487, -392, 29, -35, 90, -1118, 4509, 29192, 496, -394, 29, -35, 89, -1116, 4495, 29196, 506, -396, 29, -35, 89, -1113, 4481, 29200, 515, -397, 29, -35, 89, -1111, 4467, 29204, 524, -399, 29,
+ -35, 89, -1109, 4453, 29208, 534, -401, 29, -35, 88, -1106, 4440, 29212, 543, -403, 30, -35, 88, -1104, 4426, 29216, 552, -404, 30, -36, 88, -1101, 4412, 29220, 562, -406, 30, -36, 88, -1099, 4398, 29223, 571, -408, 30, -36, 88, -1097, 4384, 29227, 581, -410, 30, -36, 87, -1094, 4371, 29231, 590, -411, 30, -36, 87, -1092, 4357, 29235, 600, -413, 30,
+ -36, 87, -1089, 4343, 29239, 609, -415, 30, -36, 87, -1087, 4329, 29243, 619, -417, 31, -36, 86, -1085, 4316, 29246, 628, -419, 31, -36, 86, -1082, 4302, 29250, 638, -420, 31, -36, 86, -1080, 4288, 29254, 647, -422, 31, -36, 86, -1077, 4274, 29258, 657, -424, 31, -36, 86, -1075, 4261, 29261, 666, -426, 31, -36, 85, -1073, 4247, 29265, 676, -427, 31,
+ -37, 85, -1070, 4234, 29268, 686, -429, 31, -37, 85, -1068, 4220, 29272, 695, -431, 32, -37, 85, -1066, 4206, 29276, 705, -433, 32, -37, 84, -1063, 4193, 29279, 714, -435, 32, -37, 84, -1061, 4179, 29283, 724, -436, 32, -37, 84, -1058, 4165, 29286, 734, -438, 32, -37, 84, -1056, 4152, 29290, 743, -440, 32, -37, 84, -1054, 4138, 29293, 753, -442, 32,
+ -37, 83, -1051, 4125, 29297, 763, -444, 32, -37, 83, -1049, 4111, 29300, 773, -445, 33, -37, 83, -1047, 4098, 29303, 782, -447, 33, -37, 83, -1044, 4084, 29307, 792, -449, 33, -38, 82, -1042, 4071, 29310, 802, -451, 33, -38, 82, -1039, 4057, 29314, 812, -453, 33, -38, 82, -1037, 4044, 29317, 821, -454, 33, -38, 82, -1035, 4030, 29320, 831, -456, 33,
+ -38, 82, -1032, 4017, 29323, 841, -458, 34, -38, 81, -1030, 4003, 29327, 851, -460, 34, -38, 81, -1028, 3990, 29330, 861, -462, 34, -38, 81, -1025, 3976, 29333, 871, -464, 34, -38, 81, -1023, 3963, 29336, 880, -465, 34, -38, 80, -1021, 3950, 29339, 890, -467, 34, -38, 80, -1018, 3936, 29342, 900, -469, 34, -38, 80, -1016, 3923, 29346, 910, -471, 34,
+ -38, 80, -1014, 3910, 29349, 920, -473, 35, -39, 80, -1011, 3896, 29352, 930, -475, 35, -39, 79, -1009, 3883, 29355, 940, -476, 35, -39, 79, -1006, 3870, 29358, 950, -478, 35, -39, 79, -1004, 3856, 29361, 960, -480, 35, -39, 79, -1002, 3843, 29364, 970, -482, 35, -39, 79, -999, 3830, 29367, 980, -484, 35, -39, 78, -997, 3816, 29369, 990, -486, 36,
+ -39, 78, -995, 3803, 29372, 1000, -488, 36, -39, 78, -992, 3790, 29375, 1010, -489, 36, -39, 78, -990, 3777, 29378, 1020, -491, 36, -39, 77, -988, 3764, 29381, 1030, -493, 36, -39, 77, -985, 3750, 29384, 1040, -495, 36, -39, 77, -983, 3737, 29386, 1050, -497, 36, -40, 77, -981, 3724, 29389, 1061, -499, 37, -40, 77, -978, 3711, 29392, 1071, -501, 37,
+ -40, 76, -976, 3698, 29395, 1081, -502, 37, -40, 76, -974, 3684, 29397, 1091, -504, 37, -40, 76, -971, 3671, 29400, 1101, -506, 37, -40, 76, -969, 3658, 29403, 1111, -508, 37, -40, 76, -967, 3645, 29405, 1122, -510, 37, -40, 75, -965, 3632, 29408, 1132, -512, 38, -40, 75, -962, 3619, 29410, 1142, -514, 38, -40, 75, -960, 3606, 29413, 1152, -516, 38,
+ -40, 75, -958, 3593, 29415, 1163, -518, 38, -40, 75, -955, 3580, 29418, 1173, -520, 38, -40, 74, -953, 3567, 29420, 1183, -521, 38, -41, 74, -951, 3554, 29423, 1193, -523, 38, -41, 74, -948, 3541, 29425, 1204, -525, 39, -41, 74, -946, 3528, 29428, 1214, -527, 39, -41, 74, -944, 3515, 29430, 1224, -529, 39, -41, 73, -941, 3502, 29432, 1235, -531, 39,
+ -41, 73, -939, 3489, 29435, 1245, -533, 39, -41, 73, -937, 3476, 29437, 1256, -535, 39, -41, 73, -935, 3463, 29439, 1266, -537, 39, -41, 72, -932, 3450, 29442, 1276, -539, 40, -41, 72, -930, 3437, 29444, 1287, -541, 40, -41, 72, -928, 3424, 29446, 1297, -542, 40, -41, 72, -925, 3411, 29448, 1308, -544, 40, -41, 72, -923, 3399, 29450, 1318, -546, 40,
+ -42, 71, -921, 3386, 29452, 1329, -548, 40, -42, 71, -919, 3373, 29455, 1339, -550, 40, -42, 71, -916, 3360, 29457, 1350, -552, 41, -42, 71, -914, 3347, 29459, 1360, -554, 41, -42, 71, -912, 3334, 29461, 1371, -556, 41, -42, 70, -909, 3322, 29463, 1381, -558, 41, -42, 70, -907, 3309, 29465, 1392, -560, 41, -42, 70, -905, 3296, 29467, 1403, -562, 41,
+ -42, 70, -903, 3283, 29469, 1413, -564, 42, -42, 70, -900, 3271, 29471, 1424, -566, 42, -42, 69, -898, 3258, 29473, 1434, -568, 42, -42, 69, -896, 3245, 29475, 1445, -570, 42, -42, 69, -894, 3232, 29476, 1456, -572, 42, -43, 69, -891, 3220, 29478, 1466, -574, 42, -43, 69, -889, 3207, 29480, 1477, -576, 42, -43, 68, -887, 3194, 29482, 1488, -578, 43,
+ -43, 68, -885, 3182, 29484, 1498, -579, 43, -43, 68, -882, 3169, 29485, 1509, -581, 43, -43, 68, -880, 3157, 29487, 1520, -583, 43, -43, 68, -878, 3144, 29489, 1531, -585, 43, -43, 67, -876, 3131, 29490, 1541, -587, 43, -43, 67, -873, 3119, 29492, 1552, -589, 43, -43, 67, -871, 3106, 29494, 1563, -591, 44, -43, 67, -869, 3094, 29495, 1574, -593, 44,
+ -43, 67, -867, 3081, 29497, 1585, -595, 44, -43, 66, -864, 3069, 29498, 1595, -597, 44, -44, 66, -862, 3056, 29500, 1606, -599, 44, -44, 66, -860, 3044, 29502, 1617, -601, 44, -44, 66, -858, 3031, 29503, 1628, -603, 45, -44, 66, -855, 3019, 29504, 1639, -605, 45, -44, 65, -853, 3006, 29506, 1650, -607, 45, -44, 65, -851, 2994, 29507, 1661, -609, 45,
+ -44, 65, -849, 2981, 29509, 1672, -611, 45, -44, 65, -846, 2969, 29510, 1683, -613, 45, -44, 65, -844, 2956, 29511, 1694, -615, 46, -44, 64, -842, 2944, 29513, 1705, -617, 46, -44, 64, -840, 2932, 29514, 1716, -619, 46, -44, 64, -838, 2919, 29515, 1727, -621, 46, -44, 64, -835, 2907, 29517, 1738, -623, 46, -45, 64, -833, 2895, 29518, 1749, -625, 46,
+ -45, 64, -831, 2882, 29519, 1760, -627, 47, -45, 63, -829, 2870, 29520, 1771, -629, 47, -45, 63, -826, 2858, 29521, 1782, -631, 47, -45, 63, -824, 2845, 29523, 1793, -633, 47, -45, 63, -822, 2833, 29524, 1804, -635, 47, -45, 63, -820, 2821, 29525, 1815, -638, 47, -45, 62, -818, 2808, 29526, 1826, -640, 47, -45, 62, -815, 2796, 29527, 1837, -642, 48,
+ -45, 62, -813, 2784, 29528, 1848, -644, 48, -45, 62, -811, 2772, 29529, 1860, -646, 48, -45, 62, -809, 2760, 29530, 1871, -648, 48, -45, 61, -807, 2747, 29531, 1882, -650, 48, -46, 61, -804, 2735, 29532, 1893, -652, 48, -46, 61, -802, 2723, 29533, 1904, -654, 49, -46, 61, -800, 2711, 29533, 1916, -656, 49, -46, 61, -798, 2699, 29534, 1927, -658, 49,
+ -46, 60, -796, 2687, 29535, 1938, -660, 49, -46, 60, -794, 2675, 29536, 1949, -662, 49, -46, 60, -791, 2662, 29537, 1961, -664, 49, -46, 60, -789, 2650, 29537, 1972, -666, 50, -46, 60, -787, 2638, 29538, 1983, -668, 50, -46, 60, -785, 2626, 29539, 1995, -670, 50, -46, 59, -783, 2614, 29540, 2006, -672, 50, -46, 59, -781, 2602, 29540, 2017, -674, 50,
+ -46, 59, -778, 2590, 29541, 2029, -677, 50, -47, 59, -776, 2578, 29542, 2040, -679, 51, -47, 59, -774, 2566, 29542, 2052, -681, 51, -47, 58, -772, 2554, 29543, 2063, -683, 51, -47, 58, -770, 2542, 29543, 2074, -685, 51, -47, 58, -768, 2530, 29544, 2086, -687, 51, -47, 58, -765, 2518, 29544, 2097, -689, 52, -47, 58, -763, 2506, 29545, 2109, -691, 52,
+ -47, 58, -761, 2494, 29545, 2120, -693, 52, -47, 57, -759, 2483, 29546, 2132, -695, 52, -47, 57, -757, 2471, 29546, 2143, -697, 52, -47, 57, -755, 2459, 29546, 2155, -699, 52, -47, 57, -752, 2447, 29547, 2166, -702, 53, -47, 57, -750, 2435, 29547, 2178, -704, 53, -47, 56, -748, 2423, 29547, 2189, -706, 53, -48, 56, -746, 2411, 29548, 2201, -708, 53,
+ -48, 56, -744, 2400, 29548, 2213, -710, 53, -48, 56, -742, 2388, 29548, 2224, -712, 53, -48, 56, -740, 2376, 29548, 2236, -714, 54, -48, 56, -738, 2364, 29549, 2247, -716, 54, -48, 55, -735, 2353, 29549, 2259, -718, 54, -48, 55, -733, 2341, 29549, 2271, -721, 54, -48, 55, -731, 2329, 29549, 2282, -723, 54, -48, 55, -729, 2317, 29549, 2294, -725, 54,
+ -48, 55, -727, 2306, 29549, 2306, -727, 55,
+};
+
diff --git a/src/include/slurp.h b/src/include/slurp.h
new file mode 100644
index 0000000..35f947e
--- /dev/null
+++ b/src/include/slurp.h
@@ -0,0 +1,81 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef SLURP_H
+#define SLURP_H
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "util.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <stdio.h>
+#include <stdint.h>
+#include <unistd.h>
+
+/* --------------------------------------------------------------------- */
+
+typedef struct _slurp_struct slurp_t;
+struct _slurp_struct {
+ size_t length;
+ uint8_t *data;
+ int extra;
+ void *bextra;
+ void (*closure)(slurp_t *);
+ /* for reading streams */
+ size_t pos;
+};
+
+/* --------------------------------------------------------------------- */
+
+/* slurp returns NULL and sets errno on error. 'buf' is only meaningful if you've already stat()'d
+the file; in most cases it can simply be NULL. If size is nonzero, it overrides the file's size as
+returned by stat -- this can be used to read only part of a file, or if the file size is known but
+a stat structure is not available. */
+slurp_t *slurp(const char *filename, struct stat *buf, size_t size);
+
+void unslurp(slurp_t * t);
+
+#ifdef WIN32
+int slurp_win32(slurp_t *useme, const char *filename, size_t st);
+#endif
+
+#if HAVE_MMAP
+int slurp_mmap(slurp_t *useme, const char *filename, size_t st);
+#endif
+
+/* stdio-style file processing */
+int slurp_seek(slurp_t *t, long offset, int whence); /* whence => SEEK_SET, SEEK_CUR, SEEK_END */
+long slurp_tell(slurp_t *t);
+#define slurp_rewind(t) slurp_seek((t), 0, SEEK_SET)
+
+size_t slurp_read(slurp_t *t, void *ptr, size_t count); /* i never realy liked fread */
+int slurp_getc(slurp_t *t); /* returns unsigned char cast to int, or EOF */
+int slurp_eof(slurp_t *t); /* 1 = end of file */
+
+#endif /* ! SLURP_H */
+
diff --git a/src/include/snd_fm.h b/src/include/snd_fm.h
new file mode 100644
index 0000000..c83b32d
--- /dev/null
+++ b/src/include/snd_fm.h
@@ -0,0 +1,201 @@
+#ifndef _BqtModplugSndFm
+#define _BqtModplugSndFm
+
+void Fmdrv_Init(int mixfreq);
+void Fmdrv_MixTo(int* buf, int count);
+
+void OPL_NoteOff(int c);
+void OPL_HertzTouch(int c, int Hertz, int keyoff); // also for pitch bending
+void OPL_Touch(int c, const unsigned char *D, unsigned Vol);
+void OPL_Pan(int c, signed char val);
+void OPL_Patch(int c, const unsigned char *D);
+void OPL_Reset(void);
+int OPL_Detect(void);
+void OPL_Close(void);
+
+/*************/
+
+/* 7.6.1999 01:51 / Bisqwit:
+ * The rest of this file is clipped from OSS/Free for Linux
+ */
+
+/*
+ * The OPL-3 mode is switched on by writing 0x01, to the offset 5
+ * of the right side.
+ *
+ * Another special register at the right side is at offset 4. It contains
+ * a bit mask defining which voices are used as 4 OP voices.
+ *
+ * The percussive mode is implemented in the left side only.
+ *
+ * With the above exceptions the both sides can be operated independently.
+ *
+ * A 4 OP voice can be created by setting the corresponding
+ * bit at offset 4 of the right side.
+ *
+ * For example setting the rightmost bit (0x01) changes the
+ * first voice on the right side to the 4 OP mode. The fourth
+ * voice is made inaccessible.
+ *
+ * If a voice is set to the 2 OP mode, it works like 2 OP modes
+ * of the original YM3812 (AdLib). In addition the voice can
+ * be connected the left, right or both stereo channels. It can
+ * even be left unconnected. This works with 4 OP voices also.
+ *
+ * The stereo connection bits are located in the FEEDBACK_CONNECTION
+ * register of the voice (0xC0-0xC8). In 4 OP voices these bits are
+ * in the second half of the voice.
+ */
+
+/*
+ * Register numbers for the global registers
+ */
+
+#define TEST_REGISTER 0x01
+#define ENABLE_WAVE_SELECT 0x20
+
+#define TIMER1_REGISTER 0x02
+#define TIMER2_REGISTER 0x03
+#define TIMER_CONTROL_REGISTER 0x04 /* Left side */
+#define IRQ_RESET 0x80
+#define TIMER1_MASK 0x40
+#define TIMER2_MASK 0x20
+#define TIMER1_START 0x01
+#define TIMER2_START 0x02
+
+#define CONNECTION_SELECT_REGISTER 0x04 /* Right side */
+#define RIGHT_4OP_0 0x01
+#define RIGHT_4OP_1 0x02
+#define RIGHT_4OP_2 0x04
+#define LEFT_4OP_0 0x08
+#define LEFT_4OP_1 0x10
+#define LEFT_4OP_2 0x20
+
+#define OPL3_MODE_REGISTER 0x05 /* Right side */
+#define OPL3_ENABLE 0x01
+#define OPL4_ENABLE 0x02
+
+#define KBD_SPLIT_REGISTER 0x08 /* Left side */
+#define COMPOSITE_SINE_WAVE_MODE 0x80 /* Don't use with OPL-3? */
+#define KEYBOARD_SPLIT 0x40
+
+#define PERCUSSION_REGISTER 0xbd /* Left side only */
+#define TREMOLO_DEPTH 0x80
+#define VIBRATO_DEPTH 0x40
+#define PERCOSSION_ENABLE 0x20
+#define BASSDRUM_ON 0x10
+#define SNAREDRUM_ON 0x08
+#define TOMTOM_ON 0x04
+#define CYMBAL_ON 0x02
+#define HIHAT_ON 0x01
+
+/*
+ * Offsets to the register banks for operators. To get the
+ * register number just add the operator offset to the bank offset
+ *
+ * AM/VIB/EG/KSR/Multiple (0x20 to 0x35)
+ */
+#define AM_VIB 0x20
+#define TREMOLO_ON 0x80
+#define VIBRATO_ON 0x40
+#define SUSTAIN_ON 0x20
+#define KSR 0x10 /* Key scaling rate */
+#define MULTIPLE_MASK 0x0f /* Frequency multiplier */
+
+ /*
+ * KSL/Total level (0x40 to 0x55)
+ */
+#define KSL_LEVEL 0x40
+#define KSL_MASK 0xc0 /* Envelope scaling bits */
+#define TOTAL_LEVEL_MASK 0x3f /* Strength (volume) of OP */
+
+/*
+ * Attack / Decay rate (0x60 to 0x75)
+ */
+#define ATTACK_DECAY 0x60
+#define ATTACK_MASK 0xf0
+#define DECAY_MASK 0x0f
+
+/*
+ * Sustain level / Release rate (0x80 to 0x95)
+ */
+#define SUSTAIN_RELEASE 0x80
+#define SUSTAIN_MASK 0xf0
+#define RELEASE_MASK 0x0f
+
+/*
+ * Wave select (0xE0 to 0xF5)
+ */
+#define WAVE_SELECT 0xe0
+
+/*
+ * Offsets to the register banks for voices. Just add to the
+ * voice number to get the register number.
+ *
+ * F-Number low bits (0xA0 to 0xA8).
+ */
+#define FNUM_LOW 0xa0
+
+/*
+ * F-number high bits / Key on / Block (octave) (0xB0 to 0xB8)
+ */
+#define KEYON_BLOCK 0xb0
+#define KEYON_BIT 0x20
+#define BLOCKNUM_MASK 0x1c
+#define FNUM_HIGH_MASK 0x03
+
+/*
+ * Feedback / Connection (0xc0 to 0xc8)
+ *
+ * These registers have two new bits when the OPL-3 mode
+ * is selected. These bits controls connecting the voice
+ * to the stereo channels. For 4 OP voices this bit is
+ * defined in the second half of the voice (add 3 to the
+ * register offset).
+ *
+ * For 4 OP voices the connection bit is used in the
+ * both halves (gives 4 ways to connect the operators).
+ */
+#define FEEDBACK_CONNECTION 0xc0
+#define FEEDBACK_MASK 0x0e /* Valid just for 1st OP of a voice */
+#define CONNECTION_BIT 0x01
+/*
+ * In the 4 OP mode there is four possible configurations how the
+ * operators can be connected together (in 2 OP modes there is just
+ * AM or FM). The 4 OP connection mode is defined by the rightmost
+ * bit of the FEEDBACK_CONNECTION (0xC0-0xC8) on the both halves.
+ *
+ * First half Second half Mode
+ *
+ * +---+
+ * v |
+ * 0 0 >+-1-+--2--3--4-->
+ *
+ *
+ *
+ * +---+
+ * | |
+ * 0 1 >+-1-+--2-+
+ * |->
+ * >--3----4-+
+ *
+ * +---+
+ * | |
+ * 1 0 >+-1-+-----+
+ * |->
+ * >--2--3--4-+
+ *
+ * +---+
+ * | |
+ * 1 1 >+-1-+--+
+ * |
+ * >--2--3-+->
+ * |
+ * >--4----+
+ */
+#define STEREO_BITS 0x30 /* OPL-3 only */
+#define VOICE_TO_LEFT 0x10
+#define VOICE_TO_RIGHT 0x20
+
+#endif
+
diff --git a/src/include/sndfile.h b/src/include/sndfile.h
new file mode 100644
index 0000000..22ce895
--- /dev/null
+++ b/src/include/sndfile.h
@@ -0,0 +1,708 @@
+/*
+ * This source code is public domain.
+ *
+ * Authors: Olivier Lapicque <olivierl@jps.net>,
+ * Adam Goode <adam@evdebs.org> (endian and char fixes for PPC)
+*/
+#ifndef __SNDFILE_H
+#define __SNDFILE_H
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define NEED_BYTESWAP
+#include "headers.h"
+
+#include "tables.h"
+
+
+#define MOD_AMIGAC2 0x1AB
+#define MAX_SAMPLE_LENGTH 16000000
+#define MAX_SAMPLE_RATE 192000
+#define MAX_ORDERS 256
+#define MAX_PATTERNS 240
+#define MAX_SAMPLES 236
+#define MAX_INSTRUMENTS MAX_SAMPLES
+#define MAX_VOICES 256
+#define MAX_CHANNELS 64
+#define MAX_ENVPOINTS 32
+#define MAX_INFONAME 80
+#define MAX_EQ_BANDS 6
+#define MAX_MESSAGE 8000
+
+#define MIXBUFFERSIZE 512
+
+
+#define CHN_16BIT 0x01 // 16-bit sample
+#define CHN_LOOP 0x02 // looped sample
+#define CHN_PINGPONGLOOP 0x04 // bi-directional (useless unless CHN_LOOP is also set)
+#define CHN_SUSTAINLOOP 0x08 // sample with sustain loop
+#define CHN_PINGPONGSUSTAIN 0x10 // bi-directional (useless unless CHN_SUSTAINLOOP is also set)
+#define CHN_PANNING 0x20 // sample with default panning set
+#define CHN_STEREO 0x40 // stereo sample
+#define CHN_PINGPONGFLAG 0x80 // when flag is on, sample is processed backwards
+#define CHN_MUTE 0x100 // muted channel
+#define CHN_KEYOFF 0x200 // exit sustain (note-off encountered)
+#define CHN_NOTEFADE 0x400 // fade note (~~~ or end of instrument envelope)
+#define CHN_SURROUND 0x800 // use surround channel (S91)
+#define CHN_NOIDO 0x1000 // near enough to an exact multiple of c5speed that interpolation
+ // won't be noticeable (or interpolation is disabled completely)
+#define CHN_HQSRC 0x2000 // ???
+#define CHN_FILTER 0x4000 // filtered output (i.e., Zxx)
+#define CHN_VOLUMERAMP 0x8000 // ramp volume
+#define CHN_VIBRATO 0x10000 // apply vibrato
+#define CHN_TREMOLO 0x20000 // apply tremolo
+//#define CHN_PANBRELLO 0x40000 // apply panbrello (handled elsewhere now)
+#define CHN_PORTAMENTO 0x80000 // apply portamento
+#define CHN_GLISSANDO 0x100000 // glissando mode ("stepped" pitch slides)
+#define CHN_VOLENV 0x200000 // volume envelope is active
+#define CHN_PANENV 0x400000 // pan envelope is active
+#define CHN_PITCHENV 0x800000 // pitch/filter envelope is active
+#define CHN_FASTVOLRAMP 0x1000000 // ramp volume very fast (XXX this is a dumb flag)
+//#define CHN_EXTRALOUD 0x2000000
+//#define CHN_REVERB 0x4000000
+//#define CHN_NOREVERB 0x8000000
+#define CHN_NNAMUTE 0x10000000 // turn off mute, but have it reset later
+#define CHN_ADLIB 0x20000000 // OPL mode
+
+#define CHN_SAMPLE_FLAGS (CHN_16BIT | CHN_LOOP | CHN_PINGPONGLOOP | CHN_SUSTAINLOOP \
+ | CHN_PINGPONGSUSTAIN | CHN_PANNING | CHN_STEREO | CHN_PINGPONGFLAG | CHN_ADLIB)
+
+
+#define ENV_VOLUME 0x0001
+#define ENV_VOLSUSTAIN 0x0002
+#define ENV_VOLLOOP 0x0004
+#define ENV_PANNING 0x0008
+#define ENV_PANSUSTAIN 0x0010
+#define ENV_PANLOOP 0x0020
+#define ENV_PITCH 0x0040
+#define ENV_PITCHSUSTAIN 0x0080
+#define ENV_PITCHLOOP 0x0100
+#define ENV_SETPANNING 0x0200
+#define ENV_FILTER 0x0400
+#define ENV_VOLCARRY 0x0800
+#define ENV_PANCARRY 0x1000
+#define ENV_PITCHCARRY 0x2000
+#define ENV_MUTE 0x4000
+
+#define FX_NONE 0 // .
+#define FX_ARPEGGIO 1 // J
+#define FX_PORTAMENTOUP 2 // F
+#define FX_PORTAMENTODOWN 3 // E
+#define FX_TONEPORTAMENTO 4 // G
+#define FX_VIBRATO 5 // H
+#define FX_TONEPORTAVOL 6 // L
+#define FX_VIBRATOVOL 7 // K
+#define FX_TREMOLO 8 // R
+#define FX_PANNING 9 // X
+#define FX_OFFSET 10 // O
+#define FX_VOLUMESLIDE 11 // D
+#define FX_POSITIONJUMP 12 // B
+#define FX_VOLUME 13 // ! (FT2/IMF Cxx)
+#define FX_PATTERNBREAK 14 // C
+#define FX_RETRIG 15 // Q
+#define FX_SPEED 16 // A
+#define FX_TEMPO 17 // T
+#define FX_TREMOR 18 // I
+#define FX_SPECIAL 20 // S
+#define FX_CHANNELVOLUME 21 // M
+#define FX_CHANNELVOLSLIDE 22 // N
+#define FX_GLOBALVOLUME 23 // V
+#define FX_GLOBALVOLSLIDE 24 // W
+#define FX_KEYOFF 25 // $ (FT2 Kxx)
+#define FX_FINEVIBRATO 26 // U
+#define FX_PANBRELLO 27 // Y
+#define FX_PANNINGSLIDE 29 // P
+#define FX_SETENVPOSITION 30 // & (FT2 Lxx)
+#define FX_MIDI 31 // Z
+#define FX_NOTESLIDEUP 32 // ( (IMF Gxy)
+#define FX_NOTESLIDEDOWN 33 // ) (IMF Hxy)
+#define FX_MAX 34
+#define FX_UNIMPLEMENTED FX_MAX // no-op, displayed as "?"
+
+#define FX_IS_EFFECT(v) ((v) > 0 && (v) < FX_MAX)
+
+// Volume Column commands
+#define VOLFX_NONE 0
+#define VOLFX_VOLUME 1
+#define VOLFX_PANNING 2
+#define VOLFX_VOLSLIDEUP 3 // C
+#define VOLFX_VOLSLIDEDOWN 4 // D
+#define VOLFX_FINEVOLUP 5 // A
+#define VOLFX_FINEVOLDOWN 6 // B
+#define VOLFX_VIBRATOSPEED 7 // $ (FT2 Ax)
+#define VOLFX_VIBRATODEPTH 8 // H
+#define VOLFX_PANSLIDELEFT 9 // < (FT2 Dx)
+#define VOLFX_PANSLIDERIGHT 10 // > (FT2 Ex)
+#define VOLFX_TONEPORTAMENTO 11 // G
+#define VOLFX_PORTAUP 12 // F
+#define VOLFX_PORTADOWN 13 // E
+
+// orderlist
+#define ORDER_SKIP 254 // +++
+#define ORDER_LAST 255 // ---
+
+// 'Special' notes
+// Note fade IS actually supported in Impulse Tracker, but there's no way to handle it in the editor
+// (Actually, any non-valid note is handled internally as a note fade, but it's good to have a single
+// value for internal representation)
+// update 20090805: ok just discovered that IT internally uses 253 for its "no note" value.
+// guess we'll use a different value for fade!
+// note: 246 is rather arbitrary, but IT conveniently displays this value as "F#D" ("FD" with 2-char notes)
+#define NOTE_NONE 0 // ...
+#define NOTE_FIRST 1 // C-0
+#define NOTE_MIDC 61 // C-5
+#define NOTE_LAST 120 // B-9
+#define NOTE_FADE 246 // ~~~
+#define NOTE_CUT 254 // ^^^
+#define NOTE_OFF 255 // ===
+#define NOTE_IS_NOTE(n) ((n) > NOTE_NONE && (n) <= NOTE_LAST) // anything playable - C-0 to B-9
+#define NOTE_IS_CONTROL(n) ((n) > NOTE_LAST) // not a note, but non-empty
+#define NOTE_IS_INVALID(n) ((n) > NOTE_LAST && (n) < NOTE_CUT && (n) != NOTE_FADE) // ???
+
+// Auto-vibrato types
+#define VIB_SINE 0
+#define VIB_RAMP_DOWN 1
+#define VIB_SQUARE 2
+#define VIB_RANDOM 3
+
+// NNA types
+#define NNA_NOTECUT 0
+#define NNA_CONTINUE 1
+#define NNA_NOTEOFF 2
+#define NNA_NOTEFADE 3
+
+// DCT types
+#define DCT_NONE 0
+#define DCT_NOTE 1
+#define DCT_SAMPLE 2
+#define DCT_INSTRUMENT 3
+
+// DCA types
+#define DCA_NOTECUT 0
+#define DCA_NOTEOFF 1
+#define DCA_NOTEFADE 2
+
+// Nothing innately special about this -- just needs to be above the max pattern length.
+// process row is set to this in order to get the player to jump to the end of the pattern.
+// (See ITTECH.TXT)
+#define PROCESS_NEXT_ORDER 0xFFFE
+
+// Module flags
+#define SONG_EMBEDMIDICFG 0x0001 // Embed MIDI macros (Shift-F1) in file
+//#define SONG_FASTVOLSLIDES 0x0002
+#define SONG_ITOLDEFFECTS 0x0004 // Old Impulse Tracker effect implementations
+#define SONG_COMPATGXX 0x0008 // "Compatible Gxx" (handle portamento more like other trackers)
+#define SONG_LINEARSLIDES 0x0010 // Linear slides vs. Amiga slides
+#define SONG_PATTERNPLAYBACK 0x0020 // Only playing current pattern
+//#define SONG_STEP 0x0040
+#define SONG_PAUSED 0x0080 // Playback paused (Shift-F8)
+//#define SONG_FADINGSONG 0x0100
+#define SONG_ENDREACHED 0x0200 // Song is finished (standalone keyjazz mode)
+//#define SONG_GLOBALFADE 0x0400
+//#define SONG_CPUVERYHIGH 0x0800
+#define SONG_FIRSTTICK 0x1000 // Current tick is the first tick of the row (dopey flow-control flag)
+//#define SONG_MPTFILTERMODE 0x2000
+//#define SONG_SURROUNDPAN 0x4000
+//#define SONG_EXFILTERRANGE 0x8000
+//#define SONG_AMIGALIMITS 0x10000
+#define SONG_INSTRUMENTMODE 0x20000 // Process instruments
+#define SONG_ORDERLOCKED 0x40000 // Don't advance orderlist *(Alt-F11)
+#define SONG_NOSTEREO 0x80000 // secret code for "mono"
+#define SONG_PATTERNLOOP (SONG_PATTERNPLAYBACK | SONG_ORDERLOCKED) // Loop current pattern (F6)
+
+// Global Options (Renderer)
+#define SNDMIX_REVERSESTEREO 0x0001 // swap L/R audio channels
+//#define SNDMIX_NOISEREDUCTION 0x0002 // reduce hiss (do not use, it's just a simple low-pass filter)
+//#define SNDMIX_AGC 0x0004 // automatic gain control
+#define SNDMIX_NORESAMPLING 0x0008 // force no resampling (uninterpolated)
+#define SNDMIX_HQRESAMPLER 0x0010 // cubic resampling
+//#define SNDMIX_MEGABASS 0x0020
+//#define SNDMIX_SURROUND 0x0040
+//#define SNDMIX_REVERB 0x0080
+//#define SNDMIX_EQ 0x0100 // apply EQ (always on)
+//#define SNDMIX_SOFTPANNING 0x0200
+#define SNDMIX_ULTRAHQSRCMODE 0x0400 // polyphase resampling (or FIR? I don't know)
+// Misc Flags (can safely be turned on or off)
+#define SNDMIX_DIRECTTODISK 0x10000 // disk writer mode
+#define SNDMIX_NOBACKWARDJUMPS 0x40000 // disallow Bxx jumps from going backward in the orderlist
+//#define SNDMIX_MAXDEFAULTPAN 0x80000 // (no longer) Used by the MOD loader
+#define SNDMIX_MUTECHNMODE 0x100000 // Notes are not played on muted channels
+#define SNDMIX_NOSURROUND 0x200000 // ignore S91
+//#define SNDMIX_NOMIXING 0x400000
+#define SNDMIX_NORAMPING 0x800000 // don't apply ramping on volume change (causes clicks)
+
+enum {
+ SRCMODE_NEAREST,
+ SRCMODE_LINEAR,
+ SRCMODE_SPLINE,
+ SRCMODE_POLYPHASE,
+ NUM_SRC_MODES
+};
+
+// ------------------------------------------------------------------------------------------------------------
+// Flags for csf_read_sample
+
+// Sample data characteristics
+// Note:
+// - None of these constants are zero
+// - The format specifier must have a value set for each "section"
+// - csf_read_sample DOES check the values for validity
+
+// Bit width (8 bits for simplicity)
+#define _SDV_BIT(n) ((n) << 0)
+#define SF_BIT_MASK 0xff
+#define SF_7 _SDV_BIT(7) // 7-bit (weird!)
+#define SF_8 _SDV_BIT(8) // 8-bit
+#define SF_16 _SDV_BIT(16) // 16-bit
+#define SF_24 _SDV_BIT(24) // 24-bit
+#define SF_32 _SDV_BIT(32) // 32-bit
+
+// Channels (4 bits)
+#define _SDV_CHN(n) ((n) << 8)
+#define SF_CHN_MASK 0xf00
+#define SF_M _SDV_CHN(1) // mono
+#define SF_SI _SDV_CHN(2) // stereo, interleaved
+#define SF_SS _SDV_CHN(3) // stereo, split
+
+// Endianness (4 bits)
+#define _SDV_END(n) ((n) << 12)
+#define SF_END_MASK 0xf000
+#define SF_LE _SDV_END(1) // little-endian
+#define SF_BE _SDV_END(2) // big-endian
+
+// Encoding (8 bits)
+#define _SDV_ENC(n) ((n) << 16)
+#define SF_ENC_MASK 0xff0000
+#define SF_PCMS _SDV_ENC(1) // PCM, signed
+#define SF_PCMU _SDV_ENC(2) // PCM, unsigned
+#define SF_PCMD _SDV_ENC(3) // PCM, delta-encoded
+#define SF_IT214 _SDV_ENC(4) // Impulse Tracker 2.14 compressed
+#define SF_IT215 _SDV_ENC(5) // Impulse Tracker 2.15 compressed
+#define SF_AMS _SDV_ENC(6) // AMS / Velvet Studio packed
+#define SF_DMF _SDV_ENC(7) // DMF Huffman compression
+#define SF_MDL _SDV_ENC(8) // MDL Huffman compression
+#define SF_PTM _SDV_ENC(9) // PTM 8-bit delta value -> 16-bit sample
+
+// Sample format shortcut
+#define SF(a,b,c,d) (SF_ ## a | SF_ ## b| SF_ ## c | SF_ ## d)
+
+// Deprecated constants
+#define RS_AMS16 SF(AMS,16,M,LE)
+#define RS_AMS8 SF(AMS,8,M,LE)
+#define RS_DMF16 SF(DMF,16,M,LE)
+#define RS_DMF8 SF(DMF,8,M,LE)
+#define RS_IT21416 SF(IT214,16,M,LE)
+#define RS_IT2148 SF(IT214,8,M,LE)
+#define RS_IT21516 SF(IT215,16,M,LE)
+#define RS_IT2158 SF(IT215,8,M,LE)
+#define RS_IT21416S SF(IT214,16,SS,LE)
+#define RS_IT2148S SF(IT214,8,SS,LE)
+#define RS_IT21516S SF(IT215,16,SS,LE)
+#define RS_IT2158S SF(IT215,8,SS,LE)
+#define RS_MDL16 SF(MDL,16,M,LE)
+#define RS_MDL8 SF(MDL,8,M,LE)
+#define RS_PCM16D SF(PCMD,16,M,LE)
+#define RS_PCM16M SF(PCMS,16,M,BE)
+#define RS_PCM16S SF(PCMS,16,M,LE)
+#define RS_PCM16U SF(PCMU,16,M,LE)
+#define RS_PCM24S SF(PCMS,24,M,LE)
+#define RS_PCM32S SF(PCMS,32,M,LE)
+#define RS_PCM8D SF(PCMD,8,M,LE)
+#define RS_PCM8S SF(PCMS,8,M,LE)
+#define RS_PCM8U SF(PCMU,8,M,LE)
+#define RS_PTM8DTO16 SF(PTM,16,M,LE)
+#define RS_STIPCM16M SF(PCMS,16,SI,BE)
+#define RS_STIPCM16S SF(PCMS,16,SI,LE)
+#define RS_STIPCM16U SF(PCMU,16,SI,LE)
+#define RS_STIPCM24S SF(PCMS,24,SI,LE)
+#define RS_STIPCM32S SF(PCMS,32,SI,LE)
+#define RS_STIPCM8S SF(PCMS,8,SI,LE)
+#define RS_STIPCM8U SF(PCMU,8,SI,LE)
+#define RS_STPCM16D SF(PCMD,16,SS,LE)
+#define RS_STPCM16M SF(PCMS,16,SS,BE)
+#define RS_STPCM16S SF(PCMS,16,SS,LE)
+#define RS_STPCM16U SF(PCMU,16,SS,LE)
+#define RS_STPCM8D SF(PCMD,8,SS,LE)
+#define RS_STPCM8S SF(PCMS,8,SS,LE)
+#define RS_STPCM8U SF(PCMU,8,SS,LE)
+
+// ------------------------------------------------------------------------------------------------------------
+
+typedef struct song_sample {
+ uint32_t length;
+ uint32_t loop_start;
+ uint32_t loop_end;
+ uint32_t sustain_start;
+ uint32_t sustain_end;
+ signed char *data;
+ uint32_t c5speed;
+ uint32_t panning;
+ uint32_t volume;
+ uint32_t global_volume;
+ uint32_t flags;
+ uint32_t vib_type;
+ uint32_t vib_rate;
+ uint32_t vib_depth;
+ uint32_t vib_speed;
+ char name[32];
+ char filename[22];
+ int played; // for note playback dots
+ uint32_t globalvol_saved; // for muting individual samples
+
+ // This must be 12-bytes to work around a bug in some gcc4.2s (XXX why? what bug?)
+ unsigned char adlib_bytes[12];
+} song_sample_t;
+
+typedef struct song_envelope {
+ int ticks[32];
+ uint8_t values[32];
+ int nodes;
+ int loop_start;
+ int loop_end;
+ int sustain_start;
+ int sustain_end;
+} song_envelope_t;
+
+typedef struct song_instrument {
+ uint32_t fadeout;
+ uint32_t flags;
+ unsigned int global_volume;
+ unsigned int panning;
+ uint8_t sample_map[128];
+ uint8_t note_map[128];
+ song_envelope_t vol_env;
+ song_envelope_t pan_env;
+ song_envelope_t pitch_env;
+ unsigned int nna;
+ unsigned int dct;
+ unsigned int dca;
+ unsigned int pan_swing;
+ unsigned int vol_swing;
+ unsigned int ifc;
+ unsigned int ifr;
+ int midi_bank; // TODO split this?
+ int midi_program;
+ unsigned int midi_channel_mask; // FIXME why is this a mask? why is a mask useful? does 2.15 use a mask?
+ int pitch_pan_separation;
+ unsigned int pitch_pan_center;
+ char name[32];
+ char filename[16];
+ int played; // for note playback dots
+} song_instrument_t;
+
+// (TODO write decent descriptions of what the various volume
+// variables are used for - are all of them *really* necessary?)
+// (TODO also the majority of this is irrelevant outside of the "main" 64 channels;
+// this struct should really only be holding the stuff actually needed for mixing)
+typedef struct song_voice {
+ // First 32-bytes: Most used mixing information: don't change it
+ signed char * current_sample_data;
+ uint32_t position; // sample position, fixed-point -- integer part
+ uint32_t position_frac; // fractional part
+ int32_t increment; // 16.16 fixed point, how much to add to position per sample-frame of output
+ int32_t right_volume; // ?
+ int32_t left_volume; // ?
+ int32_t right_ramp; // ?
+ int32_t left_ramp; // ?
+ // 2nd cache line
+ uint32_t length; // only to the end of the loop
+ uint32_t flags;
+ uint32_t loop_start; // loop or sustain, whichever is active
+ uint32_t loop_end;
+ int32_t right_ramp_volume; // ?
+ int32_t left_ramp_volume; // ?
+ int32_t strike; // decremented to zero. this affects how long the initial hit on the playback marks lasts (bigger dot in instrument and sample list windows)
+
+ int32_t filter_y1, filter_y2, filter_y3, filter_y4;
+ int32_t filter_a0, filter_b0, filter_b1;
+
+ int32_t rofs, lofs; // ?
+ int32_t ramp_length;
+ // Information not used in the mixer
+ int32_t right_volume_new, left_volume_new; // ?
+ int32_t final_volume; // range 0-16384 (?), accounting for sample+channel+global+etc. volumes
+ int32_t final_panning; // range 0-256 (but can temporarily exceed that range during calculations)
+ int32_t volume, panning; // range 0-256 (?); these are the current values set for the channel
+ int32_t fadeout_volume;
+ int32_t period;
+ int32_t c5speed;
+ int32_t sample_freq; // only used on the info page (F5)
+ int32_t portamento_target;
+ song_instrument_t *ptr_instrument; // these two suck, and should
+ song_sample_t *ptr_sample; // be replaced with numbers
+ int vol_env_position;
+ int pan_env_position;
+ int pitch_env_position;
+ uint32_t master_channel; // nonzero = background/NNA voice, indicates what channel it "came from"
+ uint32_t vu_meter;
+ int32_t global_volume;
+ int32_t instrument_volume;
+ int32_t autovib_depth;
+ uint32_t autovib_position, vibrato_position, tremolo_position, panbrello_position;
+ // 16-bit members
+ int vol_swing, pan_swing;
+
+ // formally 8-bit members
+ unsigned int note; // the note that's playing
+ unsigned int nna;
+ unsigned int new_note, new_instrument; // ?
+ // Effect memory and handling
+ unsigned int n_command; // This sucks and needs to go away (dumb "flag" for arpeggio / tremor)
+ unsigned int mem_vc_volslide; // Ax Bx Cx Dx (volume column)
+ unsigned int mem_arpeggio; // Axx
+ unsigned int mem_volslide; // Dxx
+ unsigned int mem_pitchslide; // Exx Fxx (and Gxx maybe)
+ int32_t mem_portanote; // Gxx (synced with mem_pitchslide if compat gxx is set)
+ unsigned int mem_tremor; // Ixx
+ unsigned int mem_channel_volslide; // Nxx
+ unsigned int mem_offset; // final, combined yxx00h from Oxx and SAy
+ unsigned int mem_panslide; // Pxx
+ unsigned int mem_retrig; // Qxx
+ unsigned int mem_special; // Sxx
+ unsigned int mem_tempo; // Txx
+ unsigned int mem_global_volslide; // Wxx
+ unsigned int note_slide_counter, note_slide_speed, note_slide_step; // IMF effect
+ unsigned int vib_type, vibrato_speed, vibrato_depth;
+ unsigned int tremolo_type, tremolo_speed, tremolo_depth;
+ unsigned int panbrello_type, panbrello_speed, panbrello_depth;
+ int tremolo_delta, panbrello_delta;
+
+ unsigned int cutoff;
+ unsigned int resonance;
+ int cd_note_delay; // countdown: note starts when this hits zero
+ int cd_note_cut; // countdown: note stops when this hits zero
+ int cd_retrig; // countdown: note retrigs when this hits zero
+ unsigned int cd_tremor; // (weird) countdown + flag: see snd_fx.c and sndmix.c
+ unsigned int patloop_row; // row number that SB0 was on
+ unsigned int cd_patloop; // countdown: pattern loops back when this hits zero
+
+ unsigned int row_note, row_instr;
+ unsigned int row_voleffect, row_volparam;
+ unsigned int row_effect, row_param;
+ unsigned int active_macro, last_instrument;
+} song_voice_t;
+
+typedef struct song_channel {
+ uint32_t panning;
+ uint32_t volume;
+ uint32_t flags;
+} song_channel_t;
+
+typedef struct song_note {
+ uint8_t note;
+ uint8_t instrument;
+ uint8_t voleffect;
+ uint8_t volparam;
+ uint8_t effect;
+ uint8_t param;
+} song_note_t;
+
+////////////////////////////////////////////////////////////////////
+
+typedef struct {
+ char start[32];
+ char stop[32];
+ char tick[32];
+ char note_on[32];
+ char note_off[32];
+ char set_volume[32];
+ char set_panning[32];
+ char set_bank[32];
+ char set_program[32];
+ char sfx[16][32];
+ char zxx[128][32];
+} midi_config_t;
+
+extern midi_config_t default_midi_config;
+
+
+extern uint32_t max_voices;
+extern uint32_t global_vu_left, global_vu_right;
+
+extern const song_note_t blank_pattern[64 * 64];
+extern const song_note_t *blank_note;
+
+
+struct multi_write {
+ int used;
+ void *data;
+ /* Conveniently, this has the same prototype as disko_write :) */
+ void (*write)(void *data, const uint8_t *buf, size_t bytes);
+ /* this is optimization for channels that haven't had any data yet
+ (nothing to convert/write, just seek ahead in the data stream) */
+ void (*silence)(void *data, long bytes);
+ int buffer[MIXBUFFERSIZE * 2];
+};
+
+typedef struct song {
+ int mix_buffer[MIXBUFFERSIZE * 2];
+ float mix_buffer_float[MIXBUFFERSIZE * 2]; // is this needed?
+
+ song_voice_t voices[MAX_VOICES]; // Channels
+ uint32_t voice_mix[MAX_VOICES]; // Channels to be mixed
+ song_sample_t samples[MAX_SAMPLES+1]; // Samples (1-based!)
+ song_instrument_t *instruments[MAX_INSTRUMENTS+1]; // Instruments (1-based!)
+ song_channel_t channels[MAX_CHANNELS]; // Channel settings
+ song_note_t *patterns[MAX_PATTERNS]; // Patterns
+ uint16_t pattern_size[MAX_PATTERNS]; // Pattern Lengths
+ uint16_t pattern_alloc_size[MAX_PATTERNS]; // Allocated lengths (for async. resizing/playback)
+ uint8_t orderlist[MAX_ORDERS + 1]; // Pattern Orders
+ midi_config_t midi_config; // Midi macro config table
+ uint32_t initial_speed;
+ uint32_t initial_tempo;
+ uint32_t initial_global_volume;
+ uint32_t flags; // Song flags SONG_XXXX
+ uint32_t pan_separation;
+ uint32_t num_voices; // how many are currently playing. (POTENTIALLY larger than global max_voices)
+ uint32_t mix_stat; // number of channels being mixed (not really used)
+ uint32_t buffer_count; // number of samples to mix per tick
+ uint32_t tick_count;
+ int32_t row_count; /* IMPORTANT needs to be signed */
+ uint32_t current_speed;
+ uint32_t current_tempo;
+ uint32_t process_row;
+ uint32_t row; // no analogue in pm.h? should be either renamed or factored out.
+ uint32_t break_row;
+ uint32_t current_pattern;
+ uint32_t current_order;
+ uint32_t process_order;
+ uint32_t current_global_volume;
+ uint32_t mixing_volume;
+ uint32_t freq_factor; // not used -- for tweaking the song speed LP-style (interesting!)
+ uint32_t tempo_factor; // ditto
+ int32_t repeat_count; // 0 = first playback, etc. (note: set to -1 to stop instead of looping)
+ uint8_t row_highlight_major;
+ uint8_t row_highlight_minor;
+ char message[MAX_MESSAGE + 1];
+ char title[32];
+ char tracker_id[32]; // irrelevant to the song, just used by some loaders (fingerprint)
+
+ // These store the existing IT save history from prior editing sessions.
+ // Current session data is added at save time, and is NOT a part of histdata.
+ int histlen; // How many session history data entries exist (each entry is eight bytes)
+ uint8_t *histdata; // Preserved entries from prior sessions, might be NULL if histlen = 0
+ struct timeval editstart; // When the song was loaded
+
+ // mixer stuff
+ uint32_t mix_flags; // SNDMIX_*
+ uint32_t mix_frequency, mix_bits_per_sample, mix_channels;
+
+ // noise reduction filter
+ int32_t left_nr, right_nr;
+
+ // chaseback
+ int stop_at_order;
+ int stop_at_row;
+ unsigned int stop_at_time;
+
+ // multi-write stuff -- NULL if no multi-write is in progress, else array of one struct per channel
+ struct multi_write *multi_write;
+} song_t;
+
+song_note_t *csf_allocate_pattern(uint32_t rows);
+void csf_free_pattern(void *pat);
+signed char *csf_allocate_sample(uint32_t nbytes);
+void csf_free_sample(void *p);
+song_instrument_t *csf_allocate_instrument(void);
+void csf_init_instrument(song_instrument_t *ins, int samp);
+void csf_free_instrument(song_instrument_t *p);
+
+uint32_t csf_read_sample(song_sample_t *sample, uint32_t flags, const void *filedata, uint32_t datalength);
+void csf_adjust_sample_loop(song_sample_t *sample);
+
+extern void (*csf_midi_out_note)(int chan, const song_note_t *m);
+extern void (*csf_midi_out_raw)(const unsigned char *, unsigned int, unsigned int);
+
+void csf_import_s3m_effect(song_note_t *m, int it);
+
+
+// counting stuff
+
+int csf_note_is_empty(song_note_t *note);
+int csf_pattern_is_empty(song_t *csf, int n);
+int csf_sample_is_empty(song_sample_t *smp);
+int csf_instrument_is_empty(song_instrument_t *ins);
+int csf_last_order(song_t *csf); // last order of "main" song (IT-style, only for display)
+int csf_get_num_orders(song_t *csf); // last non-blank order (for saving)
+int csf_get_num_patterns(song_t *csf);
+int csf_get_num_samples(song_t *csf);
+int csf_get_num_instruments(song_t *csf);
+
+// for these, 'start' indicates minimum sample/instrument to check
+int csf_first_blank_sample(song_t *csf, int start);
+int csf_first_blank_instrument(song_t *csf, int start);
+
+
+
+int csf_set_wave_config(song_t *csf, uint32_t rate, uint32_t bits, uint32_t channels);
+
+// Mixer Config
+int csf_init_player(song_t *csf, int reset); // bReset=false
+int csf_set_resampling_mode(song_t *csf, uint32_t mode); // SRCMODE_XXXX
+
+
+// sndmix
+unsigned int csf_read(song_t *csf, void *v_buffer, unsigned int bufsize);
+int csf_process_tick(song_t *csf);
+int csf_read_note(song_t *csf);
+
+// snd_fx
+unsigned int csf_get_length(song_t *csf); // (in seconds)
+void csf_instrument_change(song_t *csf, song_voice_t *chn, uint32_t instr, int porta, int instr_column);
+void csf_note_change(song_t *csf, uint32_t chan, int note, int porta, int retrig, int have_inst);
+uint32_t csf_get_nna_channel(song_t *csf, uint32_t chan);
+void csf_check_nna(song_t *csf, uint32_t chan, uint32_t instr, int note, int force_cut);
+void csf_process_effects(song_t *csf, int firsttick);
+
+void fx_note_cut(song_t *csf, uint32_t chan, int clear_note);
+void fx_key_off(song_t *csf, uint32_t chan);
+void csf_midi_send(song_t *csf, const unsigned char *data, unsigned int len, uint32_t chan, int fake);
+void csf_process_midi_macro(song_t *csf, uint32_t chan, const char *midi_macro, uint32_t param,
+ uint32_t note, uint32_t velocity, uint32_t use_instr);
+song_sample_t *csf_translate_keyboard(song_t *csf, song_instrument_t *ins, uint32_t note, song_sample_t *def);
+
+// various utility functions in snd_fx.c
+int get_note_from_period(int period);
+int get_period_from_note(int note, unsigned int c5speed, int linear);
+unsigned int get_freq_from_period(int period, int linear);
+unsigned int transpose_to_frequency(int transp, int ftune);
+int frequency_to_transpose(unsigned int freq);
+unsigned long calc_halftone(unsigned long hz, int rel);
+
+
+// sndfile
+song_t *csf_allocate(void);
+void csf_free(song_t *csf);
+
+void csf_destroy(song_t *csf); /* erase everything -- equiv. to new song */
+
+void csf_reset_midi_cfg(song_t *csf);
+void csf_copy_midi_cfg(song_t *dest, song_t *src);
+void csf_set_current_order(song_t *csf, uint32_t position);
+void csf_reset_playmarks(song_t *csf);
+
+void csf_forget_history(song_t *csf); // Send the edit log down the memory hole.
+
+/* apply a preset Adlib patch */
+void adlib_patch_apply(song_sample_t *smp, int patchnum);
+
+///////////////////////////////////////////////////////////
+
+// Return (a*b)/c - no divide error
+static inline int _muldiv(int a, int b, int c)
+{
+ return ((unsigned long long) a * (unsigned long long) b ) / c;
+}
+
+
+// Return (a*b+c/2)/c - no divide error
+static inline int _muldivr(int a, int b, int c)
+{
+ return ((unsigned long long) a * (unsigned long long) b + (c >> 1)) / c;
+}
+
+
+#endif
+
diff --git a/src/include/tables.h b/src/include/tables.h
new file mode 100644
index 0000000..5bac1d7
--- /dev/null
+++ b/src/include/tables.h
@@ -0,0 +1,56 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef TABLES_H
+#define TABLES_H
+
+#include <stdint.h>
+
+// <eightbitbubsy> better than having a table.
+#define SHORT_PANNING(i) (((((i) << 4) | (i)) + 2) >> 2)
+
+/* TODO: I know just sticking _fast on all of these will break the player, but for some of 'em...? */
+
+extern const uint8_t vc_portamento_table[16]; // volume column Gx
+
+extern const uint16_t period_table[12];
+extern const uint16_t finetune_table[16];
+
+extern const int8_t sine_table[256];
+extern const int8_t ramp_down_table[256];
+extern const int8_t square_table[256];
+
+extern const int8_t retrig_table_1[16];
+extern const int8_t retrig_table_2[16];
+
+extern const uint32_t fine_linear_slide_up_table[16];
+extern const uint32_t fine_linear_slide_down_table[16];
+extern const uint32_t linear_slide_up_table[256];
+extern const uint32_t linear_slide_down_table[256];
+
+extern const char *midi_group_names[17];
+extern const char *midi_program_names[128];
+extern const char *midi_percussion_names[61];
+
+#endif /* ! TABLES_H */
+
diff --git a/src/include/util.h b/src/include/util.h
new file mode 100644
index 0000000..9a4024b
--- /dev/null
+++ b/src/include/util.h
@@ -0,0 +1,200 @@
+/*
+ * Schism Tracker - a cross-platform Impulse Tracker clone
+ * copyright (c) 2003-2005 Storlek <storlek@rigelseven.com>
+ * copyright (c) 2005-2008 Mrs. Brisby <mrs.brisby@nimh.org>
+ * copyright (c) 2009 Storlek & Mrs. Brisby
+ * copyright (c) 2010-2012 Storlek
+ * URL: http://schismtracker.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef UTIL_H
+#define UTIL_H
+
+#include <sys/stat.h> /* roundabout way to get time_t */
+#include <sys/types.h>
+
+/* --------------------------------------------------------------------- */
+
+#define ARRAY_SIZE(a) ((signed)(sizeof(a)/sizeof(*(a))))
+
+
+/* macros stolen from glib */
+#ifndef MAX
+# define MAX(X,Y) (((X)>(Y))?(X):(Y))
+#endif
+#ifndef MIN
+# define MIN(X,Y) (((X)<(Y))?(X):(Y))
+#endif
+#ifndef CLAMP
+# define CLAMP(N,L,H) (((N)>(H))?(H):(((N)<(L))?(L):(N)))
+#endif
+
+#ifdef __GNUC__
+# ifndef LIKELY
+# define LIKELY(x) __builtin_expect(!!(x),1)
+# endif
+# ifndef UNLIKELY
+# define UNLIKELY(x) __builtin_expect(!!(x),0)
+# endif
+# ifndef UNUSED
+# define UNUSED __attribute__((unused))
+# endif
+# ifndef NORETURN
+# define NORETURN __attribute__((noreturn))
+# endif
+# ifndef PACKED
+# define PACKED __attribute__((packed))
+# endif
+# ifndef MALLOC
+# define MALLOC __attribute__ ((malloc))
+# endif
+#else
+# ifndef UNUSED
+# define UNUSED
+# endif
+# ifndef PACKED
+# define PACKED
+# endif
+# ifndef NORETURN
+# define NORETURN
+# endif
+# ifndef LIKELY
+# define LIKELY(x)
+# endif
+# ifndef UNLIKELY
+# define UNLIKELY(x)
+# endif
+# ifndef MALLOC
+# define MALLOC
+# endif
+#endif
+
+/* Path stuff that differs by platform */
+#ifdef WIN32
+# define DIR_SEPARATOR '\\'
+# define DIR_SEPARATOR_STR "\\"
+# define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\')
+#else
+# define DIR_SEPARATOR '/'
+# define DIR_SEPARATOR_STR "/"
+# define IS_DIR_SEPARATOR(c) ((c) == '/')
+#endif
+
+/* --------------------------------------------------------------------- */
+/* functions returning const char * use a static buffer; ones returning char * malloc their return value
+(thus it needs free'd)... except numtostr, get_time_string, and get_date_string, which return the buffer
+passed to them in the 'buf' parameter. */
+
+/* memory */
+extern MALLOC void *mem_alloc(size_t);
+extern MALLOC char *str_dup(const char *);
+extern void *mem_realloc(void *,size_t);
+extern void mem_free(void *);
+
+/*Conversion*/
+/* linear -> deciBell*/
+/* amplitude normalized to 1.0f.*/
+extern float dB(float amplitude);
+
+/// deciBell -> linear*/
+extern float dB2_amp(float db);
+
+/* linear -> deciBell*/
+/* power normalized to 1.0f.*/
+extern float pdB(float power);
+
+/* deciBell -> linear*/
+extern float dB2_power(float db);
+
+/* linear -> deciBell*/
+/* amplitude normalized to 1.0f.*/
+/* Output scaled (and clipped) to 128 lines with noisefloor range.*/
+/* ([0..128] = [-noisefloor..0dB])*/
+/* correction_dBs corrects the dB after converted, but before scaling.*/
+extern short dB_s(int noisefloor, float amplitude, float correction_dBs);
+
+/* deciBell -> linear*/
+/* Input scaled to 128 lines with noisefloor range.*/
+/* ([0..128] = [-noisefloor..0dB])*/
+/* amplitude normalized to 1.0f.*/
+/* correction_dBs corrects the dB after converted, but before scaling.*/
+extern short dB2_amp_s(int noisefloor, int db, float correction_dBs);
+
+/* linear -> deciBell*/
+/* power normalized to 1.0f.*/
+/* Output scaled (and clipped) to 128 lines with noisefloor range.*/
+/* ([0..128] = [-noisefloor..0dB])*/
+/* correction_dBs corrects the dB after converted, but before scaling.*/
+extern short pdB_s(int noisefloor, float power, float correction_dBs);
+
+/* deciBell -> linear*/
+/* Input scaled to 128 lines with noisefloor range.*/
+/* ([0..128] = [-noisefloor..0dB])*/
+/* power normalized to 1.0f.*/
+/* correction_dBs corrects the dB after converted, but before scaling.*/
+extern short dB2_power_s(int noisefloor, int db, float correction_dBs);
+
+/* formatting */
+/* for get_{time,date}_string, buf should be (at least) 27 chars; anything past that isn't used. */
+char *get_date_string(time_t when, char *buf);
+char *get_time_string(time_t when, char *buf);
+char *numtostr(int digits, unsigned int n, char *buf);
+char *numtostr_signed(int digits, int n, char *buf);
+char *num99tostr(int n, char *buf);
+
+/* string handling */
+const char *get_basename(const char *filename);
+const char *get_extension(const char *filename); // including dot; "" if no extension (note: used to strip dot)
+char *get_parent_directory(const char *dirname);
+int ltrim_string(char *s); // return: length of string after trimming
+int rtrim_string(char *s);
+int trim_string(char *s);
+int str_break(const char *s, char c, char **first, char **second);
+char *str_escape(const char *source, int space_hack);
+char *str_unescape(const char *source);
+char *pretty_name(const char *filename);
+int get_num_lines(const char *text);
+char *str_concat(const char *s, ...);
+
+
+/* filesystem */
+int make_backup_file(const char *filename, int numbered);
+long file_size(const char *filename);
+int is_directory(const char *filename);
+/* following functions should free() the resulting strings */
+char *get_home_directory(void); /* "default" directory for user files, i.e. $HOME, My Documents, etc. */
+char *get_dot_directory(void); /* where settings files go (%AppData% on Windows, same as $HOME elsewhere) */
+char *get_current_directory(void); /* just a getcwd() wrapper */
+
+void put_env_var(const char *key, const char *value);
+void unset_env_var(const char *key);
+
+/* integer sqrt (very fast; 32 bits limited) */
+unsigned int i_sqrt(unsigned int r);
+
+/* sleep in msec */
+void ms_sleep(unsigned int m);
+
+/* run a hook */
+int run_hook(const char *dir, const char *name, const char *maybe_arg);
+
+/* Mostly a glorified rename(), with fixes for certain dumb OSes.
+If 'overwrite' is zero, attempts to rename over an existing file will fail with EEXIST. */
+int rename_file(const char *old, const char *newf, int overwrite);
+
+#endif /* ! UTIL_H */
+
© All Rights Reserved